:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --background: #0a0f1e;
    --background-gradient: linear-gradient(135deg, #0a0f1e 0%, #1a1f3a 100%);
    --surface: rgba(30, 41, 59, 0.6);
    --surface-solid: #1e293b;
    --surface-light: #334155;
    --surface-lighter: #475569;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --success: #10b981;
    --error: #ef4444;
    --border: rgba(99, 102, 241, 0.2);
    --border-light: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.3);
    --glow: rgba(99, 102, 241, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background-gradient);
    color: var(--text-primary);
    line-height: 1.5;
}

body {
    display: flex;
    flex-direction: column;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
    animation: backgroundShift 20s ease infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes backgroundShift {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(2%, -2%) rotate(1deg);
    }

    66% {
        transform: translate(-2%, 2%) rotate(-1deg);
    }
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Header */
.app-header {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 10px 24px;
    flex-shrink: 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    height: auto;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo svg {
    color: var(--primary-color);
    filter: drop-shadow(0 0 8px var(--glow));
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        filter: drop-shadow(0 0 8px var(--glow));
    }

    50% {
        filter: drop-shadow(0 0 12px var(--glow));
    }
}

.logo h1 {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 2px;
    font-weight: 400;
}

/* Header Upgrade Section */
.header-upgrade-section {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.limit-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.limit-indicator.critical {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    animation: pulse 2s infinite;
}

.limit-indicator.warning {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
}

.limit-text {
    color: var(--text-secondary);
}

.btn-upgrade-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn-upgrade-header::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: left 0.5s;
}

.btn-upgrade-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

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

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

.btn-upgrade-header svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    stroke: none;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {

    0%,
    100% {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }

    50% {
        transform: rotate(180deg) scale(1.1);
        opacity: 0.8;
    }
}

.upgrade-text {
    font-size: 0.9rem;
    font-weight: 600;
}

.upgrade-price {
    font-size: 0.75rem;
    opacity: 0.9;
    padding-left: 4px;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
}

/* Main Layout */
.app-main {
    display: grid;
    grid-template-columns: 440px 1fr;
    gap: 0;
    flex: 1;
    overflow: hidden;
    min-height: calc(100vh - 64px);
}

/* Left Panel - Form */
.left-panel {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    padding: 0 0 16px 0;
    overflow: hidden;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: calc(100vh - 64px);
}

.left-panel::-webkit-scrollbar {
    width: 8px;
}

.left-panel::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
}

.left-panel::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
    transition: background 0.3s;
}

.left-panel::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Mode Tabs */
.mode-tabs {
    display: flex;
    gap: 8px;
    padding: 16px 16px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.mode-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
}

.mode-tab svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.mode-tab:hover {
    color: var(--text-secondary);
    background: rgba(99, 102, 241, 0.05);
}

.mode-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.mode-tab.active svg {
    color: var(--primary-color);
}

/* Email Mode Container */
.email-mode {
    display: none;
    flex-direction: column;
    height: 100%;
}

.email-mode.active {
    display: flex;
}

/* Form Hint */
.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Reply Form Specific Styles */
#replyForm {
    /* Remove extra padding - form-content-scroll already has padding */
    padding: 0;
}

#replyForm textarea {
    min-height: 120px;
}

/* Original Email textarea - keep monospace font but inherit all other styles */
#originalEmail {
    min-height: 180px;
    font-family: 'Courier New', monospace;
    /* All other styles (padding, border, background, etc.) inherited from general textarea styles */
}

/* Right Panel - Results */
.right-panel {
    background: transparent;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
    height: 100%;
    min-height: calc(100vh - 64px);
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.form-group {
    margin-bottom: 10px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    letter-spacing: 0.3px;
}

input[type="text"],
textarea,
select {
    width: 100%;
    padding: 8px 10px;
    background: rgba(15, 23, 42, 0.5);
    border: 1.5px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

input[type="text"]:hover,
textarea:hover,
select:hover {
    border-color: var(--border);
    background: rgba(15, 23, 42, 0.7);
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), 0 0 20px rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
}

input[type="text"]::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

textarea {
    resize: vertical;
    min-height: 70px;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236366f1' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.enhanced-select {
    position: relative;
    width: 100%;
}

.enhanced-select-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.enhanced-select-trigger {
    width: 100%;
    padding: 8px 10px;
    background: rgba(15, 23, 42, 0.5);
    border: 1.5px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
    transition: all 0.3s ease;
    cursor: pointer;
}

.enhanced-select-trigger:hover {
    border-color: var(--border);
    background: rgba(15, 23, 42, 0.7);
}

.enhanced-select-trigger:focus,
.enhanced-select-trigger:focus-visible {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), 0 0 20px rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
}

.enhanced-select-trigger-text {
    flex: 1;
    text-align: left;
}

.enhanced-select-trigger-badge {
    margin-left: auto;
    font-size: 0.65rem;
}

.enhanced-select-trigger-badge[hidden] {
    display: none;
}

.enhanced-select-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transition: transform 0.2s ease;
}

.enhanced-select-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.45);
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    display: none;
    z-index: 1200;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.enhanced-select.open .enhanced-select-dropdown {
    display: block;
}

.enhanced-select.open .enhanced-select-trigger {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.enhanced-select.open .enhanced-select-arrow {
    transform: rotate(180deg);
}

.enhanced-select-option {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.enhanced-select-option:hover {
    background: rgba(99, 102, 241, 0.12);
}

.enhanced-select-option.selected {
    background: rgba(99, 102, 241, 0.18);
    font-weight: 600;
}

.enhanced-select-option.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.enhanced-select-option.disabled:hover {
    background: transparent;
}

.enhanced-select-option .user-status {
    font-size: 0.65rem;
    padding: 2px 8px;
}

.enhanced-select-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.enhanced-select-group .user-status {
    font-size: 0.6rem;
    padding: 2px 6px;
}

.enhanced-select-dropdown::-webkit-scrollbar {
    width: 6px;
}

.enhanced-select-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.enhanced-select-dropdown::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 10px;
}

.enhanced-select-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}


.privacy-notice {
    background: rgba(99, 102, 241, 0.08);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 12px;
    text-align: center;
}

.privacy-notice p {
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-muted);
    margin: 0;
}

.privacy-notice a {
    color: var(--primary-light);
    text-decoration: underline;
}

.privacy-notice a:hover {
    color: var(--primary-color);
}

.btn-generate {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    background-size: 200% 200%;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.4s ease;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4), 0 0 40px rgba(99, 102, 241, 0.2);
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.btn-generate::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: left 0.5s;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5), 0 0 60px rgba(99, 102, 241, 0.3);
    background-position: right center;
}

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

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

