/* HQTechTalk Custom Styles */

/* CSS Custom Properties for Theme Support */
:root {
  /* Light theme colors */
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --secondary-color: #64748b;
  --success-color: #059669;
  --info-color: #0284c7;
  --warning-color: #d97706;
  --danger-color: #dc2626;
  
  /* Background colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-section: #f1f5f9;
  --bg-card: #ffffff;
  
  /* Text colors */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-light: #cbd5e1;
  
  /* Border colors */
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  
  /* Header/Navigation */
  --nav-bg: #1e293b;
  --nav-text: #ffffff;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  /* Transitions */
  --transition-base: 0.2s ease-in-out;
  --transition-slow: 0.3s ease-in-out;
}

/* Dark theme colors */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-section: #334155;
  --bg-card: #1e293b;
  
  --text-primary: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #cbd5e1;
  --text-light: #94a3b8;
  
  --border-color: #334155;
  --border-light: #475569;
  
  --nav-bg: #0f172a;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

/* Ensure all text elements use theme-aware colors in dark mode */
[data-theme="dark"] p,
[data-theme="dark"] .lead,
[data-theme="dark"] .card-text,
[data-theme="dark"] li,
[data-theme="dark"] small {
  color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-muted {
  color: #cbd5e1 !important;
  opacity: 1 !important;
}

/* Dark mode card and content improvements */
[data-theme="dark"] .card-title,
[data-theme="dark"] .article-card h4,
[data-theme="dark"] .article-card h5,
[data-theme="dark"] .article-card h6 {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .card-text,
[data-theme="dark"] .article-card p {
  color: var(--text-secondary) !important;
}

[data-theme="dark"] .popular-article h6 {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .sidebar-widget h5,
[data-theme="dark"] .sidebar-widget h6 {
  color: var(--text-primary) !important;
}

/* Dark mode metadata and timestamps */
[data-theme="dark"] .meta-text,
[data-theme="dark"] .text-sm,
[data-theme="dark"] .small,
[data-theme="dark"] small,
[data-theme="dark"] .meta-info {
  color: var(--text-secondary) !important;
  opacity: 1 !important;
}

/* Dark mode view counts and sidebar content */
[data-theme="dark"] .popular-article small {
  color: #cbd5e1 !important;
  font-weight: 500 !important;
}

/* Dark mode Bootstrap classes overrides */
[data-theme="dark"] .text-light-emphasis {
  color: var(--text-secondary) !important;
}

/* Dark mode text readability fixes for legal pages */
[data-theme="dark"] .card-body p,
[data-theme="dark"] .card-body .lead,
[data-theme="dark"] .card-body section p {
  color: var(--text-secondary) !important;
}

[data-theme="dark"] .card-body h1,
[data-theme="dark"] .card-body h2,
[data-theme="dark"] .card-body h3,
[data-theme="dark"] .card-body h4,
[data-theme="dark"] .card-body h5,
[data-theme="dark"] .card-body h6 {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .card-body .display-5 {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .card-body .lead {
  color: var(--text-muted) !important;
  opacity: 1 !important;
}

/* Dark mode accordion (FAQ) text readability fixes */
[data-theme="dark"] .accordion-body,
[data-theme="dark"] .accordion-body p,
[data-theme="dark"] .accordion-body ul,
[data-theme="dark"] .accordion-body li,
[data-theme="dark"] .accordion-body strong {
  color: var(--text-secondary) !important;
}

[data-theme="dark"] .accordion-button {
  color: var(--text-primary) !important;
  background-color: var(--bg-card) !important;
}

[data-theme="dark"] .accordion-button:not(.collapsed) {
  color: var(--text-primary) !important;
  background-color: var(--bg-secondary) !important;
  box-shadow: none !important;
}

[data-theme="dark"] .accordion-item {
  background-color: var(--bg-card) !important;
  border-color: var(--border-color) !important;
}

/* Dark mode alert and warning box fixes */
[data-theme="dark"] .alert-warning {
  background-color: #374151 !important;
  border-color: #6b7280 !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .alert-warning h6,
[data-theme="dark"] .alert-warning p {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .bg-warning {
  background-color: #374151 !important;
  color: var(--text-primary) !important;
}

/* Alert box fixes for both light and dark themes */
.alert-success {
  background-color: #d4edda !important;
  border-color: #c3e6cb !important;
  color: #155724 !important;
}

.alert-success h6,
.alert-success p {
  color: #155724 !important;
}

.alert-info {
  background-color: #d1ecf1 !important;
  border-color: #bee5eb !important;
  color: #0c5460 !important;
}

.alert-info h6,
.alert-info p {
  color: #0c5460 !important;
}

.alert-warning {
  background-color: #fff3cd !important;
  border-color: #ffeaa7 !important;
  color: #856404 !important;
}

.alert-warning h6,
.alert-warning p {
  color: #856404 !important;
}

.alert-primary {
  background-color: #d4e7fd !important;
  border-color: #bee5eb !important;
  color: #003d82 !important;
}

.alert-primary h6,
.alert-primary p {
  color: #003d82 !important;
}

.alert-secondary {
  background-color: #e2e3e5 !important;
  border-color: #d3d6d8 !important;
  color: #383d41 !important;
}

.alert-secondary h6,
.alert-secondary p {
  color: #383d41 !important;
}

/* Dark theme alert fixes */
[data-theme="dark"] .alert-success {
  background-color: #1e3a28 !important;
  border-color: #2d5a3d !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .alert-success h6,
[data-theme="dark"] .alert-success p {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .alert-info {
  background-color: #1e3a40 !important;
  border-color: #2d5a68 !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .alert-info h6,
[data-theme="dark"] .alert-info p {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .alert-warning {
  background-color: #3a3520 !important;
  border-color: #5a5230 !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .alert-warning h6,
[data-theme="dark"] .alert-warning p {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .alert-primary {
  background-color: #1e2a3a !important;
  border-color: #2d4154 !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .alert-primary h6,
[data-theme="dark"] .alert-primary p {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .alert-secondary {
  background-color: #2a2c2e !important;
  border-color: #3f4142 !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .alert-secondary h6,
[data-theme="dark"] .alert-secondary p {
  color: var(--text-primary) !important;
}

/* Dark mode article timestamps */
[data-theme="dark"] .article-card small.text-muted {
  color: #cbd5e1 !important;
  font-weight: 400 !important;
}

/* Base styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background-color var(--transition-base), color var(--transition-base);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.3;
}

.display-4 {
  font-weight: 700;
  letter-spacing: -0.025em;
}

/* Tech Hero Heading Styling */
.hero .display-4 {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 25%, #2563eb 50%, #1d4ed8 75%, #1e40af 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
  filter: drop-shadow(0 4px 8px rgba(59, 130, 246, 0.3));
  animation: techGlow 3s ease-in-out infinite alternate, gradientShift 6s ease-in-out infinite;
  position: relative;
}

@keyframes techGlow {
  0% {
    filter: drop-shadow(0 4px 8px rgba(59, 130, 246, 0.3)) brightness(1);
  }
  100% {
    filter: drop-shadow(0 8px 16px rgba(59, 130, 246, 0.6)) brightness(1.1);
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Tech circuit pattern overlay */
.hero .display-4::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 2px,
    rgba(59, 130, 246, 0.03) 2px,
    rgba(59, 130, 246, 0.03) 4px
  );
  z-index: -1;
  animation: circuitPulse 4s ease-in-out infinite;
}

@keyframes circuitPulse {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.7;
  }
}

.lead {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

/* Header/Navigation */
.navbar {
  background-color: var(--nav-bg) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-base);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--nav-text) !important;
}

.navbar-nav .nav-link {
  color: var(--nav-text) !important;
  font-weight: 500;
  padding: 0.75rem 1rem !important;
  transition: all var(--transition-base);
  border-radius: 0.375rem;
  margin: 0 0.25rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
  color: var(--primary-light) !important;
  background-color: rgba(59, 130, 246, 0.1);
}

.navbar-nav .nav-link.active {
  color: var(--primary-light) !important;
  background-color: rgba(59, 130, 246, 0.2);
}

.theme-toggle {
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  color: var(--nav-text) !important;
  transition: all var(--transition-base);
}

.theme-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  color: var(--nav-text) !important;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-section) 100%);
  padding-top: 120px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-graphic {
  text-align: center;
  padding: 2rem;
}

.hero-icon {
  font-size: 8rem;
  color: var(--primary-color);
  opacity: 0.8;
  animation: float 3s ease-in-out infinite;
}

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

/* Animated Background Gadgets */
.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse at center, 
    rgba(59, 130, 246, 0.08) 0%, 
    rgba(37, 99, 235, 0.04) 40%, 
    transparent 70%);
}

.gadget-animation {
  position: relative;
  width: 100%;
  height: 100%;
}

.gadget-image {
  position: absolute;
  opacity: 0;
  left: var(--x);
  top: var(--y);
  animation: gadgetPulse 8s infinite, subtleGlow 3s ease-in-out infinite;
  animation-delay: var(--delay);
  transform: scale(0.8);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4), 0 0 20px rgba(59, 130, 246, 0.3);
  backdrop-filter: blur(1px);
  filter: brightness(1.1) contrast(1.1);
}

/* Smartphone */
.smartphone {
  width: 60px;
  height: 100px;
  background: linear-gradient(145deg, #1f2937, #374151);
  border: 3px solid var(--primary-color);
  border-radius: 16px;
  box-shadow: inset 0 2px 4px rgba(59, 130, 246, 0.3);
}
.smartphone::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 20px;
  background: linear-gradient(145deg, #3b82f6, #60a5fa);
  border-radius: 8px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}
.smartphone::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 15px;
  height: 3px;
  background: var(--primary-light);
  border-radius: 2px;
}

/* Laptop */
.laptop {
  width: 80px;
  height: 55px;
  background: linear-gradient(145deg, #374151, #4b5563);
  border-radius: 6px;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.laptop::before {
  content: '';
  position: absolute;
  top: -25px;
  left: 2px;
  right: 2px;
  height: 30px;
  background: linear-gradient(145deg, #1f2937, #374151);
  border: 2px solid var(--primary-color);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
}
.laptop::after {
  content: '';
  position: absolute;
  top: -24px;
  left: 12px;
  right: 12px;
  height: 20px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 4px;
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.1);
}

/* Tablet */
.tablet {
  width: 70px;
  height: 90px;
  background: linear-gradient(145deg, #1f2937, #374151);
  border: 3px solid var(--primary-color);
  border-radius: 12px;
  box-shadow: inset 0 2px 4px rgba(59, 130, 246, 0.3);
}
.tablet::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 6px;
  right: 6px;
  bottom: 12px;
  background: linear-gradient(145deg, var(--primary-color), var(--primary-light));
  border-radius: 3px;
}
.tablet::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 3px;
  background: var(--primary-light);
  border-radius: 2px;
}

/* Smartwatch */
.smartwatch {
  width: 50px;
  height: 50px;
  background: linear-gradient(145deg, #1f2937, #374151);
  border: 3px solid var(--primary-color);
  border-radius: 12px;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(59, 130, 246, 0.3);
}
.smartwatch::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  background: var(--primary-color);
  border-radius: 4px;
}
.smartwatch::after {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 4px;
  background: #4b5563;
  border-radius: 2px;
  box-shadow: 0 46px 0 #4b5563;
}

/* Headphones */
.headphones {
  width: 70px;
  height: 65px;
  position: relative;
}
.headphones::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 35px;
  height: 20px;
  border: 3px solid var(--primary-color);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
}
.headphones::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 18px;
  height: 25px;
  background: linear-gradient(145deg, #1f2937, #374151);
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  box-shadow: 30px 0 0 -2px var(--primary-color), 28px 0 0 0 linear-gradient(145deg, #1f2937, #374151);
}

/* Gamepad */
.gamepad {
  width: 75px;
  height: 50px;
  background: linear-gradient(145deg, #1f2937, #374151);
  border: 3px solid var(--primary-color);
  border-radius: 20px;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(59, 130, 246, 0.3);
}
.gamepad::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 12px;
  width: 8px;
  height: 3px;
  background: var(--primary-color);
  box-shadow: 0 6px 0 var(--primary-color), 25px -3px 0 var(--primary-color), 25px 3px 0 var(--primary-color);
}
.gamepad::after {
  content: '';
  position: absolute;
  top: -8px;
  left: 8px;
  width: 12px;
  height: 8px;
  background: #4b5563;
  border-radius: 4px 4px 0 0;
  box-shadow: 25px 0 0 #4b5563;
}

/* Camera */
.camera {
  width: 70px;
  height: 50px;
  background: linear-gradient(145deg, #1f2937, #374151);
  border: 3px solid var(--primary-color);
  border-radius: 12px;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(59, 130, 246, 0.3);
}
.camera::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 15px;
  width: 20px;
  height: 8px;
  background: #4b5563;
  border-radius: 4px 4px 0 0;
}
.camera::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border: 3px solid var(--primary-color);
  border-radius: 50%;
  background: var(--primary-light);
}

/* Monitor */
.monitor {
  width: 75px;
  height: 50px;
  background: linear-gradient(145deg, #1f2937, #374151);
  border: 3px solid var(--primary-color);
  border-radius: 8px;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(59, 130, 246, 0.3);
}
.monitor::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 8px;
  background: var(--primary-color);
  border-radius: 2px;
}
.monitor::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 8px;
  background: #4b5563;
  border-radius: 0 0 4px 4px;
}

/* Speaker */
.speaker {
  width: 50px;
  height: 70px;
  background: linear-gradient(145deg, #1f2937, #374151);
  border: 3px solid var(--primary-color);
  border-radius: 12px;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(59, 130, 246, 0.3);
}
.speaker::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 15px;
  height: 15px;
  border: 2px solid var(--primary-color);
  border-radius: 50%;
  background: var(--primary-light);
}
.speaker::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 12px;
  border: 2px solid var(--primary-color);
  border-radius: 6px;
  background: var(--primary-color);
}

/* Drone */
.drone {
  width: 65px;
  height: 65px;
  position: relative;
}
.drone::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 20px;
  background: linear-gradient(145deg, #1f2937, #374151);
  border: 3px solid var(--primary-color);
  border-radius: 6px;
  box-shadow: inset 0 2px 4px rgba(59, 130, 246, 0.3);
}
.drone::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 10px;
  width: 14px;
  height: 14px;
  border: 3px solid var(--primary-color);
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.5);
  box-shadow: 35px 0 0 -3px var(--primary-color), 32px 0 0 0 rgba(59, 130, 246, 0.5),
              0 35px 0 -3px var(--primary-color), 0 32px 0 0 rgba(59, 130, 246, 0.5),
              35px 35px 0 -3px var(--primary-color), 32px 32px 0 0 rgba(59, 130, 246, 0.5);
}

/* Ensure hero content is above background */
.hero .container {
  position: relative;
  z-index: 2;
}

@keyframes gadgetPulse {
  0%, 90%, 100% {
    opacity: 0;
    transform: scale(0.7) rotate(0deg);
  }
  10%, 80% {
    opacity: 0.7;
    transform: scale(1.1) rotate(10deg);
    filter: brightness(1.3) contrast(1.2) drop-shadow(0 0 15px rgba(59, 130, 246, 0.6));
  }
  50% {
    opacity: 0.9;
    transform: scale(1.3) rotate(-10deg);
    filter: brightness(1.5) contrast(1.3) drop-shadow(0 0 25px rgba(59, 130, 246, 0.8));
  }
}

@keyframes subtleGlow {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4), 0 0 20px rgba(59, 130, 246, 0.3);
  }
  50% {
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.6), 0 0 30px rgba(59, 130, 246, 0.5);
  }
}

/* Page Header */
.page-header {
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-section) 100%);
  padding: 120px 0 80px;
}

