/* ================================================================== */
/* STAR NEWS TV - COMPREHENSIVE UNIFIED STYLES                        */
/* Complete design system for all 20+ PHP pages with star background  */
/* ================================================================== */

/* ================================================================== */
/* 1. CSS CUSTOM PROPERTIES (DESIGN TOKENS)                          */
/* ================================================================== */
:root {
  color-scheme: dark;
  
  /* Brand Colors */
  --brand-primary: #3b82f6;
  --brand-secondary: #8b5cf6;
  --brand-accent: #60a5fa;
  --brand-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  /* Primary Colors (for admin panel) */
  --primary-blue: #3b82f6;
  --primary-purple: #8b5cf6;
  --primary-accent: #60a5fa;
  
  /* Background Colors */
  --bg-primary: #0a0a0a;
  --bg-secondary: #121212;
  --bg-surface: #1a1a1a;
  --bg-elevated: #262626;
  --bg-glass: rgba(26, 26, 26, 0.8);
  --bg-glass-light: rgba(26, 26, 26, 0.6);
  --background-card: rgba(26, 26, 26, 0.8);
  
  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #e5e7eb;
  --text-muted: #9ca3af;
  --text-accent: #60a5fa;
  --text-inverse: #1f2937;
  
  /* Border Colors */
  --border-primary: rgba(59, 130, 246, 0.2);
  --border-secondary: rgba(255, 255, 255, 0.1);
  --border-glass: rgba(59, 130, 246, 0.3);
  
  /* Shadow System */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.3);
  
  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  
  /* Typography Scale */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;
  
  /* Line Heights */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  
  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  
  /* Transitions */
  --transition-fast: 150ms ease-out;
  --transition-normal: 250ms ease-out;
  --transition-slow: 350ms ease-out;
  
  /* Backdrop Effects */
  --backdrop-blur: blur(20px);

  /* Z-Index Scale */
  --z-background: -3;
  --z-stars: -2;
  --z-gradient: -1;
  --z-base: 0;
  --z-elevated: 10;
  --z-floating: 50;
  --z-overlay: 100;
  --z-modal: 200;
  --z-header: 1000;
  --z-toast: 2000;
}

/* ================================================================== */
/* 2. RESET & BASE STYLES                                             */
/* ================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
  font-weight: var(--font-normal);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  z-index: var(--z-base);
}

/* ================================================================== */
/* 3. STARSCAPE BACKGROUND SYSTEM (CRITICAL)                          */
/* ================================================================== */

/* Main background container */
.starscape-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-background);
  overflow: hidden;
  background: #000;
}

/* Star background image - MAIN REQUIREMENT */
.starscape-background-image {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../sitegfx/star.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  animation: slowDrift 600s linear infinite;
  opacity: 0.2; /* Very faint as requested */
  z-index: -20; /* Behind everything */
  pointer-events: none;
  background-color: transparent;
}

/* Fallback gradient if star image is missing */
.starscape-background-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    #0a0a28 0%,
    #1a1a3a 25%,
    #2a2a4a 50%,
    #1a1a3a 75%,
    #0a0a28 100%
  );
  z-index: -1;
}

/* Enhanced Stars Layer */
.starscape-stars-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  animation: slowDrift 800s linear infinite;
  z-index: 2;
}

/* Dynamic Star Styles */
.starscape-star {
  position: absolute;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
}

/* Star Size Variations */
.starscape-star.size-1 { width: 1px; height: 1px; }
.starscape-star.size-2 { width: 1.5px; height: 1.5px; }
.starscape-star.size-3 { width: 2px; height: 2px; }
.starscape-star.size-4 { 
  width: 2.5px; 
  height: 2.5px; 
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.9); 
}
.starscape-star.size-5 { 
  width: 3px; 
  height: 3px; 
  box-shadow: 0 0 5px rgba(255, 255, 255, 1); 
}

/* Twinkling Effect */
.starscape-star.twinkle {
  animation: twinkleEffect 8s ease-in-out infinite;
}