.btn-generate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-generate .btn-limit {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
    min-width: 32px;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-generate .btn-limit.warning {
    background: rgba(251, 191, 36, 0.8);
    border-color: rgba(251, 191, 36, 1);
    animation: pulse 1s ease-in-out infinite;
}

.btn-generate .btn-limit.critical {
    background: rgba(239, 68, 68, 0.8);
    border-color: rgba(239, 68, 68, 1);
    animation: pulse 0.5s ease-in-out infinite;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px;
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow-y: auto;
    max-height: calc(100vh - 64px);
}

/* Hide scrollbar by default, show on hover */
.empty-state {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.empty-state:hover,
.empty-state:focus-within {
    scrollbar-color: var(--primary-color) transparent;
}

.empty-state::-webkit-scrollbar {
    width: 8px;
}

.empty-state::-webkit-scrollbar-track {
    background: transparent;
}

.empty-state::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.empty-state:hover::-webkit-scrollbar-thumb,
.empty-state:focus-within::-webkit-scrollbar-thumb {
    background: var(--primary-color);
}

.empty-state::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

.empty-state svg {
    color: var(--primary-color);
    opacity: 0.3;
    margin-bottom: 24px;
    filter: drop-shadow(0 0 20px var(--glow));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.empty-state h3 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 600;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 400px;
    line-height: 1.6;
}

/* Demo State - Layout similar to result-container */
.demo-state {
    justify-content: flex-start;
    padding: 24px;
}

.demo-state>svg {
    margin-bottom: 20px;
}

.demo-state>h3 {
    font-size: 1.3rem;
}

.demo-state>p {
    margin-bottom: 20px;
    font-size: 0.9rem;
    max-width: 600px;
}

/* Demo Email Preview */
.demo-email-preview {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.demo-email-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}

.demo-email-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.demo-email-subject {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.demo-email-meta {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.demo-email-meta strong {
    color: var(--text-color);
}

.demo-email-body {
    padding: 16px;
    line-height: 1.6;
    color: var(--text-color);
    font-size: 0.9rem;
    overflow-y: auto;
    flex: 1 1 auto;
}

.demo-email-body p {
    margin: 0 0 12px 0;
    text-align: left;
}

.demo-email-body p:last-child {
    margin-bottom: 0;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    animation: fadeIn 0.3s ease-in;
}

.spinner {
    width: 56px;
    height: 56px;
    margin-bottom: 20px;
    border: 4px solid transparent;
    border-top-color: var(--primary-color);
    border-right-color: var(--secondary-color);
    border-bottom-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    filter: drop-shadow(0 0 10px var(--glow));
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.loading-spinner p {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

/* Result Container */
.result-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: slideIn 0.5s ease-out;
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.result-header h2 {
    font-size: 1.3rem;
    color: var(--text-primary);
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    padding: 10px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn-icon:hover::before {
    width: 100px;
    height: 100px;
}

.btn-icon:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-icon svg {
    position: relative;
    z-index: 1;
}

.btn-icon.copied {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--success);
    color: var(--success);
    animation: successPulse 0.5s ease;
}

@keyframes successPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.email-output {
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 24px;
    white-space: pre-wrap;
    line-height: 1.8;
    color: var(--text-secondary);
    font-size: 0.95rem;
    overflow-y: auto;
    flex: 1;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.email-output.blurred {
    filter: blur(4px);
    user-select: none;
    pointer-events: none;
    position: relative;
}

.email-output.blurred::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg,
            rgba(10, 15, 30, 0) 0%,
            rgba(10, 15, 30, 0.3) 30%,
            rgba(10, 15, 30, 0.7) 60%,
            rgba(10, 15, 30, 0.95) 100%);
    pointer-events: none;
}

.payment-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    min-width: 280px;
    max-width: 320px;
    height: auto;
    max-height: 90vh;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    border: 1px solid var(--primary-color);
    padding: 20px 18px;
    text-align: center;
    animation: fadeIn 0.5s ease;
    z-index: 1000;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(99, 102, 241, 0.2);
    overflow: visible;
}

@keyframes slideInRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes popIn {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.payment-overlay.hidden {
    display: none;
}

.payment-overlay svg {
    width: 36px;
    height: 36px;
    color: var(--primary-color);
    margin-bottom: 12px;
    filter: drop-shadow(0 0 10px var(--glow));
}

.payment-overlay h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-weight: 600;
}

.payment-overlay .price {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    line-height: 1;
}

.payment-overlay .plan-selector {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.payment-overlay .plan-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 12px 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.payment-overlay .plan-btn:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.payment-overlay .plan-btn.active {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.15);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.payment-overlay .plan-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.payment-overlay .plan-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.payment-overlay .plan-period {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.payment-overlay .plan-savings {
    font-size: 0.7rem;
    color: var(--secondary-color);
    font-weight: 600;
    background: rgba(16, 185, 129, 0.2);
    padding: 1px 4px;
    border-radius: 4px;
    margin-top: 1px;
}

.payment-overlay .secure-note {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 8px;
    margin-bottom: 0;
}

.btn-pay {
    width: 100%;
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    background-size: 200% 200%;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-pay svg {
    color: white;
    stroke: white;
}

.btn-pay::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: left 0.5s;
}

.btn-pay:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
    background-position: right center;
}

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

.btn-pay:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.email-output::-webkit-scrollbar {
    width: 8px;
}

.email-output::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
    border-radius: 4px;
}

.email-output::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
    transition: background 0.3s;
}

.email-output::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Error Container */
.error-container {
    position: fixed;
    bottom: 32px;
    right: 32px;
    max-width: 400px;
    padding: 18px 20px;
    background: rgba(239, 68, 68, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid var(--error);
    border-radius: 12px;
    animation: slideInUp 0.4s ease-out;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.3);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.error-content svg {
    color: var(--error);
    flex-shrink: 0;
    filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.5));
}

.error-content p {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Responsive Design */

/* Large Desktop (1200px+) - Default styles above */

/* Desktop / Large Tablet (1024px - 1200px) */
@media (max-width: 1200px) {
    .app-main {
        grid-template-columns: 400px 1fr;
    }
}

/* Tablet Landscape (768px - 1024px) */
@media (max-width: 1024px) {
    .app-main {
        grid-template-columns: 380px 1fr;
    }

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

    .left-panel,
    .right-panel {
        padding: 24px;
    }
}

/* Tablet Portrait (600px - 768px) */
@media (max-width: 768px) {
    .app-main {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }

    .left-panel {
        border-right: none;
        border-bottom: none;
        max-height: none;
        padding: 20px;
        height: 100%;
    }

    .right-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--background-gradient);
        z-index: 200;
        max-height: none;
        padding: 80px 20px 20px 20px;
        display: none;
    }

    .right-panel.mobile-visible {
        display: flex;
    }

    /* Add close button for mobile */
    .right-panel::before {
        content: '×';
        position: absolute;
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 28px;
        color: var(--text-primary);
        cursor: pointer;
        transition: all 0.3s ease;
        z-index: 201;
    }

    .right-panel::before:hover {
        background: var(--surface-light);
        border-color: var(--primary-color);
    }

    .empty-state {
        display: none !important;
    }

    .app-header {
        padding: 18px 24px;
        flex-wrap: wrap;
    }

    .logo h1 {
        font-size: 1.4rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .header-upgrade-section {
        gap: 10px;
    }

    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .result-container {
        padding: 20px;
    }
}

/* Mobile Landscape / Large Phone (480px - 600px) */
@media (max-width: 600px) {
    .app-header {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .logo {
        gap: 10px;
    }

    .logo svg {
        width: 22px;
        height: 22px;
    }

    .logo h1 {
        font-size: 1.2rem;
    }

    .subtitle {
        font-size: 0.75rem;
        margin-left: 32px;
    }

    .header-upgrade-section {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
    }

    .left-panel {
        padding: 16px;
        max-height: none;
    }

    .right-panel {
        padding: 70px 16px 16px 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
        margin-bottom: 14px;
    }

    .form-group {
        margin-bottom: 14px;
    }

    label {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }

    input[type="text"],
    textarea,
    select {
        padding: 10px 12px;
        font-size: 0.875rem;
    }

    textarea {
        min-height: 70px;
    }

    .btn-generate {
        padding: 12px 24px;
        font-size: 0.95rem;
        gap: 8px;
    }

    .btn-generate svg {
        width: 16px;
        height: 16px;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 16px;
    }

    .result-header h2 {
        font-size: 1.2rem;
    }

    .result-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .email-output {
        padding: 18px;
        font-size: 0.875rem;
        line-height: 1.7;
    }

    .empty-state {
        padding: 30px 20px;
    }

    .empty-state svg {
        width: 56px;
        height: 56px;
        margin-bottom: 20px;
    }

    .empty-state h3 {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }

    .empty-state p {
        font-size: 0.9rem;
    }

    .error-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
        padding: 16px 18px;
    }

    .error-content p {
        font-size: 0.85rem;
    }
}

/* Small Mobile (320px - 480px) */
@media (max-width: 480px) {
    body::before {
        animation: none;
        /* Reduce animation on small devices for performance */
    }

    .app-header {
        padding: 14px 16px;
    }

    .logo h1 {
        font-size: 1.15rem;
    }

    .subtitle {
        display: none;
        /* Hide subtitle on very small screens */
    }

    .left-panel {
        padding: 14px;
        max-height: none;
    }

    .right-panel {
        padding: 70px 14px 14px 14px;
    }

    label {
        font-size: 0.8rem;
    }

    input[type="text"],
    textarea,
    select {
        padding: 9px 11px;
        font-size: 0.85rem;
        border-radius: 6px;
    }

    .btn-generate {
        padding: 11px 20px;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    .result-container,
    .empty-state {
        border-radius: 12px;
    }

    .result-header h2 {
        font-size: 1.1rem;
    }

    .btn-icon {
        padding: 8px;
    }

    .btn-icon svg {
        width: 16px;
        height: 16px;
    }

    .email-output {
        padding: 16px;
        font-size: 0.85rem;
        border-radius: 10px;
    }

    .spinner {
        width: 48px;
        height: 48px;
        margin-bottom: 16px;
    }

    .loading-spinner p {
        font-size: 0.9rem;
    }
}

/* Extra Small Mobile (< 360px) */
@media (max-width: 360px) {
    .logo h1 {
        font-size: 1.05rem;
    }

    .app-header {
        padding: 12px 14px;
    }

    .left-panel,
    .right-panel {
        padding: 12px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    input[type="text"],
    textarea,
    select {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .btn-generate {
        padding: 10px 18px;
        font-size: 0.85rem;
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .app-header {
        padding: 12px 24px;
    }

    .subtitle {
        display: none;
    }

    .left-panel {
        max-height: 100vh;
    }

    .right-panel {
        display: none;
        /* Hide result panel in landscape on small screens */
    }

    /* Show results in a modal-like overlay when generated */
    .result-container {
        position: fixed;
        top: 10px;
        left: 10px;
        right: 10px;
        bottom: 10px;
        z-index: 100;
        max-height: calc(100vh - 20px);
    }
}

/* High DPI / Retina Display optimizations */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    input[type="text"],
    textarea,
    select {
        border-width: 0.5px;
    }

    .result-container,
    .empty-state {
        border-width: 0.5px;
    }
}

/* ============================================
   GDPR COMPLIANCE STYLES
   ============================================ */

/* Footer */
.app-footer {
    background: var(--surface-solid);
    border-top: 1px solid var(--border);
    padding: 40px 24px 20px;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    color: var(--primary-light);
    font-size: 1rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.footer-section p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Cookie Consent Banner */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface-solid);
    border-top: 2px solid var(--primary-color);
    box-shadow: 0 -4px 20px var(--shadow);
    z-index: 10000;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.cookie-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.cookie-text {
    flex: 1;
}

.cookie-text h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.cookie-text p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.cookie-text a {
    color: var(--primary-light);
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.btn-accept,
.btn-decline,
.btn-customize {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.btn-decline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-decline:hover {
    background: var(--surface-light);
}

.btn-customize {
    background: var(--surface-light);
    color: var(--text-primary);
}

.btn-customize:hover {
    background: var(--surface-lighter);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--surface-solid);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--surface-light);
}

.modal-body {
    padding: 16px 20px;
    max-height: calc(90vh - 120px);
    overflow: visible;
}

.modal-body p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.modal-body a {
    color: var(--primary-light);
    text-decoration: underline;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.btn-secondary {
    background: var(--surface-light);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--surface-lighter);
}

/* Cookie Categories */
.cookie-category {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cookie-category h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.cookie-category p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--surface-lighter);
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
    background-color: var(--primary-color);
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(24px);
}

.toggle-switch input:disabled+.toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Adjustments for GDPR Elements */
@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }

    .cookie-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn-accept,
    .btn-decline,
    .btn-customize {
        width: 100%;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .modal-content {
        max-height: 90vh;
    }
}

@media (max-width: 480px) {
    .cookie-consent {
        padding: 16px;
    }

    .cookie-text h3 {
        font-size: 1rem;
    }

    .cookie-text p {
        font-size: 0.85rem;
    }

    .modal-header h2 {
        font-size: 1.25rem;
    }

    .app-footer {
        padding: 30px 16px 16px;
    }
}

/* ============================================
   NEW UX FEATURES
   ============================================ */


@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}


/* Quick Templates - Fixed at top */
.quick-templates {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0;
    padding: 20px 20px 24px 20px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    min-height: 90px;
}

.templates-horizontal {
    display: flex;
    gap: 8px;
    flex: 1;
}

.template-btn {
    position: relative;
    background: var(--surface-light);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    width: 56px;
    height: 56px;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.template-btn:hover {
    background: var(--surface-lighter);
    border-color: var(--primary-color);
    transform: translateY(-2px) scale(1.05);
}

.template-btn .template-pro-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    pointer-events: none;
    font-size: 0.6rem;
    padding: 2px 7px;
    z-index: 2;
}

.template-btn.template-locked {
    opacity: 0.45;
    border-style: dashed;
    cursor: not-allowed;
}

.template-btn.template-locked:hover {
    transform: none;
    border-color: var(--border-light);
    background: var(--surface-light);
}

.templates-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    font-weight: 500;
}

/* Removed sidebar upgrade section - now in header */

/* Free Badge in Payment Overlay */
.free-badge {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.free-badge-icon {
    font-size: 1.3rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10002;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: all;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.toast-exit {
    animation: slideOutRight 0.3s ease-out forwards;
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.toast-success .toast-icon {
    background: var(--success);
    color: white;
}

.toast-error .toast-icon {
    background: var(--error);
    color: white;
}

.toast-info .toast-icon {
    background: var(--primary-color);
    color: white;
}

.toast-message {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.4;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.toast-close:hover {
    color: var(--text-primary);
}

/* FAQ Section */
.faq-section {
    background: var(--surface);
    padding: 60px 24px;
}

.faq-container {
    max-width: 900px;
    margin: 0 auto;
}

.faq-container h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
    color: var(--text-primary);
}

.faq-grid {
    display: grid;
    gap: 16px;
}

.faq-item {
    background: var(--surface-solid);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.faq-item.active {
    border-color: var(--primary-color);
}

.faq-question {
    width: 100%;
    background: transparent;
    border: none;
    padding: 20px 24px;
    text-align: left;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: background 0.2s;
}

.faq-question:hover {
    background: rgba(99, 102, 241, 0.05);
}

.faq-icon {
    flex-shrink: 0;
    color: var(--primary-light);
    transition: transform 0.3s;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 0 24px 20px;
}

.faq-answer p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.faq-answer a {
    color: var(--primary-light);
    text-decoration: underline;
}

/* Default: Desktop - no wrappers needed */
.form-content-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 20px 12px 20px;
    min-height: 0;
}

.form-content-scroll::-webkit-scrollbar {
    width: 6px;
}

.form-content-scroll::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
}

.form-content-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.form-content-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.sticky-button-container {
    flex-shrink: 0;
    padding: 16px 20px 24px 20px;
    background: linear-gradient(to top, var(--surface) 80%, transparent);
    border-top: 1px solid var(--border);
    margin-bottom: 16px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {

    /* Mobile layout adjustments */
    .app-main {
        grid-template-columns: 1fr;
    }

    .form-content-scroll {
        padding: 16px;
    }

    .sticky-button-container {
        padding: 16px;
    }

    .sticky-button-container .btn-generate {
        width: 100%;
        margin: 0;
    }

    .quick-templates {
        display: none;
    }


    .btn-generate .btn-limit {
        font-size: 0.7rem;
        padding: 1px 6px;
        min-width: 28px;
    }

    .templates-hint {
        display: none;
    }

    .template-btn {
        width: 42px;
        height: 42px;
        font-size: 1.3rem;
    }

    .faq-container h2 {
        font-size: 1.6rem;
    }

    .faq-question {
        font-size: 0.95rem;
        padding: 16px 20px;
    }

    .toast {
        min-width: auto;
        max-width: calc(100vw - 40px);
    }

    .toast-container {
        left: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {

    /* Enhanced fixed button for smaller screens */
    .sticky-button-container {
        padding: 16px;
        padding-top: 24px;
    }

    .form-content-scroll {
        padding: 16px;
        padding-bottom: 8px;
    }


    .btn-generate .btn-limit {
        font-size: 0.65rem;
        padding: 1px 5px;
        min-width: 26px;
    }

    .template-btn {
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }

    .quick-templates {
        padding: 6px 10px;
        margin-bottom: 12px;
    }

    .faq-section {
        padding: 40px 16px;
    }
}

/* ============================================
   FREEMIUM SUBSCRIPTION FEATURES
   ============================================ */

/* Limit Indicator - Floating */
.limit-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(236, 72, 153, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(236, 72, 153, 0.4);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.limit-icon {
    font-size: 0.9rem;
}

#limitText {
    font-weight: 600;
}

.limit-indicator.warning {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.4);
    animation: shake 0.5s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.limit-indicator.critical {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    animation: shake 0.5s;
}

/* Upgrade Modal - Complete Redesign */
.upgrade-modal-content {
    max-width: 900px !important;
    width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    margin: 20px auto;
}

/* Limit Reached Message */
.limit-reached-message {
    text-align: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.1), rgba(99, 102, 241, 0.1));
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid rgba(236, 72, 153, 0.2);
}

.limit-icon {
    font-size: 1.5rem;
    margin-right: 8px;
    display: inline-block;
}

.limit-reached-message h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 600;
}

.urgency-text {
    color: #fbbf24;
    font-size: 1rem;
    margin: 8px 0;
    font-weight: 600;
}

.social-proof {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 8px 0;
}

/* Billing Toggle */
.billing-toggle {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    padding: 8px 16px;
    border-radius: 25px;
    border: 1px solid var(--border-light);
}

.toggle-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s;
}

.toggle-label.active {
    color: var(--primary-color);
}

.savings-badge {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
    font-weight: 600;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--surface-lighter);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* Pricing Cards */
.pricing-cards {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 20px;
    margin: 20px 0;
}

.pricing-card {
    background: var(--surface);
    border: 2px solid var(--border-light);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    transition: all 0.3s ease;
}

.free-card {
    opacity: 0.8;
}

.pro-card.featured {
    border-color: var(--primary-color);
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.4);
    transform: scale(1.02);
    background: linear-gradient(135deg, var(--surface), rgba(99, 102, 241, 0.05));
}

.plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-lighter);
    padding: 4px 16px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.pro-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.pricing-card h3 {
    font-size: 1.6rem;
    text-align: center;
    margin: 20px 0 16px;
    color: var(--text-primary);
    font-weight: 600;
}