.page-icon {
  font-size: 4rem;
  color: var(--primary-color);
  opacity: 0.8;
}

/* Sections */
.bg-section {
  background-color: var(--bg-section) !important;
}

/* Cards */
.card {
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  transition: all var(--transition-base);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg) !important;
}

/* Category Cards */
.category-card {
  transition: all var(--transition-slow);
  cursor: pointer;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg) !important;
}

.category-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  transition: all var(--transition-base);
}

.category-card:hover .category-icon {
  transform: scale(1.1);
  color: var(--primary-light);
}

/* Article Cards */
.article-card {
  transition: all var(--transition-base);
  overflow: hidden;
}

.article-card:hover {
  transform: translateY(-2px);
}

.article-image {
  height: 200px;
  background: linear-gradient(135deg, var(--bg-section) 0%, var(--border-color) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Override for individual article pages with actual images */
.article-image img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: cover;
  border-radius: 0.375rem;
}

/* Specific class for individual article pages - more reliable than :has() */
.article-page .article-image {
  height: auto;
  display: block;
  background: none;
  margin-bottom: 2rem;
}

/* Alternative: Reset article-image when it contains img for wider browser support */
.article-image.with-image {
  height: auto;
  display: block;
  background: none;
  margin-bottom: 2rem;
}

/* Fix for article-hero-image class on individual article pages */
.article-page .article-hero-image {
  height: auto;
  display: block;
  background: none;
  margin-bottom: 2rem;
  padding: 0;
}

.article-page .article-hero-image img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  border-radius: 0.375rem;
}