/* Lens Effect for Enhanced Realism */
.starscape-lens-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    transparent 40%,
    rgba(255, 255, 255, 0.03) 70%,
    rgba(255, 255, 255, 0.08) 85%,
    rgba(200, 220, 255, 0.15) 100%
  );
  pointer-events: none;
  mix-blend-mode: screen;
  z-index: 3;
}

/* Gradient Overlay Layer */
.starscape-gradient-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(5, 5, 20, 0.8),
    rgba(10, 5, 25, 0.7),
    rgba(5, 10, 30, 0.8),
    rgba(8, 5, 22, 0.7)
  );
  background-size: 400% 400%;
  animation: breathingGradient 60s ease-in-out infinite;
  mix-blend-mode: multiply;
}

/* Additional overlay for better content readability */
.starscape-content-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1;
}

/* Background Animations */
@keyframes breathingGradient {
  0%, 100% {
    background-position: 0% 50%;
    opacity: 0.6;
  }
  50% {
    background-position: 100% 50%;
    opacity: 0.8;
  }
}

@keyframes slowDrift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-2%, 2%); }
}

@keyframes twinkleEffect {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes gentlePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.01); }
}

/* Add twinkling effect to background */
.starscape-background-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at 20% 20%, rgba(255, 255, 255, 0.1) 1px, transparent 1px
  ),
  radial-gradient(
    circle at 80% 30%, rgba(255, 255, 255, 0.1) 1px, transparent 1px
  ),
  radial-gradient(
    circle at 40% 70%, rgba(255, 255, 255, 0.1) 1px, transparent 1px
  ),
  radial-gradient(
    circle at 90% 80%, rgba(255, 255, 255, 0.1) 1px, transparent 1px
  );
  animation: twinkle 4s ease-in-out infinite;
}

/* Content positioning - ensure content appears above background */
body {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* Ensure all main content containers are properly positioned */
.container,
.main-content,
.content,
.content-wrapper,
.page-wrapper,
.page-content,
.ultra-container,
.sa,
.dashboard-container,
.archive-container,
.enhanced-archive-container,
.article-viewer {
  position: relative;
  z-index: 2;
}

/* ================================================================== */
/* 4. TYPOGRAPHY SYSTEM                                               */
/* ================================================================== */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-4);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
  margin-bottom: var(--space-4);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

a {
  color: var(--text-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-accent);
}

a:focus {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* ================================================================== */
/* 5. LAYOUT SYSTEM                                                   */
/* ================================================================== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-4);
  position: relative;
  z-index: var(--z-base);
}

/* ================================================================== */
/* 6. GLASS MORPHISM CARD SYSTEM                                      */
/* ================================================================== */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-glass);
  transition: all var(--transition-normal);
}

.glass-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-xl);
  border-color: var(--brand-primary);
}

/* Post Cards - FIX FOR BLACK BOXES ISSUE */
.post-card, .card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-glass);
  transition: all var(--transition-normal);
  
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  position: relative;
  color: var(--text-secondary);
  min-height: 300px;
  height: auto;
}

.post-card:hover, .card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
  border-color: var(--brand-primary);
}

/* CRITICAL FIX: Ensure images and content are visible */
.post-card img, .card img,
.post-card video, .card video,
.post-card iframe, .card iframe {
  width: 100%;
  height: auto;
  min-height: 200px;
  max-height: 400px;
  object-fit: cover;
  display: block;
  background: var(--bg-surface);
  transition: transform var(--transition-normal);
}

.post-card:hover img, .card:hover img,
.post-card:hover video, .card:hover video {
  transform: scale(1.05);
}

/* Post Card Content - FIX TITLE DISPLAY */
.post-card-info, .card-body {
  padding: var(--space-5);
  background: linear-gradient(to bottom, transparent, var(--bg-glass));
  position: relative;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.post-card-info h3, .card-body h3,
.post-card-info h4, .card-body h4,
.post-card-info h5, .card-body h5 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary) !important;
  margin-bottom: var(--space-2);
  line-height: var(--leading-tight);
  flex-shrink: 0;
}