.price-display {
    text-align: center;
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 12px;
    line-height: 1.2;
}

.price-display span {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-muted);
}

.price-monthly,
.price-yearly {
    display: block;
}

.old-price {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 1.4rem;
    margin-right: 10px;
    opacity: 0.7;
    display: block;
    margin-bottom: 5px;
}

.price-breakdown {
    text-align: center;
    color: var(--success);
    font-size: 1rem;
    margin: 8px 0 20px;
    font-weight: 600;
}

.annual-option {
    text-align: center;
    font-size: 0.85rem;
    color: var(--success);
    margin-bottom: 20px;
    font-weight: 600;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

.features-list li {
    padding: 4px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

.features-list li:last-child {
    border-bottom: none;
}

.features-list li strong {
    color: var(--primary-light);
}

.btn-upgrade {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
    margin: 20px 0 12px;
    position: relative;
    overflow: hidden;
}

.btn-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.5);
}

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

.btn-current {
    width: 100%;
    padding: 16px 24px;
    background: var(--surface-lighter);
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: not-allowed;
    margin: 20px 0 12px;
}

.money-back {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Additional Benefits */
.additional-benefits {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 24px;
    padding: 20px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.benefit-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.benefit-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .upgrade-modal-content {
        max-width: 95vw !important;
        max-height: 95vh !important;
        margin: 10px;
        width: 95vw;
    }

    .modal-body {
        padding: 16px;
        overflow-y: auto;
        max-height: calc(95vh - 100px);
    }

    /* Billing Toggle */
    .toggle-container {
        padding: 6px 12px;
        gap: 8px;
    }

    .toggle-label {
        font-size: 0.8rem;
    }

    /* Pricing Cards */
    .pricing-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .pro-card.featured {
        transform: none;
        order: -1;
        /* Show PRO first */
    }

    .free-card {
        order: 1;
    }

    .pricing-card {
        padding: 16px;
    }

    .price-display {
        font-size: 2.2rem;
    }

    .old-price {
        font-size: 1.2rem;
    }

    .limit-reached-message h3 {
        font-size: 1.3rem;
    }

    .limit-reached-message {
        padding: 12px 16px;
    }

    .urgency-text {
        font-size: 0.9rem;
    }

    .social-proof {
        font-size: 0.8rem;
    }

    /* Additional Benefits */
    .additional-benefits {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
    }

    .benefit-item {
        justify-content: center;
    }

    .btn-upgrade {
        padding: 14px 20px;
        font-size: 1rem;
    }

    .features-list li {
        padding: 6px 0;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .upgrade-modal-content {
        max-width: 98vw !important;
        margin: 5px;
        border-radius: 12px;
    }

    .modal-body {
        padding: 12px;
        max-height: calc(95vh - 80px);
    }

    .limit-reached-message h3 {
        font-size: 1.1rem;
    }

    .limit-reached-message {
        padding: 10px 12px;
        margin-bottom: 16px;
    }

    .pricing-card {
        padding: 12px;
    }

    .plan-badge {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .pricing-card h3 {
        font-size: 1.3rem;
        margin: 12px 0 8px;
    }

    .price-display {
        font-size: 1.8rem;
        margin: 8px 0;
    }

    .price-display span {
        font-size: 0.9rem;
    }

    .features-list {
        font-size: 0.8rem;
        margin: 12px 0;
    }

    .features-list li {
        padding: 4px 0;
        line-height: 1.4;
    }

    .btn-upgrade {
        padding: 12px 16px;
        font-size: 0.9rem;
    }

    .additional-benefits {
        padding: 12px;
        gap: 8px;
    }

    .benefit-text {
        font-size: 0.8rem;
    }

    /* Adjust header upgrade section for mobile */
    .header-upgrade-section {
        gap: 8px;
    }

    .limit-indicator {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .btn-upgrade-header {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .upgrade-price {
        display: none;
    }
}

/* Conversion Optimization Styles */
.urgency-text {
    text-align: center;
    color: #fbbf24;
    font-size: 0.95rem;
    margin: 8px 0;
    font-weight: 600;
}

.social-proof {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 8px 0;
}

.old-price {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-right: 10px;
    opacity: 0.7;
}

.price-breakdown {
    text-align: center;
    color: var(--success);
    font-size: 0.9rem;
    margin: 5px 0 15px;
    font-weight: 600;
}

/* Upgrade Banner Animations */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.upgrade-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.upgrade-banner-icon {
    font-size: 1.5rem;
}

.upgrade-banner-text {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

.upgrade-banner-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.upgrade-banner-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.upgrade-banner-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 8px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.upgrade-banner-close:hover {
    opacity: 1;
}

/* Export Modal Styles */
.export-options {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.btn-export {
    flex: 1;
    padding: 20px;
    background: rgba(99, 102, 241, 0.1);
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

.btn-export:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.btn-export svg {
    width: 48px;
    height: 48px;
    stroke: var(--primary-color);
}

.btn-export span {
    font-size: 1rem;
    font-weight: 600;
}

/* Pro feature indicators */
.pro-feature {
    color: inherit !important;
    font-weight: inherit;
}

.pro-feature::before {
    content: none;
}

/* Pro-only elements */
.pro-only {
    display: none;
}

.pro-only.active {
    display: block;
}

/* ============================================
   ENHANCED REFERRAL SYSTEM STYLES
   ============================================ */

/* Referral Header Button */
.btn-referral-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-right: 10px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-referral-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-referral-header::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: left 0.5s;
}

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

/* Enhanced Referral Modal */
.referral-modal-content {
    max-width: 500px;
    background: var(--surface-solid);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 1000;
}

.referral-modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-primary);
    padding: 2rem;
    text-align: center;
    position: relative;
    border-bottom: 1px solid var(--border);
}

.referral-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.referral-modal-header h2 {
    margin: 0;
    font-size: 1.8rem;
    position: relative;
    z-index: 1;
}

.referral-modal-header .modal-close {
    background: none !important;
    border: none !important;
    color: white !important;
    font-size: 24px !important;
    cursor: pointer !important;
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 10 !important;
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: all 0.3s ease !important;
}

.referral-modal-header .modal-close:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.1) !important;
}

.referral-stats-card {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-light) 100%);
    border-radius: 15px;
    padding: 1.5rem;
    margin: 1rem 0;
    border: 2px solid var(--border);
    position: relative;
    overflow: hidden;
    color: var(--text-primary);
}

.referral-stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10b981, #059669, #10b981);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.referral-link-container {
    display: flex;
    gap: 10px;
    margin: 1rem 0;
    background: var(--surface);
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid var(--border);
}