.placeholder-icon {
  font-size: 3rem;
  color: var(--text-muted);
  opacity: 0.5;
}

/* Popular Articles */
.popular-article {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.popular-article:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.popular-article h6 {
  font-size: 0.875rem;
  line-height: 1.4;
}

/* Buttons */
.btn {
  font-weight: 500;
  transition: all var(--transition-base);
  border-radius: 0.375rem;
}

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

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--nav-text);
}

/* Badges */
.badge {
  font-weight: 500;
  font-size: 0.75rem;
  padding: 0.4em 0.8em;
}

/* Forms */
.form-control,
.form-select {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  transition: all var(--transition-base);
}

.form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.form-control:focus,
.form-select:focus {
  background-color: var(--bg-card);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
  color: var(--text-primary);
}

.form-label {
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* Contact Form */
.contact-form .form-control,
.contact-form .form-select {
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}

.contact-info-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-light);
}

.contact-info-item:last-child {
  border-bottom: none;
}

/* Accordion */
.accordion-button {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: none;
  padding: 0.75rem 0;
  font-size: 0.875rem;
}

.accordion-button:not(.collapsed) {
  background-color: var(--bg-card);
  color: var(--primary-color);
  box-shadow: none;
}

.accordion-button:focus {
  box-shadow: none;
  border-color: transparent;
}

