:root {
    --bg-color: #050505;
    --glass-bg: rgba(20, 20, 20, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --primary-accent: #c9a55a;
    --spectrum-grad: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    --neon-glow: 0 0 10px rgba(201, 165, 90, 0.3);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --- Animated Spectral Background --- */
.ambient-light {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: #030303;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.orb-1 { width: 400px; height: 400px; background: #4b0082; top: -10%; left: -10%; animation-delay: 0s; }
.orb-2 { width: 300px; height: 300px; background: #0000ff; bottom: 20%; right: -5%; animation-delay: -5s; }
.orb-3 { width: 350px; height: 350px; background: #c9a55a; top: 40%; left: 30%; opacity: 0.15; animation-delay: -10s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -50px); }
}

/* --- Glass Container --- */
.container {
    max-width: 1000px;
    margin: 60px auto;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 48px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    position: relative;
    z-index: 1;
    transition: transform 0.1s;
    overflow: hidden;
}

/* The spectral border effect on hover/mouse move */
.container::before {
    content: '';
    position: absolute;
    inset: -1px;
    z-index: -1;
    background: var(--spectrum-grad);
    opacity: 0;
    transition: opacity 0.3s ease;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    border-radius: 16px;
}

.container:hover::before {
    opacity: 0.3;
}

/* --- Typography --- */
h1 {
    color: #fff;
    margin-bottom: 8px;
    text-align: center;
    font-weight: 400;
    font-size: 48px;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-family: 'Cinzel', serif;
    background: linear-gradient(to bottom, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    text-align: center;
    color: #888;
    margin-bottom: 40px;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 2px;
    font-family: 'Space Mono', monospace;
    text-transform: uppercase;
}

/* --- Tabs --- */
.tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 20px;
}

.tab {
    padding: 10px 24px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 30px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.tab:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.tab.active {
    color: #1a1a1a;
    background: var(--primary-accent);
    box-shadow: 0 0 15px rgba(201, 165, 90, 0.4);
    font-weight: 600;
}

.tab-content { display: none; animation: fadeIn 0.5s ease; }
.tab-content.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Upload Area --- */
.upload-area {
    border: 2px dashed rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary-accent);
    background: rgba(201, 165, 90, 0.05);
    transform: scale(1.01);
}

.upload-area h3 {
    color: #ddd;
    font-family: 'Cinzel', serif;
    font-size: 18px;
    margin-bottom: 10px;
}

.upload-area p {
    color: #666;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
}

.file-input { display: none; }

/* --- Forms & Inputs --- */
.form-group { margin-bottom: 25px; }

textarea, input[type="text"], input[type="password"], input[type="email"] {
    width: 100%;
    padding: 16px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff;
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    transition: all 0.3s;
}

textarea:focus, input:focus {
    outline: none;
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 2px rgba(201, 165, 90, 0.1);
    background: rgba(0,0,0,0.5);
}

/* --- Buttons --- */
.btn {
    padding: 14px 32px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--primary-accent);
    border: 1px solid var(--primary-accent);
    border-radius: 4px;
    transition: all 0.3s;
    margin: 8px;
    font-family: 'Space Mono', monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 0%; height: 100%;
    background: var(--primary-accent);
    transition: width 0.3s ease;
    z-index: -1;
}

.btn:hover {
    color: #000;
    box-shadow: var(--neon-glow);
}

.btn:hover::before {
    width: 100%;
}

.btn-secondary {
    border-color: #666;
    color: #888;
}

.btn-secondary::before { background: #666; }
.btn-secondary:hover { color: #fff; box-shadow: none; }

.btn-block {
    width: 100%;
}

/* --- Output & Status --- */
.output {
    margin-top: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    border-left: 3px solid var(--primary-accent);
    color: #d1d5db;
    font-family: 'Space Mono', monospace;
    font-size: 13px;
}

.status {
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 4px;
    display: none;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    text-align: center;
}
.status.success { background: rgba(34, 197, 94, 0.05); color: #6b9b7c; border: 1px solid rgba(34, 197, 94, 0.15); opacity: 0.85; }
.status.error { background: rgba(239, 68, 68, 0.1); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.2); }
.status.info { background: rgba(201, 165, 90, 0.1); color: #d4b06a; border: 1px solid rgba(201, 165, 90, 0.3); }

/* --- Spinner --- */
.loading { display: none; text-align: center; padding: 20px; }
.spinner {
    border: 2px solid rgba(255,255,255,0.1);
    border-top: 2px solid var(--primary-accent);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

@keyframes loadProgress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* --- Preview Images --- */
.preview { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 20px; justify-content: center; }
.preview-item img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    transition: transform 0.3s;
}
.preview-item img:hover { transform: scale(1.02); }

.file-info {
    background: rgba(0, 0, 0, 0.4);
    padding: 12px;
    border-radius: 2px;
    margin-top: 10px;
    font-size: 12px;
    color: #9ca3af;
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-family: 'Georgia', serif;
}

.file-info strong {
    color: #c9a55a;
}

/* --- Modal --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}
.modal.active { display: flex; align-items: center; justify-content: center; }
.modal-content {
    background: #111;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
    position: relative;
}
.close-modal {
    position: absolute; top: 15px; right: 15px;
    background: none; border: none; font-size: 24px; color: #666; cursor: pointer;
}
.close-modal:hover { color: #fff; }

.modal-header {
    margin-bottom: 30px;
    text-align: center;
}

.modal-header h2 {
    color: #e8e6e3;
    margin-bottom: 10px;
    font-family: 'Georgia', serif;
    font-weight: 400;
    letter-spacing: 2px;
    font-size: 24px;
}

.modal-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.modal-tab {
    flex: 1;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 400;
    color: #6b7280;
    transition: all 0.3s;
    font-family: 'Georgia', serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.modal-tab.active {
    background: linear-gradient(135deg, #c9a55a 0%, #b8954a 100%);
    color: #1a1a2e;
    border-color: rgba(201, 165, 90, 0.3);
}

.modal-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    color: #9ca3af;
    border-color: rgba(201, 165, 90, 0.2);
}

.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    margin-bottom: 8px;
    color: #9ca3af;
    font-weight: 400;
    font-size: 13px;
    font-family: 'Georgia', serif;
    letter-spacing: 0.5px;
}

.form-field input {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    font-size: 14px;
    transition: all 0.3s;
    background: rgba(0, 0, 0, 0.4);
    color: #d1d5db;
    font-family: 'Georgia', serif;
}

.form-field input:focus {
    outline: none;
    border-color: #c9a55a;
    box-shadow: 0 0 0 2px rgba(201, 165, 90, 0.1);
    background: rgba(0, 0, 0, 0.5);
}

.form-field input::placeholder {
    color: #6b7280;
}

/* --- Mouse Follow Effect Element --- */
#cursor-light {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 60%);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 0;
    mix-blend-mode: screen;
    transition: opacity 0.3s;
}

/* --- Click Effect --- */
.click-ripple {
    position: absolute;
    border: 2px solid var(--primary-accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: ripple 0.5s ease-out;
    z-index: 9999;
    box-shadow: 0 0 8px var(--primary-accent);
}
@keyframes ripple {
    0% { width: 0; height: 0; opacity: 0.8; }
    100% { width: 40px; height: 40px; opacity: 0; }
}

/* --- Custom Language Selector --- */
#language-selector {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    color: #aaa;
    border-radius: 4px;
    padding: 5px;
    outline: none;
}

/* User dashboard styles */
.user-dashboard {
    display: none;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    padding: 20px 24px;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-dashboard.active {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.user-info {
    flex: 1;
    min-width: 200px;
}

.user-info h3 {
    margin-bottom: 5px;
    color: #fff;
    font-family: 'Cinzel', serif;
    font-weight: 400;
    font-size: 18px;
    letter-spacing: 0.5px;
}

.user-tier-info {
    margin: 5px 0;
    color: #666;
    font-size: 12px;
    font-family: 'Space Mono', monospace;
}

.user-tier-info span {
    display: inline-block;
}

#user-limit-display {
    margin-left: 10px;
}

.tier-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 400;
    margin-left: 10px;
    font-family: 'Georgia', serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.tier-badge.free {
    background: rgba(255, 255, 255, 0.05);
    color: #9ca3af;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tier-badge.premium {
    background: linear-gradient(135deg, #c9a55a 0%, #b8954a 100%);
    color: #1a1a2e;
    border: 1px solid rgba(201, 165, 90, 0.3);
}

.user-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.login-prompt {
    display: none;
    text-align: center;
    padding: 32px;
    background: rgba(201, 165, 90, 0.05);
    border-radius: 2px;
    margin-bottom: 24px;
    border: 1px solid rgba(201, 165, 90, 0.2);
}

.login-prompt.active {
    display: block;
}

.login-prompt p {
    color: #c9a55a;
    margin-bottom: 16px;
    font-size: 14px;
    font-family: 'Georgia', serif;
    letter-spacing: 0.5px;
    font-style: italic;
}

/* --- Google Sign In Button --- */
.btn-google {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #ddd !important;
    transition: all 0.3s ease;
}

.btn-google:hover {
    background: #f8f8f8 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}

.btn-google::before {
    display: none;
}

/* --- Footer --- */
footer {
    background: rgba(0,0,0,0.2);
}

footer a:hover {
    color: var(--primary-accent) !important;
    transition: color 0.3s ease;
}

/* --- Header Logout Button --- */
#header-logout-btn {
    white-space: nowrap;
}

/* --- FAQ Accordion --- */
.faq-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: rgba(201, 165, 90, 0.3);
    background: rgba(255,255,255,0.05);
}

.faq-question {
    padding: 18px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: rgba(201, 165, 90, 0.08);
}

.faq-question h4 {
    color: #fff;
    margin: 0;
    font-family: 'Space Mono', monospace;
    font-size: 15px;
    font-weight: 500;
    flex: 1;
    padding-right: 15px;
}

.faq-icon {
    font-size: 24px;
    color: var(--primary-accent);
    font-weight: 300;
    transition: transform 0.3s ease;
    min-width: 24px;
    text-align: center;
}

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

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 20px;
}

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

.faq-answer p {
    color: #999;
    font-size: 14px;
    line-height: 1.7;
    margin: 0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .container { margin: 20px; padding: 24px; }
    h1 { font-size: 32px; }
    .tabs { flex-wrap: wrap; }

    /* Stack header buttons on mobile */
    #header-logout-btn {
        font-size: 10px;
        padding: 6px 12px;
    }

    /* Fix status/error messages on mobile */
    .status {
        padding: 10px 12px;
        font-size: 12px;
        line-height: 1.5;
        word-wrap: break-word;
        overflow-wrap: break-word;
        text-align: left;
    }

    .status strong {
        display: block;
        margin-top: 8px;
    }

    .status small {
        display: block;
        margin-top: 4px;
    }
}