.referral-link-container input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--surface-solid);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.referral-link-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--glow);
}

.btn-copy {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-copy:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

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

/* Social Share Buttons - Marketing Tools */
.social-share-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.social-share-buttons .share-btn {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    color: white;
}

.social-share-buttons .share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.social-share-buttons .share-twitter {
    background: #1DA1F2;
}

.social-share-buttons .share-facebook {
    background: #1877F2;
}

.social-share-buttons .share-linkedin {
    background: #0077B5;
}

.social-share-buttons .share-reddit {
    background: #FF4500;
}

.social-share-buttons .share-email {
    background: #6366f1;
}

.social-share-buttons .share-copy {
    background: #6b7280;
}

.social-share {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 1.5rem 0;
}

.btn-share {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--surface-solid);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow);
}

.btn-share.twitter {
    border-color: #1da1f2;
    color: #1da1f2;
}

.btn-share.twitter:hover {
    background: #1da1f2;
    color: white;
}

.btn-share.linkedin {
    border-color: #0077b5;
    color: #0077b5;
}

.btn-share.linkedin:hover {
    background: #0077b5;
    color: white;
}

.btn-share.facebook {
    border-color: #4267b2;
    color: #4267b2;
}

.btn-share.facebook:hover {
    background: #4267b2;
    color: white;
}

