/* CSS Variables for theming */
:root {
    --bg-primary: #fafbfc;
    --bg-secondary: #fff;
    --bg-gradient-start: #f5f7fa;
    --bg-gradient-end: #e9ecef;
    --bg-how-to-start: #e3f2fd;
    --bg-how-to-end: #e8f5e9;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --text-heading: #1a1a1a;
    --text-label: #495057;
    --border-color: #e1e8ed;
    --input-bg: #f8f9fa;
    --shadow-sm: rgba(0,0,0,0.05);
    --shadow-md: rgba(0,0,0,0.08);
    --shadow-lg: rgba(0,0,0,0.12);
    --footer-bg: #2c3e50;
    --footer-text: #ecf0f1;
    --footer-text-muted: #bdc3c7;
}

[data-theme="dark"] {
    --bg-primary: #111;
    --bg-secondary: #1a1a1a;
    --bg-gradient-start: #1a1a1a;
    --bg-gradient-end: #222;
    --bg-how-to-start: #1a2332;
    --bg-how-to-end: #1a2a1f;
    --text-primary: #eee;
    --text-secondary: #aaa;
    --text-heading: #fff;
    --text-label: #ccc;
    --border-color: #333;
    --input-bg: #222;
    --shadow-sm: rgba(255,255,255,0.02);
    --shadow-md: rgba(255,255,255,0.05);
    --shadow-lg: rgba(255,255,255,0.08);
    --footer-bg: #0a0a0a;
    --footer-text: #eee;
    --footer-text-muted: #888;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    padding: 0;
    margin: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    text-align: center;
    color: var(--text-heading);
    font-weight: 700;
}

h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem 0;
    color: var(--text-primary);
}

h3 {
    color: var(--text-primary);
}

p {
    margin-bottom: 1rem;
}

a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0052a3;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    padding: 1.5rem 0;
    box-shadow: 0 2px 4px var(--shadow-sm);
    position: relative;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-heading);
    text-decoration: none;
}

/* Navigation */
nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

nav a:hover, nav a.active {
    color: #0066cc;
    border-bottom-color: #0066cc;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--shadow-sm);
}

.dark-mode-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px var(--shadow-md);
}

/* Main Content */
main {
    flex: 1;
    padding: 3rem 0;
}

/* Cards and Sections */
.section {
    background-color: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 12px var(--shadow-md);
    margin-bottom: 3rem;
    transition: background-color 0.3s ease;
}

/* Buttons */
button, .btn {
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background-color: #0066cc;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 102, 204, 0.2);
    display: inline-block;
    text-decoration: none;
}

button:hover, .btn:hover {
    background-color: #0052a3;
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
    transform: translateY(-1px);
    color: #fff;
}

.secondary-btn {
    background-color: #6c757d;
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.2);
}

.secondary-btn:hover {
    background-color: #5a6268;
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

/* Forms */
input[type="text"],
input[type="url"],
input[type="email"],
textarea {
    width: 100%;
    padding: 14px 18px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-family: inherit;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #0066cc;
    background-color: var(--bg-secondary);
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
}

label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-label);
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    margin-top: auto;
    padding: 3rem 20px 2rem;
    text-align: center;
    transition: background-color 0.3s ease;
}

footer h3 {
    color: var(--footer-text);
    margin-bottom: 1rem;
}

footer p {
    color: var(--footer-text-muted);
}

.footer-section {
    margin-bottom: 2rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.footer-links a {
    color: var(--footer-text);
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #0066cc;
}

/* Coffee Button */
.coffee-btn {
    display: inline-block;
    padding: 14px 28px;
    background-color: #FFDD00;
    color: #000;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(255, 221, 0, 0.3);
}

.coffee-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 221, 0, 0.4);
    color: #000;
}

/* Contact Info */
.contact-info {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.contact-info a {
    color: var(--footer-text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: #0066cc;
}

/* Grid Layout */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tool-card {
    background-color: var(--bg-secondary);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 12px var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px var(--shadow-lg);
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }
    
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav ul {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 2rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}