.post-card-info h3 a, .card-body h3 a,
.post-card-info h4 a, .card-body h4 a,
.post-card-info h5 a, .card-body h5 a {
  color: var(--text-primary) !important;
  transition: color var(--transition-fast);
}

.post-card-info h3 a:hover, .card-body h3 a:hover,
.post-card-info h4 a:hover, .card-body h4 a:hover,
.post-card-info h5 a:hover, .card-body h5 a:hover {
  color: var(--brand-accent) !important;
}

.post-card-info p, .card-body p {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  margin-top: auto;
  flex-shrink: 0;
}

/* Posts Container - FIX GRID DISPLAY */
.posts-container, .posts-container-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
  padding: var(--space-6);
  align-items: start;
  position: relative;
  z-index: 10;
  opacity: 1;
  background: transparent;
}

/* ================================================================== */
/* 7. HEADER AND NAVIGATION STYLES                                    */
/* ================================================================== */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  height: 80px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.85) 0%, rgba(17, 24, 39, 0.85) 50%, rgba(15, 23, 42, 0.85) 100%);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  border-left: none;
  border-right: none;
  border-top: none;
  border-radius: 0;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 10px 16px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-dropdown-toggle:hover {
  background: var(--bg-glass-light);
  border-color: var(--brand-primary);
  transform: translateY(-1px);
}

/* GLOBAL CONTENT SPACING - Fix header overlap on all pages */
body {
  padding-top: 100px !important; /* Account for fixed header + banner */
}

/* Main content containers */
main, .main-content, .content, .container, .page-content, 
.ultra-container, .sa, .dashboard-container, .archive-container,
.enhanced-archive-container, .article-viewer {
  margin-top: 20px !important; /* Additional spacing after header */
  position: relative;
  z-index: 1;
}

/* Specific page adjustments */
.index-content, .news-content, .post-content {
  margin-top: 20px !important;
}

/* Ensure content is not hidden behind header */
.content-wrapper, .page-wrapper, .main-wrapper {
  padding-top: 20px !important;
}

/* ================================================================== */
/* 8. BUTTON SYSTEM                                                   */
/* ================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: var(--font-size-sm);
  font-weight: var(--font-medium);
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  min-height: 44px; /* Touch-friendly */
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

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

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

/* Button Variants */
.btn-primary {
  background: var(--brand-primary);
  color: var(--text-primary);
  border-color: var(--brand-primary);
}

.btn-primary:hover {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-color: var(--border-secondary);
}

.btn-secondary:hover {
  background: var(--bg-glass);
  border-color: var(--border-primary);
}

.btn-success {
  background: #10b981;
  color: var(--text-primary);
  border-color: #10b981;
}

.btn-danger {
  background: #ef4444;
  color: var(--text-primary);
  border-color: #ef4444;
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-xs);
  min-height: 36px;
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--font-size-base);
  min-height: 52px;
}

/* ================================================================== */
/* 9. FORM ELEMENTS                                                   */
/* ================================================================== */
input,
textarea,
select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-glass);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--font-size-base);
  transition: all var(--transition-fast);
  backdrop-filter: blur(10px);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-control, .form-select {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  transition: all 0.3s ease;
  width: 100%;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ================================================================== */
/* 10. ALERT SYSTEM                                                   */
/* ================================================================== */
.alert {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  border: 1px solid;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--brand-primary);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

/* ================================================================== */
/* 11. UTILITY CLASSES                                                */
/* ================================================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.w-full { width: 100%; }
.h-full { height: 100%; }

/* Spacing utilities */
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }

/* ================================================================== */
/* 12. FOOTER STYLES                                                  */
/* ================================================================== */
.main-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-glass);
  margin-top: 4rem;
  padding: 4rem 0 2rem;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-column h4 {
  color: var(--text-primary);
  font-size: 1.125rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-column h4 i {
  color: var(--brand-primary);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--brand-primary);
  text-decoration: none;
}