.referral-benefits {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-light) 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    border-left: 4px solid var(--primary-color);
    color: var(--text-primary);
}

.referral-benefits h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.referral-benefits ul {
    margin: 0;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.referral-benefits li {
    margin: 0.5rem 0;
    font-weight: 500;
}

.referral-code-display {
    background: linear-gradient(135deg, var(--surface-solid) 0%, var(--surface-light) 100%);
    color: var(--text-primary);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    margin: 1rem 0;
    position: relative;
    overflow: hidden;
    border: 2px solid var(--border);
}

.referral-code-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
    opacity: 0.3;
}

.referral-code-display .code {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 2px;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: inline-block;
    margin: 0.5rem 0;
    position: relative;
    z-index: 1;
}

.referral-code-display .label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

/* Modal Scroll Styling */
.referral-modal-content::-webkit-scrollbar {
    width: 8px;
}

.referral-modal-content::-webkit-scrollbar-track {
    background: var(--surface);
    border-radius: 4px;
}

.referral-modal-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.referral-modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Mobile Responsive for Referral */
@media (max-width: 768px) {
    .referral-modal-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
        max-height: calc(100vh - 2rem);
    }

    .social-share {
        grid-template-columns: 1fr;
    }

    .referral-link-container {
        flex-direction: column;
    }

    .btn-copy {
        width: 100%;
    }

    .btn-referral-header {
        font-size: 0.85rem;
        padding: 10px 16px;
    }

    .auth-section {
        margin-left: 0.5rem;
        gap: 0.5rem;
    }

    .auth-btn.unified-auth-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .user-email {
        display: none;
    }

    .dashboard-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .logout-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Authentication UI Styles */