.accordion-body {
  padding: 0.5rem 0 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Footer */
footer {
  background-color: var(--nav-bg) !important;
}

footer h6 {
  color: var(--nav-text);
  font-weight: 600;
}

footer p,
footer small {
  color: var(--text-light);
}

.social-links a {
  transition: all var(--transition-base);
}

.social-links a:hover {
  transform: translateY(-2px);
  color: var(--primary-light) !important;
}

/* Stats */
.stats-item h4 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero {
    padding-top: 100px;
    min-height: 80vh;
  }
  
  .hero-icon {
    font-size: 4rem;
  }
  
  .gadget-image {
    transform: scale(0.6);
  }
  
  .page-header {
    padding: 100px 0 60px;
    text-align: center;
  }
  
  .page-icon {
    font-size: 3rem;
    margin-top: 1rem;
  }
  
  .display-4 {
    font-size: 2rem;
  }
  
  .category-icon {
    font-size: 2rem;
  }
  
  .article-image {
    height: 150px;
  }
  
  .placeholder-icon {
    font-size: 2rem;
  }
  
  .navbar-nav .nav-link {
    padding: 0.5rem 1rem !important;
  }
}

@media (max-width: 576px) {
  /* Base font size increase for mobile readability */
  body {
    font-size: 1.1rem;
  }
  
  .hero-icon {
    font-size: 3rem;
  }
  
  .display-4 {
    font-size: 2.25rem;
  }
  
  .lead {
    font-size: 1.25rem;
    line-height: 1.5;
  }
  
  /* Card titles and content */
  .card-title {
    font-size: 1.25rem;
  }
  
  .card-text {
    font-size: 1.05rem;
    line-height: 1.6;
  }
  
  /* Navigation links */
  .nav-link {
    font-size: 1.1rem;
  }
  
  /* Buttons */
  .btn {
    font-size: 1.05rem;
    padding: 0.6rem 1.2rem;
  }
  
  /* Form elements */
  .form-control, .form-select {
    font-size: 1.1rem;
    padding: 0.7rem;
  }
  
  /* Footer text */
  footer p, footer li {
    font-size: 1rem;
  }
  
  /* Small text elements */
  small, .small {
    font-size: 0.9rem;
  }
  
  .category-icon {
    font-size: 1.75rem;
  }
  
  .page-icon {
    font-size: 2.5rem;
  }
  
  .gadget-image {
    transform: scale(0.5);
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus styles for accessibility */
.btn:focus,
.nav-link:focus,
.form-control:focus,
.form-select:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Loading animation */
.loading {
  opacity: 0;
  animation: fadeIn 0.5s ease-in-out forwards;
}

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

/* Print styles */
@media print {
  .navbar,
  .theme-toggle,
  footer {
    display: none;
  }
  
  .page-header {
    padding: 2rem 0;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .card {
    border: 1px solid #ddd;
    box-shadow: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
    --text-muted: #000000;
  }
  
  [data-theme="dark"] {
    --border-color: #ffffff;
    --text-muted: #ffffff;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Deal card styles */
.deal-card {
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.deal-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}

[data-theme="dark"] .deal-card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4) !important;
}

.deal-image {
  height: 200px;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-section));
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem 0.375rem 0 0;
  color: var(--text-muted);
}

.featured-deal .deal-image {
  height: 100%;
  border-radius: 0.375rem 0 0 0.375rem;
}

.price-section {
  padding: 0.5rem 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.current-price {
  font-weight: bold;
  color: var(--text-primary) !important;
}

.original-price {
  text-decoration: line-through;
  font-size: 0.9em;
}

.hot-deal {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-light);
}

.hot-deal:last-child {
  border-bottom: none;
}

.deal-timer {
  font-weight: 500;
}

.featured-deal {
  border: 2px solid var(--primary-color) !important;
}

@media (max-width: 768px) {
  .deal-image {
    height: 150px;
  }
  
  .current-price {
    font-size: 1.1rem !important;
  }
}

/* Article page styles */
.article-hero-image {
  height: 300px;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-section));
  border-radius: 0.375rem;
  margin-bottom: 2rem;
  color: var(--text-muted);
}

