/* 
  =============================================================
  ORACULUMINUS — GLOBAL THEME & VARIABLES
  =============================================================
*/

:root {
    /* --------------------------------------------------------
       BASE THEME (DARK MODE - DEFAULT)
       -------------------------------------------------------- */
    
    /* Backgrounds */
    --bg: #06060e;
    --bg2: #12121a;
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-dark: #0a0a0f;
    
    /* Cards & Surfaces */
    --card: rgba(255, 255, 255, 0.025);
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-h: rgba(255, 255, 255, 0.055);
    --bg-card-hover: rgba(26, 26, 36, 0.9);
    
    /* Borders */
    --border: rgba(255, 255, 255, 0.07);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-h: rgba(212, 175, 55, 0.35);
    --border-hover: rgba(212, 175, 55, 0.3);

    /* Text & Typography */
    --txt: #f0f0f5;
    --txt2: #9ca3af;
    --txt3: #6b7280;
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --text-muted: #666;
    
    /* Fonts */
    --fd: 'Cormorant Garamond', Georgia, serif;
    --fb: 'DM Sans', system-ui, sans-serif;
    --r: 1rem;
    --e: cubic-bezier(.4, 0, .2, 1);

    /* Colors - Brand Gold */
    --gold: #d4af37;
    --gold-l: #f4e4a6;
    --gold-light: #f4e4a6;
    --gold-d: rgba(212, 175, 55, 0.12);
    --gold-dim: rgba(212, 175, 55, 0.15);
    --gold-glow: rgba(212, 175, 55, 0.4);
    
    /* Colors - Purple (Used as default accent in some places) */
    --purple: #a78bfa;
    --purple-d: rgba(167, 139, 250, 0.12);
}

/* 
  --------------------------------------------------------
  LIGHT THEME OVERRIDES (FROST / PEARL AESTHETIC)
  --------------------------------------------------------
*/
html.light-theme, body.light-theme {
    /* Backgrounds: Soft pearl/silver with a very subtle warmth */
    --bg: #f8f9fa;
    --bg2: #ffffff;
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-dark: #f0f2f5;
    
    /* Cards & Surfaces: Premium Frosted Glass (White) */
    --card: rgba(255, 255, 255, 0.6);
    --bg-card: rgba(255, 255, 255, 0.65);
    --bg-card-h: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 1);
    
    /* Borders: White/glow borders instead of dark lines to avoid looking cheap */
    --border: rgba(255, 255, 255, 1);
    --border-color: rgba(255, 255, 255, 0.8);
    --border-h: rgba(212, 175, 55, 0.6);
    --border-hover: rgba(212, 175, 55, 0.5);

    /* Text & Typography: Rich Charcoal and Soft Slate */
    --txt: #1a1a24;
    --txt2: #4a5568;
    --txt3: #718096;
    --text-primary: #1a1a24;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    
    /* Colors - Brand Gold (Rich and metallic for light bg) */
    --gold: #b8860b;
    --gold-l: #996515;
    --gold-light: #996515;
    --gold-d: rgba(184, 134, 11, 0.15);
    --gold-dim: rgba(184, 134, 11, 0.2);
    --gold-glow: rgba(184, 134, 11, 0.3);
    
    /* Missing Accent Mappings from specific pages */
    --accent: #b8860b;
    --accent-light: #996515;
    --accent-dark: #8e6808;
    --accent-glow: rgba(184, 134, 11, 0.3);
    --accent-subtle: rgba(184, 134, 11, 0.1);
}

/* Light Theme Background Overrides */
html.light-theme .bg-effects, 
html.light-theme .atm {
    background: linear-gradient(135deg, #f8f9fa 0%, #f0f2f5 100%) !important;
}

html.light-theme .bg-glow {
    opacity: 0.1 !important; /* Dim the neon glows heavily */
}

/* 
  AGGRESSIVE LIGHT THEME OVERRIDES 
  (To combat hardcoded inline styles in legacy files)
*/
html.light-theme body,
html.light-theme .page-wrapper,
html.light-theme main {
    background: var(--bg) !important;
    color: var(--txt) !important;
}

/* Navbar Fixes */
html.light-theme .site-header,
html.light-theme nav,
html.light-theme header {
    background: rgba(248, 249, 250, 0.9) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}
html.light-theme .site-header .sh-nav-link,
html.light-theme .site-header .sh-user-name,
html.light-theme .sh-theme-toggle,
html.light-theme .nav-a a,
html.light-theme .u-nm {
    color: var(--txt2) !important;
}
html.light-theme .site-header .sh-nav-link:hover,
html.light-theme .sh-theme-toggle:hover,
html.light-theme .nav-a a:hover {
    color: var(--accent) !important;
    background: rgba(0, 0, 0, 0.05) !important;
}

/* Chat Input Areas & Textboxes */
html.light-theme .input-area {
    background: rgba(255, 255, 255, 0.85) !important;
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.03) !important;
}
html.light-theme textarea,
html.light-theme input,
html.light-theme .question-input {
    background: rgba(0, 0, 0, 0.03) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: var(--txt) !important;
}
html.light-theme textarea:focus,
html.light-theme input:focus {
    background: #fff !important;
    border-color: var(--accent) !important;
}