.auth-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 1rem;
    order: 3;
    /* Place after upgrade section */
}

/* Beautiful Unified Auth Button */
.auth-btn.unified-auth-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    text-decoration: none;
    outline: none;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.auth-btn.unified-auth-btn:hover {
    background: linear-gradient(135deg, #5b5fcf, #10b981);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

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

.auth-btn.unified-auth-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Button Icons */
.auth-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.auth-btn:hover svg {
    transform: scale(1.1);
}

/* Button Text */
.auth-btn span {
    font-weight: 600;
    letter-spacing: 0.025em;
}

/* Shimmer Effect for Unified Auth Button */
.auth-btn.unified-auth-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: left 0.6s ease;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .auth-btn.unified-auth-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .auth-btn.unified-auth-btn svg {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 480px) {
    .auth-btn.unified-auth-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
}

/* Auth Required Modal Styles */
.auth-required-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.auth-required-content {
    background: var(--surface-solid);
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    text-align: center;
}

.auth-required-header {
    margin-bottom: 2rem;
}

.auth-required-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3);
}

.auth-required-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.auth-required-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.auth-required-benefits {
    background: rgba(99, 102, 241, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.auth-required-benefits h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.auth-required-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.auth-required-benefits li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-required-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.auth-required-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    outline: none;
    min-width: 140px;
    justify-content: center;
}

.auth-required-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.auth-required-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.auth-required-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.auth-required-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.auth-required-btn svg {
    width: 20px;
    height: 20px;
}

/* Mobile Responsive for Auth Required Modal */
@media (max-width: 768px) {
    .auth-required-content {
        padding: 1.5rem;
        margin: 1rem;
    }

    .auth-required-icon {
        width: 60px;
        height: 60px;
    }

    .auth-required-header h2 {
        font-size: 1.25rem;
    }

    .auth-required-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .auth-required-btn {
        width: 100%;
    }
}

/* Beautiful User Profile Styles */
.user-profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Admin Button Styles */
.admin-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: 1px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.admin-btn:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
    color: white;
    text-decoration: none;
}

.admin-btn svg {
    width: 16px;
    height: 16px;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    outline: none;
}

.profile-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.profile-trigger:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* User Avatar */
.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.user-avatar svg {
    width: 16px;
    height: 16px;
}

/* User Info Container */
.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    min-width: 0;
}

.user-email {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.user-status {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--secondary-color);
    background: rgba(16, 185, 129, 0.2);
    padding: 0.125rem 0.5rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Dropdown Arrow */
.dropdown-arrow {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.profile-trigger:hover .dropdown-arrow {
    transform: translateY(1px);
}

/* Profile Menu Styles */
.profile-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.profile-menu.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

.profile-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
}

.profile-menu-item svg {
    width: 16px;
    height: 16px;
}

.profile-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
}

/* Mobile Responsive for Profile */
@media (max-width: 768px) {
    .profile-trigger {
        padding: 0.375rem 0.75rem;
        gap: 0.5rem;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
    }

    .user-avatar svg {
        width: 14px;
        height: 14px;
    }

    .user-email {
        font-size: 0.85rem;
        max-width: 120px;
    }

    .user-status {
        font-size: 0.7rem;
        padding: 0.1rem 0.375rem;
    }

    .profile-menu {
        min-width: 180px;
        right: -0.5rem;
    }
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-email {
    color: #64748b;
    font-size: 0.9rem;
}

.dashboard-link {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid #6366f1;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.dashboard-link:hover {
    background: #6366f1;
    color: white;
}

.logout-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.logout-btn:hover {
    background: #dc2626;
}

.auth-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.login-btn {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.login-btn:hover {
    background: #e2e8f0;
}

.signup-btn {
    background: #6366f1;
    color: white;
}

.signup-btn:hover {
    background: #4f46e5;
}

/* Make auth section more visible */
.auth-section {
    border-left: 1px solid var(--border);
    padding-left: 1rem;
}

/* Unified Authentication Modal */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.auth-modal-content {
    background: var(--surface);
    border-radius: 16px;
    padding: 0;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    overflow: hidden;
}

.auth-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem 1rem 2rem;
    border-bottom: 1px solid var(--border-light);
}

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

.auth-tab {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.auth-tab.active {
    background: var(--primary-color);
    color: white;
}

.auth-tab:hover:not(.active) {
    background: var(--surface-solid);
    color: var(--text-primary);
}

.auth-modal-body {
    padding: 2rem;
}

.auth-form {
    margin-bottom: 1.5rem;
}


.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-form .form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-solid);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.auth-form .form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.auth-submit-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.auth-submit-btn.login-btn {
    background: var(--primary-color);
    color: white;
}

.auth-submit-btn.login-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.auth-submit-btn.signup-btn {
    background: #10b981;
    color: white;
}

.auth-submit-btn.signup-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

.auth-benefits {
    background: var(--surface-solid);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.auth-benefits h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.auth-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.auth-benefits li {
    padding: 0.25rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-benefits li:before {
    content: "✓ ";
    color: #10b981;
    font-weight: bold;
}

.forgot-password-link {
    text-align: center;
    margin-top: 1rem;
}

.forgot-password-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.forgot-password-link a:hover {
    text-decoration: underline;
}

/* Google Sign-In Button */
.google-auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    text-align: center;
}

.google-auth-divider::before,
.google-auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.divider-text {
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.google-signin-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: white;
    color: #5f6368;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-top: 1rem;
}

.google-signin-btn:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border-color: #c1c5c9;
    transform: translateY(-1px);
}

.google-signin-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.google-signin-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.back-to-login {
    text-align: center;
    margin-top: 1rem;
}

.back-to-login a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
}

.back-to-login a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Modal Styles */
.signup-form-modal,
.login-form-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.signup-form-content,
.login-form-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.signup-form-header,
.login-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.signup-form-header h3,
.login-form-header h3 {
    margin: 0;
    color: #1e293b;
}

.close-prompt {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #6366f1;
}

