:root {
    --ink: #ffffff;
    --paper: #0a0a0a;
    --oracle-purple: #d8b4fe;
    --accent-red: #ef4444;
    --glass: rgba(255, 255, 255, 0.05);
}

/* --- 1. THE DEFAULT STATE (Welcome / Login) --- */
main#app {
    position: relative;
    z-index: 50;
    
    /* Horizontal Centering */
    margin-left: auto;
    margin-right: auto;
    
    /* Vertical Spacing: The 180px 'Clearance' */
    margin-top: 180px !important; 
    margin-bottom: 5vh; 
    
    max-width: 1100px; 
    width: 90%;
    
    /* The Cinematic Slide */
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 2. THE EXPERIMENT STATE (The Shift) --- */
.auth-message {
    color: rgba(255, 255, 255, 0.7); /* Subtle off-white */
    font-size: 0.9rem;
    font-style: italic;
    letter-spacing: 1px;
    margin: 0;
    text-transform: uppercase;
}
/* When the 'experiment-active' class is added to the body via JS */
body.experiment-active main#app {
    margin-top: 12vh;
    margin-left: 5%;      /* Slide to the left */
    margin-right: auto;
    max-width: 650px;     /* Narrow for the journal feel */
}
/* --- 3. FIXING THE FORM SIZE --- */
.auth-container {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Changed from flex-start to center */
    gap: 60px; 
    width: 100%;
    min-height: 60vh; /* Optional: gives the container enough room to center things nicely */
}

.auth-text {
    flex: 1.4;
    /* Removed padding-top: 10px; to allow true vertical centering */
}

.auth-form {
    flex: 1;
    min-width: 380px; 
    background: #ffffff;
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.05); /* A very faint "mystical" glow */
}
/* --- Auth Form Divider --- */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 25px 0; /* Space it out from the buttons */
    color: #555555; /* Dark enough to read on white */
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #eeeeee; /* Very subtle light grey line */
}

.divider:not(:empty)::before {
    margin-right: 15px;
}

.divider:not(:empty)::after {
    margin-left: 15px;
}

.divider span {
    font-weight: 600;
}

.auth-form input {
    width: 100%;
    height: 50px; /* Comfortable, standard premium height */
    padding: 0 15px;
    margin-bottom: 15px;
    font-size: 1.05rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #1a1a1a;
    box-sizing: border-box;
}

.auth-form input:focus {
    border-color: #6200ee; /* Philosophy Purple focus */
    outline: none;
    box-shadow: 0 0 0 3px rgba(98, 0, 238, 0.1);
}

/* The Login/Register Button (The Primary Action) */
.primary-btn {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    transition: background 0.2s;
}

.primary-btn:hover {
    background-color: #333333;
}

/* --- 4. THE BACKGROUND (Oracle Visibility) --- */
body.experiment-active {
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.8)), 
                url('https://firebasestorage.googleapis.com/v0/b/what-say-you-1bafa.firebasestorage.app/o/oracle-vision.webp?alt=media&token=1621004c-395d-4cef-804d-9c59956b212f');
    background-size: cover;
    background-position: right center; /* Face on the right */
    background-attachment: fixed;
}

/* --- THE FOUNDATION --- */
body {
    background-color: var(--paper);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    overflow-x: hidden;
}

/* --- THE HUD (HEADER) --- */
header {
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 1000;
    /* Soft gradient ensures white text is readable against the Oracle */
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, transparent 100%);
    padding: 30px 0; 
    text-align: center;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 4px;
    color: #ffffff;
    text-transform: uppercase;
    margin: 0;
}

.tagline {
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--oracle-purple);
    text-transform: uppercase;
    opacity: 0.8;
}

/* --- THE ORACLE PORTRAIT --- */
.oracle-portrait {
    width: 100%;
    max-height: 45vh; /* Prevents decapitation and creates space for feed */
    object-fit: cover;
    object-position: center 20%; /* Focuses on the face */
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    margin-bottom: -50px; /* Pulls content up into the image glow */
}


.experiment-content {
    /* Uses your variables for consistency */
    background: var(--glass); 
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    
    padding: 2.5rem;
    border-radius: 20px;
    
    /* A subtle purple-tinted border for a mystical feel */
    border: 1px solid rgba(216, 180, 254, 0.2); 
    
    /* Deep shadow to give the box weight */
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
    
    /* Ensures content stays readable against the blur */
    color: var(--ink);
}

/* Optional: Add a specific border color when on the Metaphysical path */
body.metaphysical-active .experiment-content {
    border-color: var(--oracle-purple);
    box-shadow: 0 0 40px rgba(216, 180, 254, 0.1), 0 30px 60px rgba(0, 0, 0, 0.8);
}

.serif-text {
    font-family: "Charter", serif;
    font-size: 1.25rem;
    line-height: 1.8;
    color: #f3f4f6;
}

/* --- THE REFLECTION ZONE --- */
.insight-request-zone {
    background: var(--glass);
    padding: 30px;
    border-radius: 15px;
    margin-top: 40px;
    border: 1px solid rgba(216, 180, 254, 0.2);
}

