:root {
    /* Light theme */
    --primary-color: #4a90e2;
    --primary-hover: #357abd;
    --background-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #666666;
    --border-color: #e1e4e8;
    --header-bg: rgba(255, 255, 255, 0.95);
    --footer-bg: #2c3e50;
    --footer-text: #ffffff;
    --nav-active: #4a90e2;
    --nav-hover: #f0f4f8;
    --modal-bg: #ffffff;
    --input-bg: #ffffff;
    --input-border: #dcdfe6;
    --button-text: #ffffff;
    --notification-success-bg: #d4edda;
    --notification-success-text: #155724;
    --notification-error-bg: #f8d7da;
    --notification-error-text: #721c24;
    --notification-info-bg: #d1ecf1;
    --notification-info-text: #0c5460;
    --secondary-color: #00B894;
    --accent-color: #FDCB6E;
    --success-color: #00B894;
    --error-color: #E74C3C;
    --warning-color: #F39C12;
    --border-radius: 10px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    --card-hover-transform: translateY(-5px);
    --transition-speed: 0.3s;
    --primary-color-rgb: 74, 144, 226;
}

/* ================================== */
/* ======== DARK MODE STYLES ======== */
/* ================================== */

[data-theme="dark"] {
    /* --- Core Colors --- */
    --primary-color: #5c9ce6;        /* Lighter blue for dark bg */
    --primary-hover: #4a90e2;
    --background-color: #121212;     /* True dark background */
    --card-bg: #1e1e1e;              /* Slightly lighter card bg */
    --text-color: #f0f0f0;           /* Brighter text */
    --text-muted: #a0a0a0;           /* Muted text */
    --border-color: #3a3a3a;         /* Visible border */
    
    /* --- Header & Footer --- */
    --header-bg: #1a1a1a;            /* Dark header */
    --footer-bg: #1a1a1a;            /* Dark footer */
    --footer-text: #e0e0e0;
    
    /* --- Navigation --- */
    --nav-active: #5c9ce6;
    --nav-hover: #2a2a2a;
    
    /* --- Interactive Elements --- */
    --input-bg: #2a2a2a;
    --input-border: #404040;
    --modal-bg: #1e1e1e;
    --button-text: #ffffff;          /* Ensure button text is white */
    
    /* --- Notifications --- */
    --notification-success-bg: #0f3923;
    --notification-success-text: #8dffa6;
    --notification-error-bg: #3b1a1d;
    --notification-error-text: #ff8d96;
    --notification-info-bg: #1a3038;
    --notification-info-text: #8ddfff;

    /* --- Other Specifics --- */
    --secondary-color: #00cfb1;      /* Adjust secondary if needed */
    --accent-color: #ffda85;         /* Adjust accent if needed */
    --box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); /* Darker shadow */
    --primary-color-rgb: 92, 156, 230;
}

/* --- Element Specific Overrides for Dark Mode --- */

/* Body */
[data-theme="dark"] body {
    background-color: var(--background-color);
    color: var(--text-color);
}

/* Headings and Paragraphs */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] p,
[data-theme="dark"] label,
[data-theme="dark"] span,
[data-theme="dark"] li {
    color: var(--text-color);
}

/* Muted Text */
[data-theme="dark"] .text-muted, 
[data-theme="dark"] small {
    color: var(--text-muted);
}

/* Links */
[data-theme="dark"] a {
    color: var(--primary-color);
}
[data-theme="dark"] a:hover {
    color: var(--primary-hover);
}

/* Header */
[data-theme="dark"] .site-header {
    background-color: var(--header-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-color); /* Add subtle border */
}
[data-theme="dark"] .logo-text {
    color: var(--text-color);
}
[data-theme="dark"] .nav-link {
    color: var(--text-color);
}
[data-theme="dark"] .nav-link.active {
    color: var(--nav-active);
}
[data-theme="dark"] .nav-link:hover {
    background-color: var(--nav-hover);
}
[data-theme="dark"] .theme-toggle {
    color: var(--text-color);
}

