/* ============================================================
   GREEN THEME & DARK/LIGHT MODE SUPPORT
   ============================================================ */

/* --- CSS Variables for Theme --- */
:root {
  --bg-primary: #0a1e1a;
  --bg-secondary: #0d2823;
  --text-primary: #e8f5f1;
  --text-secondary: #a0c4ba;
  --text-muted: #6b8f82;
  --primary: #10b981;
  --primary-light: #34d399;
  --primary-dark: #059669;
  --accent: #3b82f6;
  --border: rgba(16, 185, 129, 0.1);
  --card-bg: rgba(13, 40, 35, 0.7);
  --orb-1: #047857;
  --orb-2: #10b981;
  --orb-3: #6366f1;
  --muted: #6b8f82;
  --logo-watermark-opacity: 0.28;
  --logo-watermark-outline: rgba(16, 185, 129, 0.42);
  --logo-watermark-glow: rgba(16, 185, 129, 0.16);
}

body.light-mode {
  --bg-primary: #f0fdf4;
  --bg-secondary: #dcfce7;
  --text-primary: #064e3b;
  --text-secondary: #065f46;
  --text-muted: #10b981;
  --primary: #059669;
  --primary-light: #10b981;
  --primary-dark: #047857;
  --accent: #3b82f6;
  --border: rgba(16, 185, 129, 0.2);
  --card-bg: rgba(255, 255, 255, 0.9);
  --orb-1: #86efac;
  --orb-2: #6ee7b7;
  --orb-3: #a5b4fc;
  --muted: #10b981;
  --logo-watermark-opacity: 0.24;
  --logo-watermark-outline: rgba(5, 150, 105, 0.34);
  --logo-watermark-glow: rgba(5, 150, 105, 0.12);
}

/* Override base styles with theme variables */
body {
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-color: rgba(16, 185, 129, 0.01);
  -webkit-mask-image: url('../images/tlogo.png');
  mask-image: url('../images/tlogo.png');
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: clamp(260px, 38vw, 560px);
  mask-size: clamp(260px, 38vw, 560px);
  opacity: var(--logo-watermark-opacity);
  filter:
    drop-shadow(0 0 0 var(--logo-watermark-outline))
    drop-shadow(1px 0 0 var(--logo-watermark-outline))
    drop-shadow(-1px 0 0 var(--logo-watermark-outline))
    drop-shadow(0 1px 0 var(--logo-watermark-outline))
    drop-shadow(0 -1px 0 var(--logo-watermark-outline))
    drop-shadow(0 0 14px var(--logo-watermark-glow));
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary) !important;
}

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

body.light-mode p {
  color: var(--text-primary) !important;
}

body.light-mode .text-muted {
  color: var(--text-muted) !important;
}

body.light-mode footer,
body.light-mode .footer-section {
  background: rgba(255, 255, 255, 0.95) !important;
  color: var(--text-primary) !important;
}

.text-gradient {
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 50%, #0891b2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Button overrides */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
  box-shadow: 0 4px 24px rgba(16,185,129,.3) !important;
}

.btn-primary:hover {
  box-shadow: 0 8px 32px rgba(16,185,129,.45) !important;
}

.btn-outline {
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
}

.btn-outline:hover {
  border-color: var(--primary) !important;
  background: rgba(16,185,129,.06) !important;
}

.btn-ghost {
  background: rgba(16,185,129,.04) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border) !important;
}

.btn-ghost:hover {
  background: rgba(16,185,129,.08) !important;
  color: var(--text-primary) !important;
  border-color: var(--primary) !important;
}

/* Background orbs with theme */
.bg-glow .orb {
  transition: background 0.5s ease;
}

.bg-glow .orb:nth-child(1) {
  background: radial-gradient(circle, var(--orb-1) 0%, transparent 70%) !important;
}

.bg-glow .orb:nth-child(2) {
  background: radial-gradient(circle, var(--orb-2) 0%, transparent 70%) !important;
}

.bg-glow .orb:nth-child(3) {
  background: radial-gradient(circle, var(--orb-3) 0%, transparent 70%) !important;
}

/* Theme Toggle Button */
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-right: 8px;
}

.theme-toggle:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.22);
}

.theme-toggle-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.theme-toggle.rotating .theme-toggle-icon {
  transform: rotate(360deg);
}

/* FAQ Accordion Styles */
.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 14px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.faq-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.1);
}

.faq-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.faq-toggle:hover {
  background: rgba(16, 185, 129, 0.05);
}

.faq-title {
  flex: 1;
}

.faq-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  stroke: var(--primary);
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 22px;
}

.faq-item.open .faq-content {
  max-height: 1000px;
  padding: 0 22px 20px;
}

.faq-content p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.faq-content a {
  color: var(--primary);
  text-decoration: underline;
  transition: color 0.2s ease;
}

.faq-content a:hover {
  color: var(--primary-light);
}

.faq-content ul {
  list-style: disc;
  padding-left: 1.5rem;
  line-height: 1.9;
}

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

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

/* Card styling fixes for theme */
.content-card, .feature-card, .product-card {
  background: var(--card-bg) !important;
  border-color: var(--border) !important;
}

.content-card:hover, .feature-card:hover {
  border-color: var(--primary) !important;
}

/* Navigation updates for checkout page */
.nav-cta {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Light mode specific adjustments */
body.light-mode {
  --bg-primary: #f0fdf4;
}

body.light-mode .bg-glow .orb {
  opacity: 0.2;
}

body.light-mode::before {
  background-image: 
    linear-gradient(rgba(16, 185, 129, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 185, 129, 0.03) 1px, transparent 1px);
}

body.light-mode::after {
  filter:
    drop-shadow(0 0 0 var(--logo-watermark-outline))
    drop-shadow(1px 0 0 var(--logo-watermark-outline))
    drop-shadow(-1px 0 0 var(--logo-watermark-outline))
    drop-shadow(0 1px 0 var(--logo-watermark-outline))
    drop-shadow(0 -1px 0 var(--logo-watermark-outline))
    drop-shadow(0 0 12px var(--logo-watermark-glow));
}

body.light-mode .site-header.scrolled {
  background: rgba(240, 253, 244, 0.88);
  border-bottom: 1px solid rgba(16, 185, 129, 0.1);
}

body.light-mode .nav-links > a:hover,
body.light-mode .nav-dropdown > button:hover,
body.light-mode .nav-links > a.active {
  background: rgba(16, 185, 129, 0.08);
}

body.light-mode .dropdown-panel {
  background: rgba(240, 253, 244, 0.97);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

body.light-mode .nav-icon-btn {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.04));
  border-color: rgba(16, 185, 129, 0.2);
}

body.light-mode .nav-icon-btn:hover {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.15));
  border-color: var(--primary);
}

body.light-mode .cart-popup {
  background: linear-gradient(180deg, rgba(240, 253, 244, 0.97), rgba(220, 252, 231, 0.98));
  border-color: rgba(16, 185, 129, 0.2);
}

body.light-mode .cart-preview-item {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.1);
}
