* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #0ea5e9;
    --accent: #10b981;
    --accent-dark: #059669;
    --warning: #f59e0b;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --dark-medium: #334155;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --white: #ffffff;
    --glass: rgba(255, 255, 255, 0.06);
    --glass-light: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* ===== Light Theme Variables ===== */
[data-theme="light"] {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #6366f1;
    --secondary: #0284c7;
    --accent: #059669;
    --accent-dark: #047857;
    --warning: #d97706;
    --dark: #f8fafc;
    --dark-light: #ffffff;
    --dark-medium: #e2e8f0;
    --gray: #64748b;
    --gray-light: #475569;
    --white: #0f172a;
    --glass: rgba(0, 0, 0, 0.03);
    --glass-light: rgba(0, 0, 0, 0.05);
    --glass-border: rgba(0, 0, 0, 0.1);
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .gradient-bg {
    background:
        radial-gradient(ellipse at 10% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
        radial-gradient(ellipse at 90% 80%, rgba(14, 165, 233, 0.08) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 50%, rgba(16, 185, 129, 0.04) 0%, transparent 50%);
}

[data-theme="light"] .panel {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .panel-header {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .upload-area {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .file-item,
[data-theme="light"] .generate-item,
[data-theme="light"] .download-item {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .file-item:hover,
[data-theme="light"] .generate-item:hover,
[data-theme="light"] .download-item:hover {
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .modal {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .modal-overlay {
    background: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .modal h2 {
    color: #0f172a;
}

[data-theme="light"] .dropdown-menu,
[data-theme="light"] .user-dropdown {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .dropdown-item:hover {
    background: rgba(99, 102, 241, 0.08);
}

[data-theme="light"] .header h1 {
    background: linear-gradient(135deg, #0f172a, #4f46e5);
    -webkit-background-clip: text;
    background-clip: text;
}

[data-theme="light"] .stat-item {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .contact-box {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .security-toast {
    background: #ffffff;
    border-color: rgba(239, 68, 68, 0.3);
}

[data-theme="light"] .footer {
    color: #334155;
}

[data-theme="light"] .footer a,
[data-theme="light"] .footer-links a {
    color: #475569 !important;
}

/* ===== Theme Toggle ===== */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--gray-light);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.theme-toggle:hover {
    color: var(--white);
    border-color: var(--primary);
    background: var(--glass-light);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

/* ===== Notification Bell ===== */
.notification-bell {
    cursor: pointer;
    color: var(--gray-light);
    transition: color 0.2s;
    display: flex;
    align-items: center;
    position: relative;
    background: none;
    border: none;
    padding: 0;
}

.notification-bell:hover {
    color: var(--white);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--dark);
    display: none;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 1rem);
    right: -10px;
    width: 320px;
    background: var(--dark-light);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .notification-dropdown {
    background: #ffffff;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.notification-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.notification-dropdown-header h4 {
    font-size: 0.9rem;
    color: var(--white);
    margin: 0;
}

.notification-dropdown-header button {
    background: none;
    border: none;
    font-size: 0.75rem;
    color: var(--primary-light);
    cursor: pointer;
}

.notification-list-container {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notification-item {
    padding: 0.75rem;
    background: var(--glass-light);
    border-radius: 8px;
    border-left: 3px solid var(--primary-light);
    transition: all 0.2s;
}

.notification-item .notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: var(--white);
    font-weight: 500;
    font-size: 0.9rem;
}

.notification-item .notification-body {
    font-size: 0.85rem;
    color: var(--gray-light);
    line-height: 1.5;
    word-wrap: break-word;
    margin-top: 0.75rem;
    display: none;
    padding-top: 0.5rem;
    border-top: 1px solid var(--glass-border);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--dark);
    color: var(--white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 10% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
        radial-gradient(ellipse at 90% 80%, rgba(14, 165, 233, 0.12) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 50%, rgba(16, 185, 129, 0.06) 0%, transparent 50%);
    z-index: -1;
}

/* Header */
.header {
    text-align: center;
    padding: 1.5rem 2rem 1rem;
    animation: fadeInDown 0.5s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 0.3rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    /* Background styles removed for image logo */
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 22px;
    height: 22px;
    color: white;
}

.header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--white), var(--gray-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--gray-light);
    font-size: 0.9rem;
}

/* Main Container - 3 Column Layout */
.main-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.25rem;
    padding: 1rem 1.5rem;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    animation: fadeInUp 0.5s ease-out 0.1s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Panel Styles */
.panel {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--glass-light);
}

.panel-header h2 {
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--white);
}

.panel-header h2 svg {
    width: 18px;
    height: 18px;
    color: var(--primary-light);
}

.file-count,
.ready-count {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    background: var(--glass-light);
    border-radius: 20px;
    color: var(--gray-light);
}

.ready-count {
    color: var(--accent);
}

/* Upload Area */
.upload-area {
    margin: 1rem;
    padding: 1.5rem 1rem;
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--glass);
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-area.drag-over {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.08);
    transform: scale(1.02);
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25);
}

.upload-icon svg {
    width: 22px;
    height: 22px;
    color: white;
}

.upload-text {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--white);
}

.upload-hint {
    font-size: 0.8rem;
    color: var(--gray-light);
}

/* File List */
.file-list,
.generate-list,
.download-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    min-height: 200px;
}

.file-item,
.generate-item,
.download-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--glass-light);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.file-item:hover,
.generate-item:hover,
.download-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.item-icon.json {
    background: linear-gradient(135deg, var(--warning), #d97706);
}

.item-icon.ready {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.item-icon.excel {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.item-icon svg {
    width: 18px;
    height: 18px;
    color: white;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--white);
}

.item-meta {
    font-size: 0.7rem;
    color: var(--gray-light);
    display: flex;
    gap: 0.5rem;
}

.item-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.item-btn svg {
    width: 16px;
    height: 16px;
}

.item-btn.remove {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.item-btn.remove:hover {
    background: rgba(239, 68, 68, 0.2);
}

.item-btn.generate {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.item-btn.generate:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.item-btn.generate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.item-btn.download {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
}

.item-btn.download:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Status Badge */
.status-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 500;
}

.status-badge.pending {
    background: rgba(100, 116, 139, 0.2);
    color: var(--gray-light);
}

.status-badge.processing {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
}

.status-badge.ready {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 150px;
    color: var(--gray);
    text-align: center;
    padding: 1rem;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.85rem;
}

/* Action Buttons */
.action-btn {
    margin: 0.75rem;
    padding: 0.875rem 1rem;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.action-btn svg {
    width: 18px;
    height: 18px;
}

.generate-all-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
}

.generate-all-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
}

.download-all-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
}

.download-all-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.35);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Spinner for loading */
.spinner {
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Footer */
.footer {
    text-align: center;
    padding: 1rem;
    color: var(--gray);
    font-size: 0.8rem;
}

/* Scrollbar */
.file-list::-webkit-scrollbar,
.generate-list::-webkit-scrollbar,
.download-list::-webkit-scrollbar {
    width: 6px;
}

.file-list::-webkit-scrollbar-track,
.generate-list::-webkit-scrollbar-track,
.download-list::-webkit-scrollbar-track {
    background: transparent;
}

.file-list::-webkit-scrollbar-thumb,
.generate-list::-webkit-scrollbar-thumb,
.download-list::-webkit-scrollbar-thumb {
    background: var(--dark-medium);
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .file-list,
    .generate-list,
    .download-list {
        min-height: 150px;
        max-height: 250px;
    }
}

@media (max-width: 640px) {
    .main-container {
        padding: 1rem;
    }

    .panel-header {
        padding: 0.875rem 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-actions {
        width: 100%;
        justify-content: center;
    }
}

/* =========================================
   Auth & Navigation Styles (Ported)
   ========================================= */

/* Nav Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Nav Dropdown (Other Tools) */
.nav-dropdown {
    position: relative;
}

.nav-link {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--gray-light);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.nav-link:hover {
    background: var(--glass-light);
    color: var(--white);
    border-color: var(--primary-light);
}

.nav-link svg {
    width: 16px;
    height: 16px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: #1e293b;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 240px;
    /* Slight increase */
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    z-index: 50;
    animation: slideDown 0.2s ease-out;
}

/* Invisible bridge to prevent menu from closing when moving cursor */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -10px;
    /* Covers the margin gap */
    left: 0;
    width: 100%;
    height: 10px;
}

.nav-dropdown:hover .dropdown-menu {
    display: flex;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: var(--gray-light);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 0.9rem;
    white-space: nowrap;
    /* Prevents text wrapping */
}

.dropdown-item:hover {
    background: rgba(94, 234, 212, 0.1);
    color: var(--teal-light);
}

.dropdown-logo {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover;
}

.dropdown-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    /* Prevents icon shrinking */
}

/* Auth Buttons */
.login-btn,
.logout-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.login-btn:hover,
.logout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.login-btn svg,
.logout-btn svg {
    width: 18px;
    height: 18px;
}

/* User Panel */
.user-panel {
    position: relative;
    cursor: pointer;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--glass-border);
    transition: all 0.2s;
}

.user-panel.premium-user .user-avatar {
    border: 2px solid #fbbf24;
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.2);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.75rem;
    background: #1e293b;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem;
    width: 260px;
    display: none;
    /* Toggled by JS class 'active' */
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    z-index: 50;
    animation: slideDown 0.2s ease-out;
}

.user-dropdown.active {
    display: flex;
}

.user-info {
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.user-name {
    font-weight: 600;
    color: var(--white);
    display: block;
    margin-bottom: 0.25rem;
}

.premium-badge {
    color: #fbbf24;
    display: inline-flex;
    align-items: center;
}

.premium-badge svg {
    width: 16px;
    height: 16px;
}

.user-email {
    font-size: 0.8rem;
    color: var(--gray-light);
    word-break: break-all;
}

.user-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray-light);
}