/* ================================================================== */
/* 13. RESPONSIVE DESIGN                                              */
/* ================================================================== */
@media (max-width: 768px) {
  :root {
    --space-4: 0.75rem;
    --space-5: 1rem;
    --space-6: 1.25rem;
    --space-8: 1.5rem;
  }
  
  .container {
    padding: 0 var(--space-3);
  }
  
  .posts-container, .posts-container-wrapper {
    grid-template-columns: 1fr;
    gap: var(--space-4);
    padding: var(--space-4);
    margin-top: 80px;
  }
  
  .main-header {
    height: 70px;
  }
  
  /* Mobile content spacing adjustments */
  body {
    padding-top: 90px !important; /* Account for mobile header + banner */
  }
  
  /* Mobile content containers */
  main, .main-content, .content, .container, .page-content, 
  .ultra-container, .sa, .dashboard-container, .archive-container,
  .enhanced-archive-container, .article-viewer {
    margin-top: 15px !important; /* Reduced spacing for mobile */
  }
  
  .post-card, .card {
    min-height: 250px;
  }
  
  .post-card-info, .card-body {
    padding: var(--space-4);
  }
}

@media (max-width: 480px) {
  .post-card, .card {
    min-height: 200px;
  }
  
  .post-card-info h3, .card-body h3,
  .post-card-info h4, .card-body h4,
  .post-card-info h5, .card-body h5 {
    font-size: var(--font-size-base);
  }
  
  .btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
  }
}

/* ================================================================== */
/* 14. PRINT STYLES                                                   */
/* ================================================================== */
@media print {
  .starscape-container,
  .main-header,
  .main-footer {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .post-card, .card {
    background: white !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
}

/* ================================================================== */
/* 15. HIGH CONTRAST MODE SUPPORT                                     */
/* ================================================================== */
@media (prefers-contrast: high) {
  .post-card, .card {
    border: 2px solid var(--text-primary);
  }
  
  .starscape-content-overlay {
    background: rgba(0, 0, 0, 0.6);
  }
}

/* ================================================================== */
/* 16. REDUCED MOTION PREFERENCES                                     */
/* ================================================================== */
@media (prefers-reduced-motion: reduce) {
  .starscape-background-image,
  .starscape-gradient-overlay,
  .starscape-background-image::after {
    animation: none;
  }
  
  .starscape-background-image {
    transform: none;
  }
  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ================================================================== */
/* 17. CRITICAL FIXES FOR CONTENT DISPLAY                             */
/* ================================================================== */

/* Ensure all text elements are properly styled */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary) !important;
  margin: 15px 0 !important;
}

p {
  color: var(--text-secondary) !important;
  margin: 10px 0 !important;
  line-height: 1.6 !important;
}

/* Ensure Bootstrap doesn't override our styles */
.card-body {
  background: transparent !important;
  border: none !important;
}

.card-title {
  color: var(--text-primary) !important;
}

.card-text {
  color: var(--text-secondary) !important;
}

/* Fix for black boxes - ensure images load properly */
.post-card img, .card img {
  background-color: var(--bg-surface) !important;
  background-image: none !important;
}

/* Fix for missing content in cards */
.post-card-info, .card-body {
  background: transparent !important;
  color: var(--text-secondary) !important;
}

/* Ensure links are visible */
a {
  color: var(--text-accent) !important;
}

a:hover {
  color: var(--brand-accent) !important;
}

/* ================================================================== */
/* 18. LOADING AND ERROR STATES                                       */
/* ================================================================== */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  color: rgba(255, 255, 255, 0.7);
}

.error-message {
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.3);
  border-radius: 8px;
  padding: 15px;
  margin: 20px 0;
  color: #dc3545;
  text-align: center;
}

/* ================================================================== */
/* 19. ACCESSIBILITY IMPROVEMENTS                                     */
/* ================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for better accessibility */
a:focus, button:focus, input:focus, textarea:focus {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* ================================================================== */
/* END OF COMPREHENSIVE UNIFIED STYLES                                */
/* ================================================================== */