/* --- 2. THE TEXTAREA (Deep & Wide) --- */
textarea {
    width: 100%;
    min-height: 300px; /* Deep journal feel */
    padding: 20px;
    font-size: 1.25rem;
    line-height: 1.6;
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    border: 1px solid var(--oracle-purple);
    border-radius: 12px;
    box-sizing: border-box; /* Prevents width blowout */
    font-family: 'Inter', sans-serif;
    transition: box-shadow 0.3s ease;
}

textarea:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(216, 180, 254, 0.3);
    border-color: #ffffff;
}

/* --- 3. THE HERO SUBMIT BUTTON --- */
.insight-btn {
    display: block;
    width: 100%;
    padding: 24px; /* Massive, clickable area */
    margin-top: 20px;
    background-color: var(--oracle-purple) !important;
    color: #000000 !important; /* Maximum contrast */
    border: none !important;
    border-radius: 12px;
    font-size: 1.3rem; /* Hero scale text */
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(216, 180, 254, 0.4);
    transition: all 0.2s ease;
}

.insight-btn:hover {
    transform: translateY(-4px);
    background-color: #ffffff !important; /* Turns white on hover for a 'flash' effect */
    box-shadow: 0 10px 25px rgba(216, 180, 254, 0.6);
}

/* --- 4. GENERAL BUTTON RECOVERY (For secondary buttons) --- */
button:not(.insight-btn) {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.secondary {
    background: transparent;
    color: #333333; /* Dark grey/black for readability on white */
    border: 1px solid rgba(0, 0, 0, 0.2); /* Subtle dark border */
    transition: all 0.2s ease;
}

.secondary:hover {
    background: rgba(0, 0, 0, 0.05); /* Slight tint on hover */
    border-color: rgba(0, 0, 0, 0.5);
}

/* --- COMMUNITY FEED --- */
#stances-feed {
    margin-top: 60px;
    padding-bottom: 100px;
}

.stance-bubble {
    background: #ffffff;
    color: #1a1a1a;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 5px solid var(--oracle-purple);
}

/* --- ADVERTISING BUSINESS --- */
.ad-placeholder {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255,255,255,0.1);
    color: #555;
    text-transform: uppercase;
    font-size: 0.6rem;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 40px 0;
    min-height: 100px;
}

/* --- CALIBRATION OVERLAY (The Red Pill) --- */
#calibration-overlay {
    background: #000 !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calibration-container {
    max-width: 900px;
    width: 95%;
    margin: 0 auto;
    padding: 20px;
}

.side-by-side-paths {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: stretch; /* Makes both cards the same height */
    margin-top: 30px;
}

.path-choice-card {
    flex: 1;
    min-width: 280px;
    background: #0a0a0a;
    border: 1px solid #333;
    padding: 2.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* Hover effect for both */
.path-choice-card:hover {
    background: #111;
}

/* Grounded specific style */
.path-choice-card.grounded-style:hover {
    border-color: #4ade80 !important; /* Oracle Green */
}

/* Metaphysical specific style (The Red Pill / Purple) */
.path-choice-card.meta-style {
    border-color: var(--oracle-purple, #a855f7);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.1);
}

.path-choice-card.meta-style:hover {
    border-color: var(--oracle-purple, #a855f7) !important;
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.2);
}

/* --- RESPONSIVENESS OVERHAUL --- */
@media (max-width: 1024px) {
    main {
        margin-left: auto; /* Centers the box */
        margin-right: auto;
        max-width: 95%; /* Gives more room on small screens */
        width: 95%;
        margin-top: 5vh; /* Brings content up slightly on mobile */
    }

    .side-by-side-paths {
        flex-direction: column; /* Stacks the Grounded and Meta cards */
        align-items: center;
    }

    .path-choice-card {
        width: 100%; /* Ensures cards take up full width of the main container */
        max-width: 100%;
        padding: 1.5rem;
    }
    
    .auth-container {
        flex-direction: column; /* If your login screen uses flex, this stacks it */
    }
}

/* --- THE LEGAL WHISPER (Privacy Policy Link) --- */
.legal-whisper {
    display: block;
    text-align: center;
    margin: 40px auto 20px auto;
    font-size: 0.75rem;
    
    /* THE FIX: High-contrast but soft color */
    color: #a1a1aa !important; /* A cool, readable silver-gray */
    
    text-decoration: none;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    clear: both;
    width: 100%;
}

.legal-whisper:hover {
    color: #d8b4fe !important; /* Glows your Oracle Purple on hover */
    text-shadow: 0 0 8px rgba(216, 180, 254, 0.6);
    text-decoration: underline;
}

/* Ensure footer links follow the same high-contrast rule */
#main-footer a {
    color: #a1a1aa;
    text-decoration: none;
    transition: color 0.2s;
}

#main-footer a:hover {
    color: #ffffff;
}

/* --- UTILITIES --- */
.hidden { display: none !important; }