/* Button Contrast Fixes (Gold bg with white text is illegible, use Dark button for Light Theme) */
html.light-theme .btn-primary, 
html.light-theme .btn-consult, 
html.light-theme .gcm-cta,
html.light-theme .sh-upgrade-btn {
    background: #1a1a24 !important;
    color: #f8f9fa !important;
    border: 1px solid #0a0a0f !important;
}
html.light-theme .btn-primary:hover, 
html.light-theme .btn-consult:hover, 
html.light-theme .gcm-cta:hover,
html.light-theme .sh-upgrade-btn:hover {
    background: #000 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

html.light-theme h1, html.light-theme h2, html.light-theme h3, html.light-theme h4,
html.light-theme .page-title {
    color: var(--gold-l) !important;
}

html.light-theme p, 
html.light-theme .page-subtitle,
html.light-theme span {
    color: var(--txt2);
}

html.light-theme strong, html.light-theme b {
    color: var(--txt) !important;
}

html.light-theme [class*="card"], 
html.light-theme [class*="modal-content"],
html.light-theme .gcm-card,
html.light-theme .history-card,
html.light-theme .history-item {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--txt) !important;
}

html.light-theme .history-item {
    background: rgba(255, 255, 255, 0.8) !important;
}

html.light-theme .history-q {
    color: var(--txt) !important;
}

html.light-theme .history-a {
    color: var(--txt2) !important;
}

/* Oráculo / Tarot Specific Chat & Content Overrides */
html.light-theme #chatArea,
html.light-theme .chat-container,
html.light-theme .ritual-overlay {
    background: transparent !important;
}
html.light-theme .chat-message.user {
    background: rgba(26, 26, 36, 0.05) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: var(--txt) !important;
}
html.light-theme .chat-message.oracle {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
    color: var(--txt) !important;
}
html.light-theme .welcome-message {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    color: var(--txt) !important;
}
html.light-theme .typing-indicator span {
    background-color: var(--accent) !important;
}

/* Force inline styles that use white to use dark in light mode */
html.light-theme *[style*="color:rgba(255,255,255"] {
    color: var(--txt2) !important;
}
html.light-theme *[style*="color:#fff"], html.light-theme *[style*="color: #fff"] {
    color: var(--txt) !important;
}

/* Global utility classes for micro-animations & layout improvements */
.sh-theme-toggle {
    background: none;
    border: none;
    color: var(--txt2, #9ca3af);
    cursor: pointer;
    padding: 6px;
    margin-right: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
}
.sh-theme-toggle:hover {
    color: var(--gold, #d4af37);
    background: rgba(255, 255, 255, 0.05);
}
.light-theme .sh-theme-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}
.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.hover-lift:hover {
    transform: translateY(-2px);
}

/* =========================================================
   1. TYPOGRAPHY REFINEMENTS
   ========================================================= */
h1, h2, h3, h4, h5, h6, .page-title, .section-title {
    font-family: var(--fd);
    letter-spacing: 0.03em;
    line-height: 1.25;
}

p {
    line-height: 1.7;
    letter-spacing: 0.01em;
}

/* =========================================================
   2. GLASSMORPHISM ENHANCEMENTS (Auto-applied to cards)
   ========================================================= */
div[class*="card"], div[class*="panel"] {
    /* Apply a stronger blur and a subtle border gradient logic */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease;
}

/* Refined hover state for anything that looks like a card */
div[class*="card"]:hover:not(.sh-card) {
    border-color: var(--border-h, rgba(212, 175, 55, 0.4));
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 0 0 20px rgba(212, 175, 55, 0.05);
}

.light-theme div[class*="card"]:hover:not(.sh-card) {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05), 0 0 20px rgba(184, 150, 46, 0.1);
}

/* =========================================================
   3. MICRO-INTERACTIONS (Auto-applied to buttons)
   ========================================================= */
/* Give all buttons a uniform, silky transition */
button, a[class*="btn"], .gcm-cta {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                box-shadow 0.3s ease, 
                background-color 0.3s ease, 
                border-color 0.3s ease !important;
}

/* Lift effect on hover */
button:not(:disabled):hover, 
a[class*="btn"]:not(.sh-btn-login):hover, 
.gcm-cta:hover {
    transform: translateY(-3px) scale(1.02);
}

/* Add a subtle glow to primary CTA buttons on hover */
.btn-primary:hover, .btn-consult:hover, .gcm-cta:hover, .sh-upgrade-btn:hover {
    box-shadow: 0 10px 25px var(--gold-d, rgba(212, 175, 55, 0.25));
    filter: brightness(1.05);
}

.light-theme .btn-primary:hover, .light-theme .btn-consult:hover, .light-theme .gcm-cta:hover {
    box-shadow: 0 10px 25px rgba(184, 150, 46, 0.2);
}

/* Active state for buttons (when clicked) */
button:not(:disabled):active, 
a[class*="btn"]:active, 
.gcm-cta:active {
    transform: translateY(1px) scale(0.98);
}