/* Footer */
[data-theme="dark"] .site-footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
}
[data-theme="dark"] .footer-section a {
    color: var(--footer-text);
}
[data-theme="dark"] .footer-section a:hover {
    color: var(--primary-color);
}
[data-theme="dark"] .social-links a {
    color: var(--footer-text);
}

/* Cards, Sections, Containers */
[data-theme="dark"] .card,
[data-theme="dark"] .result-card,
[data-theme="dark"] .mnemonic-creator,
[data-theme="dark"] .saved-mnemonic,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .container,
[data-theme="dark"] .section,
[data-theme="dark"] .privacy-container,
[data-theme="dark"] .hero-section, /* Ensure hero is dark */
[data-theme="dark"] .hero {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow);
}

/* Inputs, Textareas, Selects */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-color);
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #888888; /* Placeholder text */
}
[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(92, 156, 230, 0.3); /* Focus ring */
}

/* Buttons */
[data-theme="dark"] .nav-btn,
[data-theme="dark"] .generate-btn,
[data-theme="dark"] .action-btn,
[data-theme="dark"] .submit-btn,
[data-theme="dark"] .delete-btn,
[data-theme="dark"] .use-btn {
    background-color: var(--primary-color);
    color: var(--button-text);
}
[data-theme="dark"] .nav-btn:hover,
[data-theme="dark"] .generate-btn:hover,
[data-theme="dark"] .action-btn:hover,
[data-theme="dark"] .submit-btn:hover,
[data-theme="dark"] .delete-btn:hover,
[data-theme="dark"] .use-btn:hover {
    background-color: var(--primary-hover);
}

/* Notifications */
[data-theme="dark"] .notification {
     box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .notification.success {
    background-color: var(--notification-success-bg);
    color: var(--notification-success-text);
    border-left-color: #00b894;
}
[data-theme="dark"] .notification.error {
    background-color: var(--notification-error-bg);
    color: var(--notification-error-text);
    border-left-color: #e74c3c;
}
[data-theme="dark"] .notification.info {
    background-color: var(--notification-info-bg);
    color: var(--notification-info-text);
    border-left-color: #5c9ce6;
}

/* Modals */
[data-theme="dark"] .modal {
    background-color: rgba(0, 0, 0, 0.7); /* Darker overlay */
}
[data-theme="dark"] .close {
     color: var(--text-muted);
}
[data-theme="dark"] .close:hover {
     color: var(--text-color);
     background-color: rgba(255, 255, 255, 0.1);
}

/* Dividers */
[data-theme="dark"] hr,
[data-theme="dark"] .divider {
    border-color: var(--border-color);
    background-color: var(--border-color);
}

/* Global Styles */
body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header Styles */
.site-header {
    background: var(--header-bg);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

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

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    font-weight: bold;
}

.logo-img {
    height: 32px;
    width: 32px;
    margin-right: 0.5rem;
}

.logo-text {
    font-size: 1.5rem;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: var(--nav-hover);
}

.nav-link.active {
    color: var(--nav-active);
    font-weight: 500;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Early auth hint to reduce flash on reload */
html[data-auth="true"] #loginBtn,
html[data-auth="true"] #registerBtn {
    display: none !important;
}
html[data-auth="true"] #logoutBtn,
html[data-auth="true"] #myMnemonicsBtn,
html[data-auth="true"] #userGreeting {
    display: inline-block !important;
}

.nav-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background-color: var(--primary-color);
    color: var(--button-text);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(15deg);
}

/* Footer Styles */
.site-footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 3rem 0 1rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

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

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: var(--footer-text);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Modal Styles - Enhanced for login/signup */
.modal {
    display: none;
    position: fixed;
    z-index: 1500;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 10vh auto;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    width: 90%;
    max-width: 450px;
    transform: translateY(0);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.8rem;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: var(--text-muted);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close:hover {
    color: var(--text-color);
    background-color: rgba(150, 150, 150, 0.1);
}

/* Form Styling */
#loginForm, #registerForm {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.form-group input {
    padding: 0.8rem 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--input-border);
    background-color: var(--input-bg);
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(92, 156, 230, 0.3);
    outline: none;
}