.article-content {
  font-size: 1.1rem;
  line-height: 1.7;
}

.article-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 0.5rem;
}

.article-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.article-content p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.article-content ul, 
.article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

.article-content li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.article-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.article-footer {
  background-color: var(--bg-secondary);
  border-radius: 0.375rem;
  padding: 1.5rem;
  margin-top: 3rem;
}

.social-share .btn {
  margin-right: 0.5rem;
}

.breadcrumb {
  background-color: transparent;
  padding: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: var(--text-muted);
}

.breadcrumb-item a {
  color: var(--primary-color);
  text-decoration: none;
}

.breadcrumb-item.active {
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .article-hero-image {
    height: 200px;
  }
  
  .article-content {
    font-size: 1.125rem;
    line-height: 1.7;
  }
  
  .article-content h1 {
    font-size: 2rem;
  }
  
  .article-content h2 {
    font-size: 1.75rem;
  }
  
  .article-content h3 {
    font-size: 1.5rem;
  }
  
  .article-content p {
    font-size: 1.125rem;
    margin-bottom: 1.25rem;
  }
  
  .article-footer {
    padding: 1rem;
  }
  
  .social-share .btn {
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
  }
}

/* Advertisement Spaces */
.ad-banner {
  background-color: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 1.5rem 0;
  position: relative;
  overflow: hidden;
}