.signup-submit-btn,
.login-submit-btn {
    width: 100%;
    background: #6366f1;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.signup-submit-btn:hover,
.login-submit-btn:hover {
    background: #4f46e5;
}

.signup-note,
.login-link,
.signup-link {
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.login-link a,
.signup-link a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
}

.login-link a:hover,
.signup-link a:hover {
    text-decoration: underline;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.strength-fill {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-text {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

/* Password Match Indicator */
.password-match {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Form Help Text */
.form-help {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
    display: block;
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
    margin-bottom: 0.5rem;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.5rem;
    width: 1rem;
    height: 1rem;
    accent-color: #6366f1;
}

.checkmark {
    margin-left: 0.25rem;
}

/* Enhanced Form Groups */
.form-group {
    margin-bottom: 1rem;
    position: relative;
}

.form-group input[type="password"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="tel"]:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

/* Verification Modal Styles */
.verification-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.verification-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.verification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.verification-header h3 {
    margin: 0;
    color: #1f2937;
}

.verification-body p {
    margin-bottom: 1.5rem;
    color: #6b7280;
    line-height: 1.6;
}

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

.verify-btn,
.resend-btn,
.close-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.verify-btn {
    background: #6366f1;
    color: white;
}

.resend-btn {
    background: #f1f5f9;
    color: #64748b;
}

.close-btn {
    background: #ef4444;
    color: white;
}

.verification-actions button:hover {
    transform: translateY(-2px);
}

/* Profile Dropdown Styles */
.user-profile {
    position: relative;
    z-index: 99999 !important;
    isolation: isolate;
}

.profile-dropdown {
    position: relative;
    display: inline-block;
    z-index: 99999 !important;
    isolation: isolate;
}

/* Ensure profile dropdown appears above empty state and all other content */
#emptyState {
    z-index: 1 !important;
}


.profile-trigger {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.profile-trigger:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.user-email {
    font-weight: 500;
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.profile-trigger.active .dropdown-arrow {
    transform: rotate(180deg);
}

.profile-menu {
    position: fixed !important;
    top: 0;
    right: 0;
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 0 20px rgba(99, 102, 241, 0.2);
    min-width: 200px;
    z-index: 99999 !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    isolation: isolate;
}

.profile-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
}

.profile-item:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.profile-item:first-child {
    border-radius: 12px 12px 0 0;
}

.profile-item:hover {
    background: var(--surface-light);
    color: var(--primary-color);
    transform: translateX(4px);
}

.profile-icon {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.3));
    transition: all 0.3s ease;
}

.profile-item:hover .profile-icon {
    filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.5));
    transform: scale(1.1);
}

/* Responsive profile dropdown */
@media (max-width: 768px) {
    .profile-menu {
        right: -1rem;
        min-width: 160px;
    }

    .profile-trigger {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* ============================================
   NEW HEADER DESIGN STYLES
   ============================================ */

/* Primary Auth Button (for unauthenticated users) */
.auth-btn.primary-auth-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    text-decoration: none;
    outline: none;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.auth-btn.primary-auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

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

/* User Profile Dropdown */
.user-profile {
    position: relative;
}

.profile-dropdown {
    position: relative;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.profile-trigger:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.user-email {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.user-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-status.pro {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
}

.user-status.free {
    background: rgba(107, 114, 128, 0.2);
    color: var(--text-muted);
}

.user-status.admin {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.user-status-container {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.dropdown-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.profile-trigger:hover .dropdown-arrow {
    transform: translateY(1px);
}

/* Profile Menu */
.profile-menu {
    position: fixed;
    top: 80px;
    right: 20px;
    background: var(--surface-solid);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    padding: 8px;
    min-width: 250px;
    max-width: 300px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.profile-menu.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.profile-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    border: 1px solid transparent;
}

.profile-item:hover {
    background: var(--surface-hover);
    color: var(--primary-color);
    transform: translateX(4px);
    border-color: var(--border-light);
}

.profile-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.upgrade-item {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid var(--primary-color);
}

.upgrade-item:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    border-color: var(--primary-light);
}

.upgrade-badge {
    margin-left: auto;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.logout-item {
    color: #ef4444;
}

.logout-item:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* Mobile Responsive for New Header */
@media (max-width: 768px) {
    .profile-trigger {
        padding: 6px 12px;
        gap: 8px;
    }

    .user-email {
        max-width: 100px;
        font-size: 0.8rem;
    }

    .profile-menu {
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }

    .auth-btn.primary-auth-btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
}

/* OTP Verification Styles */
.otp-header {
    text-align: center;
    margin-bottom: 20px;
}

.otp-header h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.otp-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

#otpInput {
    text-align: center;
    font-size: 1.2rem;
    letter-spacing: 0.2em;
    font-weight: bold;
}

.verify-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 10px;
}

.verify-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
}

.resend-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.resend-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

/* OTP Verification Modal Styles */
.otp-verification-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.otp-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.otp-modal-content {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
}

.otp-modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.otp-modal-header h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.otp-modal-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.otp-form .form-group {
    margin-bottom: 1.5rem;
}

.otp-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1.1rem;
    text-align: center;
    letter-spacing: 0.2em;
    font-weight: 600;
}

.otp-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.otp-verify-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

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

.otp-actions {
    display: flex;
    gap: 0.75rem;
    flex-direction: column;
}

.otp-actions .btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.otp-actions .btn-secondary {
    background: var(--surface-solid);
    color: var(--text-primary);
    border-color: var(--border);
}

.otp-actions .btn-secondary:hover {
    background: var(--surface-light);
}

.otp-actions .btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.otp-actions .btn-outline:hover {
    background: var(--surface-solid);
    color: var(--text-primary);
}

/* Password Toggle Styles */
.password-field {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--text-primary);
    background: var(--surface-solid);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.password-field input {
    padding-right: 50px;
}

.password-field .password-strength,
.password-field .password-match {
    margin-top: 8px;
}

/* Remember Me Checkbox Styles */
.remember-me {
    margin: 16px 0;
}

.remember-me-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    user-select: none;
}

.remember-me-label input[type="checkbox"] {
    display: none;
}

.remember-me-label .checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: all 0.2s ease;
    background: transparent;
}

.remember-me-label:hover .checkmark {
    border-color: var(--primary-color);
}

.remember-me-label input[type="checkbox"]:checked+.checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.remember-me-label input[type="checkbox"]:checked+.checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ============================================
   THEME SWITCHING
   ============================================ */

/* Light Theme Variables */
[data-theme="light"] {
    --background: #ffffff;
    --background-gradient: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    --surface: rgba(248, 250, 252, 0.9);
    --surface-solid: #f8fafc;
    --surface-light: #e2e8f0;
    --surface-lighter: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --border: rgba(99, 102, 241, 0.3);
    --border-light: rgba(0, 0, 0, 0.15);
    --shadow: rgba(0, 0, 0, 0.1);
    --glow: rgba(99, 102, 241, 0.3);

    /* Enhanced light theme colors */
    --hover-bg: rgba(99, 102, 241, 0.08);
    --hover-border: rgba(99, 102, 241, 0.4);
    --active-bg: rgba(99, 102, 241, 0.12);
    --focus-ring: rgba(99, 102, 241, 0.2);
    --result-bg: #f8fafc;
    --result-border: #e2e8f0;
    --result-hover: #f1f5f9;
}

/* Light Theme Specific Improvements */
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
    background-color: #ffffff;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
}

[data-theme="light"] input:focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background-color: #ffffff;
}

[data-theme="light"] .form-group label {
    color: var(--text-primary);
    font-weight: 500;
}

[data-theme="light"] .enhanced-select-trigger {
    background: #ffffff;
    border-color: var(--border-light);
    color: var(--text-primary);
}

[data-theme="light"] .enhanced-select-trigger:hover {
    background: #f8fafc;
    border-color: var(--border);
}