.form-message {
    min-height: 24px;
    color: var(--error-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.submit-btn {
    padding: 0.8rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.submit-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn i {
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .main-nav {
        flex-direction: column;
        width: 100%;
    }

    .nav-links {
        justify-content: center;
    }

    .nav-controls {
        flex-direction: column;
        width: 100%;
    }

    .auth-buttons {
        justify-content: center;
    }

    .footer-sections {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .logo-text {
        display: none;
    }
    
    .auth-buttons {
        flex-wrap: wrap;
    }
    
    .nav-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Animation for theme toggle */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.theme-toggle i {
    transition: transform 0.5s ease;
}

.theme-toggle:hover i {
    animation: rotate 1s ease;
}

/* Navbar Styles */
.navbar {
    background: var(--card-bg);
    padding: 1rem 2rem;
    box-shadow: var(--box-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color var(--transition-speed) ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(rgba(108, 92, 231, 0.1), rgba(108, 92, 231, 0.05));
    border-bottom: 1px solid var(--border-color);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    text-shadow: 0 2px 10px rgba(108, 92, 231, 0.2);
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-color);
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
}

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

/* Mnemonic Creator - Enhanced Styling */
.mnemonic-creator {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mnemonic-creator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.input-group label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Add icons to labels */
.input-group label[for="category"]::before {
    content: '\f0b1';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: var(--primary-color);
}

.input-group label[for="wordInput"]::before {
    content: '\f044';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: var(--primary-color);
}

/* Select and textarea styling */
select#category {
    background-color: var(--input-bg);
    color: var(--text-color);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius);
    padding: 0.8rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%235c6ac4' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
    cursor: pointer;
}

select#category:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(92, 156, 230, 0.3);
    outline: none;
}

textarea#wordInput {
    background-color: var(--input-bg);
    color: var(--text-color);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius);
    padding: 1rem;
    font-size: 1rem;
    min-height: 120px;
    resize: vertical;
    transition: all 0.3s ease;
    line-height: 1.5;
}

textarea#wordInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(92, 156, 230, 0.3);
    outline: none;
}

textarea#wordInput::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Options section styling */
.options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    background-color: rgba(var(--primary-color-rgb), 0.05);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(var(--primary-color-rgb), 0.1);
}

.option-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.option-item:hover {
    background-color: rgba(var(--primary-color-rgb), 0.08);
}

.option-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.2rem;
    height: 1.2rem;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    display: inline-block;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-item input[type="checkbox"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.option-item input[type="checkbox"]:checked::before {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.7rem;
}

.option-item input[type="checkbox"]:focus {
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.3);
    outline: none;
}

.option-item label {
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
}

/* Generate button styling */
.generate-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(var(--primary-color-rgb), 0.4);
}

.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.6s ease;
}

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(var(--primary-color-rgb), 0.5);
}

.generate-btn:hover::before {
    left: 100%;
}

.generate-btn:active {
    transform: translateY(-1px);
}

.generate-btn i {
    font-size: 1.2rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .mnemonic-creator {
        padding: 1.5rem;
    }
    
    .options {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .option-item {
        padding: 0.3rem;
    }
    
    .generate-btn {
        padding: 0.8rem 1.2rem;
        font-size: 1rem;
    }
}

/* Result Section */
.result-section {
    margin-top: 2rem;
    display: none;
}

.result-section.show {
    display: block;
}

.result-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    position: relative;
}

.result-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.result-card .mnemonic {
    font-size: 1.3rem;
    padding: 1rem;
    background: rgba(108, 92, 231, 0.2);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    font-weight: 500;
    border: 1px solid rgba(108, 92, 231, 0.3);
}

.card-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

.card-btn {
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-color);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

.card-btn:hover {
    background: var(--primary-color);
    color: white;
}

.card-btn.copy-btn:hover {
    background: var(--success-color);
}