.stat-value {
    font-weight: 600;
    color: var(--primary-light);
}

/* Premium Info */
.premium-info {
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
}

.premium-period {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: #fbbf24;
    font-weight: 500;
}

.premium-period svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

#premiumPeriodText.expired {
    color: #ef4444;
}

.premium-info:has(#premiumPeriodText.expired) {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

.premium-info:has(#premiumPeriodText.expired) .premium-period svg {
    color: #ef4444;
}

.logout-btn {
    width: 100%;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    box-shadow: none;
}

/* Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal {
    background: #1e293b;
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    width: 90%;
    max-width: 420px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.close-modal svg {
    width: 20px;
    height: 20px;
}

.modal-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-icon {
    width: 64px;
    height: 64px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.modal-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.modal-icon.help {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent);
}

.modal-icon svg {
    width: 32px;
    height: 32px;
}

.modal h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--white);
}

.modal p {
    color: var(--gray-light);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.google-btn {
    width: 100%;
    background: white;
    color: #1f2937;
    border: none;
    padding: 0.75rem;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: transform 0.2s;
    margin-bottom: 1rem;
}

.google-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.google-btn img {
    width: 20px;
    height: 20px;
}

.modal-footer {
    border-top: 1px solid var(--glass-border);
    padding-top: 1rem;
    width: 100%;
    margin-top: 0.5rem;
}

.modal-footer p {
    font-size: 0.8rem;
    margin-bottom: 0;
}

.modal-footer a {
    color: var(--primary-light);
    text-decoration: none;
}

.modal-footer a:hover {
    text-decoration: underline;
}

/* Limit Modal Specifics */
.limit-message {
    margin-bottom: 0.5rem;
}

.contact-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-bottom: 1rem;
}