[data-theme="light"] .enhanced-select-trigger:focus,
[data-theme="light"] .enhanced-select-trigger:focus-visible {
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .enhanced-select-dropdown {
    background: #ffffff;
    border-color: var(--border-light);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}

[data-theme="light"] .enhanced-select-option:hover {
    background: rgba(99, 102, 241, 0.08);
}

[data-theme="light"] .enhanced-select-option.selected {
    background: rgba(99, 102, 241, 0.12);
}

[data-theme="light"] .settings-section {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-light);
}

[data-theme="light"] .stat-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-light);
}

[data-theme="light"] .btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
}

[data-theme="light"] .btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

[data-theme="light"] .btn-secondary {
    background: var(--surface-light);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

[data-theme="light"] .btn-secondary:hover {
    background: #e2e8f0;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Additional light theme hover improvements */
[data-theme="light"] .profile-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

[data-theme="light"] .nav-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

[data-theme="light"] .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

[data-theme="light"] .settings-section:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] input:hover,
[data-theme="light"] select:hover,
[data-theme="light"] textarea:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
    background-color: #fefefe;
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Enhanced light theme input hover effects */
[data-theme="light"] input[type="text"]:hover,
[data-theme="light"] input[type="email"]:hover,
[data-theme="light"] input[type="password"]:hover,
[data-theme="light"] input[type="tel"]:hover,
[data-theme="light"] input[type="url"]:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
    background-color: #fafbff;
    transform: translateY(-1px);
}

[data-theme="light"] input:focus:hover,
[data-theme="light"] select:focus:hover,
[data-theme="light"] textarea:focus:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background-color: #ffffff;
    transform: translateY(-1px);
}

/* Light theme link hover effects */
[data-theme="light"] a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

[data-theme="light"] .auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .upgrade-badge:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

/* Light theme modal and dropdown hover effects */
[data-theme="light"] .modal-content:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .dropdown-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

/* Light theme table hover effects */
[data-theme="light"] tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

/* Light theme card hover effects */
[data-theme="light"] .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

/* Enhanced light theme component styling */
[data-theme="light"] .result-header {
    background: var(--result-bg);
    color: var(--text-primary);
}

[data-theme="light"] .result-header:hover {
    background: var(--result-hover);
    border-color: var(--hover-border);
}

[data-theme="light"] .email-output {
    background: #ffffff;
    border: 1px solid var(--result-border);
    color: var(--text-primary);
}

[data-theme="light"] .email-output:hover {
    border-color: var(--hover-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Light theme navigation improvements */
[data-theme="light"] .nav-item:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
    border-radius: 8px;
}

[data-theme="light"] .nav-item.active {
    background: var(--active-bg);
    color: var(--primary-color);
    border-radius: 8px;
}

/* Light theme form improvements */
[data-theme="light"] .form-group:hover label {
    color: var(--primary-color);
    transition: color 0.2s ease;
}

[data-theme="light"] .form-group:focus-within label {
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.2s ease;
}

/* Enhanced form group hover effects */
[data-theme="light"] .form-group:hover {
    transform: translateY(-1px);
    transition: transform 0.2s ease;
}

[data-theme="light"] .form-group:focus-within {
    transform: translateY(-1px);
    transition: transform 0.2s ease;
}

/* Light theme button improvements */
[data-theme="light"] .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Light theme modal improvements */
[data-theme="light"] .modal-content {
    background: #ffffff;
    border: 1px solid var(--border-light);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .modal-header {
    background: var(--surface-solid);
    border-bottom: 1px solid var(--border-light);
}

/* Light theme dropdown improvements */
[data-theme="light"] .dropdown-menu {
    background: #ffffff;
    border: 1px solid var(--border-light);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .dropdown-item:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
}

/* Light theme status improvements */
[data-theme="light"] .status-badge {
    background: var(--surface-light);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

[data-theme="light"] .status-badge.pro {
    background: var(--primary-color);
    color: white;
}

[data-theme="light"] .status-badge.admin {
    background: #8b5cf6;
    color: white;
}

/* Light theme progress improvements */
[data-theme="light"] .progress-bar {
    background: var(--primary-color);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

[data-theme="light"] .progress {
    background: var(--surface-light);
    border: 1px solid var(--border-light);
}

/* Light theme notification improvements */
[data-theme="light"] .toast {
    background: #ffffff;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .toast.success {
    border-left: 4px solid #10b981;
}

[data-theme="light"] .toast.error {
    border-left: 4px solid #ef4444;
}

[data-theme="light"] .toast.info {
    border-left: 4px solid #06b6d4;
}

/* Dark Theme Variables (default) */
[data-theme="dark"] {
    --background: #0a0f1e;
    --background-gradient: linear-gradient(135deg, #0a0f1e 0%, #1a1f3a 100%);
    --surface: rgba(30, 41, 59, 0.6);
    --surface-solid: #1e293b;
    --surface-light: #334155;
    --surface-lighter: #475569;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: rgba(99, 102, 241, 0.2);
    --border-light: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.3);
    --glow: rgba(99, 102, 241, 0.4);
}

/* Auto Theme - follows system preference */
@media (prefers-color-scheme: light) {
    [data-theme="auto"] {
        --background: #ffffff;
        --background-gradient: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
        --surface: rgba(248, 250, 252, 0.9);
        --surface-solid: #f8fafc;
        --surface-light: #e2e8f0;
        --surface-lighter: #cbd5e1;
        --text-primary: #0f172a;
        --text-secondary: #334155;
        --text-muted: #64748b;
        --border: rgba(99, 102, 241, 0.3);
        --border-light: rgba(0, 0, 0, 0.15);
        --shadow: rgba(0, 0, 0, 0.1);
        --glow: rgba(99, 102, 241, 0.3);
    }
}

@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --background: #0a0f1e;
        --background-gradient: linear-gradient(135deg, #0a0f1e 0%, #1a1f3a 100%);
        --surface: rgba(30, 41, 59, 0.6);
        --surface-solid: #1e293b;
        --surface-light: #334155;
        --surface-lighter: #475569;
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-muted: #94a3b8;
        --border: rgba(99, 102, 241, 0.2);
        --border-light: rgba(255, 255, 255, 0.1);
        --shadow: rgba(0, 0, 0, 0.3);
        --glow: rgba(99, 102, 241, 0.4);
    }
}

.remember-me-label input[type="checkbox"]:focus+.checkmark {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* ============================================
   EMAIL HISTORY SIDEBAR
   ============================================ */

.history-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.history-sidebar.open {
    right: 0;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.history-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.history-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.history-loading,
.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.history-empty svg {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.history-empty p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-item:hover {
    background: var(--surface-light);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.history-item.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
}

.history-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}

.history-item-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.history-item-meta {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.history-item-type,
.history-item-tone {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.history-item-type svg,
.history-item-tone svg {
    width: 14px;
    height: 14px;
}

.history-item-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.history-item-preview {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-top: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.history-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .history-sidebar {
        width: 100%;
        right: -100%;
    }

    .history-header {
        padding: 16px 20px;
    }

    .history-content {
        padding: 12px;
    }

    .history-item {
        padding: 12px;
    }
}