/* :root {
  --bg-color: #f9fafb;
  --card-bg: #ffffff;
  --card-nested-bg: #f9fafb;
  --border-primary: #e5e7eb;
  --border-secondary: #f3f4f6;
  --border-input: #d1d5db;
  --text-dark: #111827;
  --text-body: #374151;
  --text-muted: #4b5563;
  --text-light: #9ca3af;
  --avatar-blue-bg: #dbeafe;
}

html.dark {
  --bg-color: #0b0f19;
  --card-bg: #151f32;
  --card-nested-bg: #1e293b;
  --border-primary: #1e293b;
  --border-secondary: #334155;
  --border-input: #475569;
  --text-dark: #f9fafb;
  --text-body: #e2e8f0;
  --text-muted: #cbd5e1;
  --text-light: #94a3b8;
  --avatar-blue-bg: #1e3a8a;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.2s, color 0.2s;
} */

/* ==========================================================================
   THE VOID (Default Baseline Theme — Dark)
   ========================================================================== */
:root {
  /* Layout & Surfaces */
  --bg-main: #050507;            /* Deep cosmic black */
  --bg-surface: #0d0d12;         /* Raised cards/menus */
  --border-input: #1f1f2e;       /* Faint border accent */
  
  /* Typography */
  --text-body: #e4e4e7;          /* Soft stark off-white */
  --text-muted: #71717a;         /* Dimmed text for secondary elements */
  
  /* App Accent Colors */
  --accent-primary: #3b82f6;     /* Hermes' blue notifications */
  --accent-glow: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   THE ETHER (Light Theme Transformation)
   ========================================================================== */
.light-theme {
  /* Layout & Surfaces */
  --bg-main: #fcfbfa;            /* Warm, bright ethereal parchment */
  --bg-surface: #ffffff;         /* Clean pure white surfaces */
  --border-input: #e4e4e7;       /* Soft grey border divider */
  
  /* Typography */
  --text-body: #18181b;          /* High-contrast ink text */
  --text-muted: #52525b;         /* Sophisticated grey secondary text */
  
  /* App Accent Colors */
  --accent-primary: #2563eb;     /* Clear readable blue for light backgrounds */
  --accent-glow: rgba(245, 158, 11, 0.15); /* Warm amber hint */
}

/* ==========================================================================
   Global Base Applications Hooks
   ========================================================================== */
body {
  background-color: var(--bg-main);
  color: var(--text-body);
  transition: background-color 0.4s ease, color 0.3s ease;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Smooth layout transitions for specific UI text hooks */
.mode-label, 
a, 
button {
  transition: color 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

/* ==========================================================================
   The Void Idle Animation
   ========================================================================== */
@keyframes spin-cosmic {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-void-ring {
  /* Rotates slowly over 25 seconds infinitely and smoothly */
  animation: spin-cosmic 25s linear infinite;
  /* Ensures the rotation axis is perfectly centered in the SVG */
  transform-origin: center;
}

/* ==========================================================================
   HEROKU PRODUCTION SPECIFICITY OVERRIDES (Strict Reset)
   ========================================================================== */

/* Target every possible state of a mention link to kill default blue/underlines */
a.user-mention,
a.user-mention:link,
a.user-mention:visited,
a.user-mention:hover,
a.user-mention:active,
.greek-grid-card a.user-mention,
main p a.user-mention {
  text-decoration: none !important;
  border-bottom: none !important;
  font-weight: 600 !important;
  display: inline-block !important;
  box-shadow: none !important;
}

/* THE VOID MODE: Luminous Glowing Gold Baseline */
a.user-mention,
a.user-mention:link,
a.user-mention:visited {
  color: #f59e0b !important;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.4) !important;
}

a.user-mention:hover {
  color: #fbbf24 !important;
  text-shadow: 0 0 14px rgba(251, 191, 36, 0.7) !important;
}

/* THE ETHER MODE: Clean Daytime Text Primary Accent Overrides */
.light-theme a.user-mention,
.light-theme a.user-mention:link,
.light-theme a.user-mention:visited,
[data-theme="ether"] a.user-mention,
[data-theme="ether"] a.user-mention:link,
[data-theme="ether"] a.user-mention:visited {
  color: var(--accent-primary) !important;
  text-shadow: none !important;
}

.light-theme a.user-mention:hover,
[data-theme="ether"] a.user-mention:hover {
  filter: brightness(1.15) !important;
}

/* ==========================================================================
   MOBILE DISPLAY GRID ADJUSTMENTS
   ========================================================================== */
@media (max-width: 768px) {
  /* 1. Force sidebar columns to drop below the main content feed stream smoothly */
  main,
  div[style*="display: flex"],
  div[style*="display: flex; flex-wrap: wrap"] {
    flex-direction: column !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    gap: 20px !important;
  }

  /* 2. Scale right sidebar blocks to span across the entire available screen width */
  div[style*="max-width: 380px"],
  div[style*="width: 320px"],
  .friends-dashboard-widget {
    max-width: 100% !important;
    width: 100% !important;
  }

  /* 3. Drop layout wrappers from widescreen auto margins down to standard safe gutters */
  div[style*="max-width: 1400px"] {
    padding: 16px 12px !important;
    margin-top: 10px !important;
  }

  /* 4. Restructure your main toolbar layout bar to stack action buttons */
  header,
  nav {
    flex-wrap: wrap !important;
    gap: 12px !important;
    justify-content: center !important;
    text-align: center !important;
  }
}

/* ==========================================================================
   MOBILE INTERACTION & TOUCH TARGET OPTIMIZATIONS (WCAG Safe)
   ========================================================================== */

/* 1. Optimize Form Inputs for Mobile Typing and Tapping Targets */
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  min-height: 42px; /* Expands interaction bounding boxes for thumb taps */
  font-size: 16px !important; /* CRUCIAL: Prevents iOS Safari from forcefully zooming in on focus */
  -webkit-tap-highlight-color: transparent; /* Eliminates the default mobile box-highlight flicker */
  transition: border-color 0.25s ease, box-shadow 0.25s ease !important;
}

/* Dynamic Active Input Focus States */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
  border-color: var(--accent-primary) !important;
  outline: none !important;
  /* Baseline: Subtle glow matching active scheme properties */
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
}

/* Explicit Custom Highlight: Luminous Golden Glow applied ONLY under The Void */
[data-theme="void"] input[type="text"]:focus,
[data-theme="void"] textarea:focus,
html:not([data-theme="ether"]) input[type="text"]:focus,
html:not([data-theme="ether"]) textarea:focus {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25) !important;
}

/* 2. Scale Interactive Buttons for Finger Tap Accessibility (Min 44px) */
button,
input[type="submit"],
.fate-toggle-btn,
a[style*="padding"] {
  min-height: 44px; /* Standardizes tap safety guidelines to prevent misclicks */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation; /* Optimizes mobile click event processing delays */
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease, filter 0.2s ease, box-shadow 0.2s ease !important;
}

/* Micro-interaction feedback layer when long-pressed or tapped on real devices */
button:active,
input[type="submit"]:active,
.fate-toggle-btn:active {
  transform: scale(0.97); /* Tactile click response */
}

/* 3. Mobile Comments Scrollbar Tracking Adjustments */
@media (max-width: 768px) {
  div[style*="max-height"], 
  .comments-drawer-stream {
    max-height: 280px !important; /* Grants extra breathing vertical height on phone viewports */
    -webkit-overflow-scrolling: touch; /* Forces buttery-smooth kinetic momentum scrolling in iOS */
  }
}

/* ==========================================================================
   PRODUCTION REFINED AVATAR SQUISH RESET (Fixed Navigation Bug)
   ========================================================================== */

div[style*="border-radius: 50%"],
div[style*="border-radius:50%"] {
  flex-shrink: 0 !important; 
}

.friends-dashboard-widget img,
.greek-friend-card img,
.greek-grid-card img,
#comments-list img,
.mention-item img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  flex-shrink: 0 !important;
}