.card-btn.save-btn:hover {
    background: var(--accent-color);
    color: #222;
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 1rem 0;
}

.result-card h4 {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.explanation {
    line-height: 1.7;
}

/* Alternative Mnemonics */
.alternative {
    background: rgba(108, 92, 231, 0.1);
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    border: 1px solid rgba(108, 92, 231, 0.2);
    position: relative;
}

.alternative:last-child {
    margin-bottom: 0;
}

.alternative h4 {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.alt-mnemonic {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

.action-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.7rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all var(--transition-speed) ease;
}

.action-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.copy-btn {
    background: var(--secondary-color);
}

.copy-btn:hover {
    background: var(--secondary-color);
    opacity: 0.9;
}

.save-btn {
    background: var(--accent-color);
    color: #333;
}

.save-btn:hover {
    background: var(--accent-color);
    opacity: 0.9;
}

.share-btn {
    background: var(--primary-color);
}

.share-btn:hover {
    background: var(--primary-hover);
}

/* Info Sections */
.info-section, .example-section, .benefits-section, .tips-section, .faq-section {
    padding: 4rem 0;
    text-align: center;
}

.info-section h2, .example-section h2, .benefits-section h2, .tips-section h2, .faq-section h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.section-intro {
    max-width: 800px;
    margin: 0 auto 2rem;
    color: var(--text-color);
    opacity: 0.9;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.step {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform var(--transition-speed) ease;
    border: 1px solid var(--border-color);
}

.step:hover {
    transform: var(--card-hover-transform);
}

.step i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    animation: float 6s infinite ease-in-out;
}

/* Examples Section */
.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.category-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

/* Tips Section */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tip-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: transform var(--transition-speed) ease;
    border: 1px solid var(--border-color);
}

.tip-card:hover {
    transform: var(--card-hover-transform);
}

.tip-card i {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    animation: float 6s infinite ease-in-out;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    border: 4px solid rgba(108, 92, 231, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

/* Notification Styles */
#notificationContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.notification {
    padding: 12px 20px;
    border-radius: 6px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    max-width: 400px;
    animation: slideIn 0.3s ease forwards;
    transition: all 0.3s ease;
}

.notification.success {
    background-color: var(--notification-success-bg);
    color: var(--notification-success-text);
}

.notification.error {
    background-color: var(--notification-error-bg);
    color: var(--notification-error-text);
}

.notification.info {
    background-color: var(--notification-info-bg);
    color: var(--notification-info-text);
}

.notification-icon {
    font-size: 1.2rem;
}

.notification-content {
    flex: 1;
}

.notification-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.notification-close:hover {
    opacity: 1;
}

/* Card Styles */
.card, .result-card, .mnemonic-creator, .saved-mnemonic {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
}

.theme-toggle-btn:hover {
    background: rgba(108, 92, 231, 0.2);
    transform: rotate(30deg);
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(108, 92, 231, 0.2); }
    50% { box-shadow: 0 0 20px rgba(108, 92, 231, 0.6); }
    100% { box-shadow: 0 0 5px rgba(108, 92, 231, 0.2); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.mnemonic {
    animation: pulse 6s infinite ease-in-out;
}

.notification.fade-out {
    animation: fadeOut 0.5s ease forwards;
}

/* Enhanced Dark Mode Styles */
[data-theme="dark"] .card:hover, 
[data-theme="dark"] .result-card:hover, 
[data-theme="dark"] .saved-mnemonic:hover,
[data-theme="dark"] .step:hover,
[data-theme="dark"] .tip-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .hero {
    background: linear-gradient(to bottom, #1a1a1a, #121212);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .mnemonic,
[data-theme="dark"] .alt-mnemonic {
    background-color: rgba(92, 156, 230, 0.15);
    border: 1px solid rgba(92, 156, 230, 0.3);
}

[data-theme="dark"] .generate-btn {
    background: linear-gradient(135deg, var(--primary-color), #4a7ad1);
    animation: dark-glow 4s infinite ease-in-out;
}

[data-theme="dark"] .generate-btn:hover {
    background: linear-gradient(135deg, #4a7ad1, var(--primary-color));
    box-shadow: 0 6px 16px rgba(92, 156, 230, 0.4);
}

[data-theme="dark"] .site-header,
[data-theme="dark"] .navbar {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .modal-content {
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .alternative {
    background: rgba(92, 156, 230, 0.1);
    border: 1px solid rgba(92, 156, 230, 0.2);
}

/* Dark mode scrollbar */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #1a1a1a;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 5px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #555;
}

@keyframes dark-glow {
    0% { box-shadow: 0 0 5px rgba(92, 156, 230, 0.2); }
    50% { box-shadow: 0 0 20px rgba(92, 156, 230, 0.5); }
    100% { box-shadow: 0 0 5px rgba(92, 156, 230, 0.2); }
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none; /* Hidden by default on larger screens */
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1100; /* Ensure it's above other header content */
}

/* --- Mobile Styles --- */
@media (max-width: 992px) { /* Adjust breakpoint as needed */

    /* Keep header content in a row, space between logo and toggle */
    .header-content {
        /* Remove flex-direction: column; if it exists */
        /* Ensure these are set (they are default, but good to be explicit) */
        flex-direction: row; 
        justify-content: space-between;
        align-items: center;
    }

    .mobile-menu-toggle {
        display: block; /* Show hamburger on smaller screens */
        order: 3; /* Ensure toggle button is on the far right */
    }

    /* Keep the main nav container itself ready to be toggled */
    .main-nav {
        display: none; /* Hide the regular nav container */
        flex-direction: column;
        position: absolute;
        top: 100%; /* Position below the header */
        left: 0;
        width: 100%;
        background-color: var(--card-bg); /* Use card background for dropdown */
        border-top: 1px solid var(--border-color);
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        padding: 1rem 0;
        z-index: 1050; /* Below toggle, above page content */
        order: 4; /* Place it last in source order flow if needed */
    }

    /* Styles for when the menu is shown */
    .main-nav.show-mobile-menu {
        display: flex; /* Show the menu when class is added */
    }

    /* Styles for links and controls inside the toggled menu */
    .nav-links, .nav-controls {
        flex-direction: column;
        align-items: center; /* Center items vertically */
        width: 100%;
        gap: 0; /* Reset gap for vertical layout */
    }

    .nav-link {
        padding: 0.8rem 1rem;
        width: 90%; /* Make links take more width */
        text-align: center;
        border-bottom: 1px solid var(--border-color);
    }
    .nav-link:last-child {
        border-bottom: none;
    }

    .nav-controls {
        padding-top: 1rem; /* Add space between links and controls */
        gap: 1rem; /* Add some gap back for controls */
    }

    .auth-buttons {
        flex-direction: column; /* Stack auth buttons */
        width: 80%; /* Control width */
        margin: 0 auto; /* Center */
    }

    .nav-btn {
        width: 100%; /* Make buttons full width */
        justify-content: center; /* Center button text/icon */
        padding: 0.8rem 1rem;
    }

    .theme-toggle {
        margin-bottom: 0.5rem; /* Space below theme toggle */
    }

    /* Prevent body scrolling when mobile menu is open */
    body.mobile-menu-open {
        overflow: hidden;
    }
}

/* Smaller Mobile Refinements */
@media (max-width: 576px) {
    .logo-text {
        display: none; /* Hide logo text on very small screens */
    }
    .header-content {
        padding: 0 0.5rem; /* Reduce padding */
    }
    .nav-link {
        width: 95%;
    }
    .auth-buttons {
        width: 90%;
    }
}

/* Add this generic container style */
.page-container {
    max-width: 1200px; /* Or your preferred max width */
    margin: 2rem auto; /* Centers the container and adds top/bottom margin */
    padding: 0 1rem; /* Adds left/right padding */
}

/* Optional: Specific styling for examples page if needed */
.examples-container h1 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
}
.examples-container p {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-muted);
}
.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}