.ad-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    var(--border-light) 10px,
    var(--border-light) 11px
  );
  opacity: 0.1;
}

.ad-banner-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1rem;
}

/* Standard Ad Sizes */
.ad-leaderboard {
  height: 90px;
  max-width: 728px;
  margin: 0 auto;
}

.ad-rectangle {
  height: 250px;
  width: 300px;
  margin: 1rem auto;
}

.ad-sidebar {
  height: 250px;
  width: 100%;
  max-width: 300px;
}

.ad-mobile-banner {
  height: 50px;
  max-width: 320px;
  margin: 0 auto;
}

.ad-square {
  height: 250px;
  width: 250px;
  margin: 1rem auto;
}

.ad-skyscraper {
  height: 600px;
  width: 160px;
  margin: 1rem auto;
}

/* In-content ads */
.ad-in-content {
  margin: 2rem 0;
  clear: both;
}

/* Responsive ad behavior */
@media (max-width: 768px) {
  .ad-leaderboard {
    display: none;
  }
  
  .ad-mobile-banner {
    display: block;
  }
  
  .ad-rectangle,
  .ad-sidebar {
    width: 100%;
    max-width: 300px;
    height: 250px;
  }
  
  .ad-skyscraper {
    display: none;
  }
}

@media (min-width: 769px) {
  .ad-mobile-banner {
    display: none;
  }
  
  .ad-leaderboard {
    display: flex;
  }
}

/* Sticky sidebar ads */
.ad-sticky {
  position: sticky;
  top: 100px;
}

/* Ad labels */
.ad-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  text-align: center;
}

/* Hide ads in print */
@media print {
  .ad-banner {
    display: none !important;
  }
}