header img,
header div[style*="border-radius: 50%"],
header div[style*="border-radius:50%"] {
  width: 36px !important;   
  height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  flex-shrink: 0 !important;
}

/* ==========================================================================
   PRODUCTION SOLID AVATAR RESOLUTION (Fixed Header Navigation Oval Bug)
   ========================================================================== */

/* 1. Prevent parent flexbox containers from squeezing circular portrait blocks on mobile */
div[style*="border-radius: 50%"],
div[style*="border-radius:50%"] {
  flex-shrink: 0 !important;
}

/* 2. Enforce rigid width constraints on avatar portrait wrappers across folders */
div[style*="width: 50px; height: 50px"] { min-width: 50px !important; max-width: 50px !important; height: 50px !important; }
div[style*="width: 80px; height: 80px"] { min-width: 80px !important; max-width: 80px !important; height: 80px !important; }
div[style*="width: 48px; height: 48px"] { min-width: 48px !important; max-width: 48px !important; height: 48px !important; }
div[style*="width: 96px; height: 96px"] { min-width: 96px !important; max-width: 96px !important; height: 96px !important; }
div[style*="width: 32px; height: 32px"] { min-width: 32px !important; max-width: 32px !important; height: 32px !important; }

/* 3. ONLY allow an image to fill 100% width if it lives INSIDE an explicit portrait wrapper ring */
div[style*="border-radius: 50%"] img,
div[style*="border-radius:50%"] img,
.icon-card img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important; 
  flex-shrink: 0 !important;
  border-radius: 50% !important;
}

/* 4. SAFETY RESET FOR TIMELINE PHOTOS: Let attached media files scale natively and take up natural ratios */
div[style*="max-height: 450px"] img,
div[style*="max-height: 400px"] img,
summary img,
details img {
  width: 100% !important;
  height: auto !important; 
  max-height: 450px !important;
  object-fit: cover !important;
  border-radius: 8px !important; 
  flex-shrink: initial !important; 
}

/* 5. SPECIFIC FIX: Lock the Header Navigation Avatar Frame AND its inner Image to be perfectly square */
header div[style*="border-radius: 50%"],
header div[style*="border-radius:50%"] {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;  
  max-width: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  flex-shrink: 0 !important;
}

header div[style*="border-radius: 50%"] img,
header div[style*="border-radius:50%"] img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;
  border-radius: 50% !important;
}