.email-text {
    font-family: monospace;
    color: var(--primary-light);
    font-size: 0.9rem;
}

.copy-btn {
    background: transparent;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.copy-btn:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

.copy-btn.copied {
    color: var(--accent);
}

/* Help Modal Specifics */
.help-section {
    margin-bottom: 1.5rem;
}

.response-time {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--accent);
    background: rgba(16, 185, 129, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    margin-top: 0.5rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* Footer Links */
.footer-links a:hover {
    color: var(--primary-light) !important;
}

/* Security Toast Notifications */
.security-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e293b;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    max-width: 90%;
    text-align: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.security-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.security-toast.warning {
    border-color: rgba(251, 191, 36, 0.3);
    color: #fde68a;
}

/* Avatar Fallback Icon (when no profile picture) */
.user-avatar-fallback {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #334155, #1e293b);
    border: 2px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #94a3b8;
}

.premium-user .user-avatar-fallback {
    border-color: #fbbf24;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.25);
}

/* SEO Content & FAQ Styling */
.faq-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

[data-theme="light"] .faq-item {
    background: rgba(0, 0, 0, 0.02) !important;
}

[data-theme="light"] .faq-item:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1;
    color: var(--primary-color);
    transition: transform 0.2s;
}

.faq-item[open] summary::after {
    content: '−';
    transform: rotate(180deg);
}

/* ===== Feedback Modal Styles ===== */
.modal-icon.feedback {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.feedback-modal {
    max-width: 480px;
}

.feedback-field {
    margin-bottom: 1rem;
    text-align: left;
}

.feedback-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-light);
    margin-bottom: 0.4rem;
}

.feedback-field input,
.feedback-field textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--glass-light);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--white);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    outline: none;
}

.feedback-field input::placeholder,
.feedback-field textarea::placeholder {
    color: var(--gray);
}

.feedback-field input:focus,
.feedback-field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.feedback-field textarea {
    resize: vertical;
    min-height: 80px;
    max-height: 200px;
}

/* Phrase Rating Pills */
.phrase-rating {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.phrase-rating .phrase-pill {
    background: var(--glass-light);
    border: 1px solid var(--glass-border);
    color: var(--gray-light);
    padding: 0.5rem 0.9rem;
    border-radius: 20px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.phrase-rating .phrase-pill:hover {
    border-color: var(--primary);
    color: var(--white);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.phrase-rating .phrase-pill.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

[data-theme="light"] .phrase-rating .phrase-pill {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: #475569;
}

[data-theme="light"] .phrase-rating .phrase-pill:hover {
    background: rgba(79, 70, 229, 0.08);
    color: #0f172a;
}

[data-theme="light"] .phrase-rating .phrase-pill.active {
    color: white;
}

/* Feedback Submit Button */
.feedback-submit-btn {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.feedback-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
}

.feedback-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.feedback-submit-btn .btn-spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

.feedback-submit-btn.success {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

/* Light theme overrides for feedback */
[data-theme="light"] .feedback-field input,
[data-theme="light"] .feedback-field textarea {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.12);
    color: #0f172a;
}

[data-theme="light"] .feedback-field input:focus,
[data-theme="light"] .feedback-field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

[data-theme="light"] .star-rating .star {
    color: #d1d5db;
}