/* theme.css - Centralized Semantic Theme Variables */

:root {
  /* Brand Colors (Static across themes) */
  --brand-primary: #94cf14;
  --brand-primary-hover: #b8e946;
  --brand-primary-dark: #62890d;

  --text-brand: var(--brand-primary);

  /* Backgrounds */
  --bg-body: #0d1114;
  --bg-surface: #141a1e;
  --bg-surface-hover: #11171b;
  --bg-surface-alt: #10161a;
  --bg-card: #171b1e;
  --bg-panel: #22282d;
  
  /* Text */
  --text-primary: #ffffff;
  --text-secondary: #c6ced3;
  --text-muted: #8b95a0;
  --text-faded: #8b949e;
  --text-inverse: #0d1114; /* Dark text for light elements */
  
  --text-primary-rgb: 255, 255, 255;
  --bg-menu-rgb: 20, 26, 30;
  
  /* Borders */
  --border-light: #22282d;
  --border-main: #30383f;
  --border-heavy: #3c4750;

  /* Overlays */
  --overlay-bg: rgba(0, 0, 0, 0.5);
  --shadow-color: 0, 0, 0;
  --shadow-color-rgb: 0, 0, 0;

  /* Miscellaneous */
  --icon-color: #ffffff;
}

[data-theme="light"] {
  /* Backgrounds */
  --bg-body: #f8f9fa;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f1f3f5;
  --bg-surface-alt: #e9ecef;
  --bg-card: #ffffff;
  --bg-panel: #e9ecef;
  
  --text-brand: var(--brand-primary-dark);
  
  /* Text */
  --text-primary: #1e262c;
  --text-secondary: #495057;
  --text-muted: #495057;
  --text-faded: #6c757d;
  --text-inverse: #ffffff; /* White text for dark elements */

  --text-primary-rgb: 30, 38, 44;
  --bg-menu-rgb: 255, 255, 255;
  
  /* Borders */
  --border-light: #f1f3f5;
  --border-main: #dee2e6;
  --border-heavy: #ced4da;

  /* Overlays */
  --overlay-bg: rgba(255, 255, 255, 0.5);
  --shadow-color: 0, 0, 0; /* Still use black for shadows, but maybe lighter opacity */
  --shadow-color-rgb: 0, 0, 0;

  --icon-color: #1e262c;
}

/* Theme Toggle Button Pill Styles */
.theme-toggle-btn, .theme-icon-wrapper {
  position: relative;
  width: 68px;
  height: 34px;
  border-radius: 30px;
  background: #343a40;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  cursor: pointer;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
  transition: background 0.3s, box-shadow 0.3s;
}

.theme-toggle-btn svg, .theme-icon-wrapper svg {
  width: 16px;
  height: 16px;
  z-index: 1;
  transition: opacity 0.3s, color 0.3s;
}

/* Light Mode Background */
[data-theme='light'] .theme-toggle-btn, [data-theme='light'] .theme-icon-wrapper {
  background: #ffffff;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1), 0 0 0 2px #e9ecef;
}

/* Thumb */
.theme-toggle-thumb {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  z-index: 2;
  transition: left 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), background 0.3s, border 0.3s;
}

/* Dark Mode State */
.theme-toggle-thumb {
  left: 4px;
  background: transparent;
  border: 2px solid #ffffff;
}
.sun-icon { opacity: 0; }
.moon-icon { color: #ffffff; opacity: 1; }

/* Light Mode State */
[data-theme='light'] .theme-toggle-thumb {
  left: calc(100% - 30px);
  background: rgba(148, 207, 20, 0.2);
  border: 2px solid var(--brand-primary);
}
[data-theme='light'] .sun-icon {
  color: var(--brand-primary-dark);
  opacity: 1;
}
[data-theme='light'] .moon-icon {
  opacity: 0;
}

.mobile-theme-toggle {
  padding: 15px 20px;
  border-top: 1px solid var(--border-light);
  margin-top: 10px;
}
.mobile-theme-toggle .theme-toggle-btn {
  width: 100%;
  justify-content: space-between;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.mobile-theme-toggle .theme-label {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Fix for Bootstrap dark backgrounds to retain white text in light mode */
.text-bg-dark, .bg-dark,
.text-bg-dark h1, .text-bg-dark h2, .text-bg-dark h3, .text-bg-dark h4, .text-bg-dark h5, .text-bg-dark h6, .text-bg-dark p, .text-bg-dark span,
.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4, .bg-dark h5, .bg-dark h6, .bg-dark p, .bg-dark span {
  color: #ffffff !important;
}

[data-theme="light"] .pages__head.black-bg {
    background-color: #F8F9FA !important;
}
[data-theme="light"] .pages__head.black-bg:before {
    display: none !important;
}

[data-theme="light"] .hero-section {
    background: #F8F9FA !important;
}

/* Logo Theme Switching */
.logo-light-mode {
    display: none !important;
}
[data-theme="light"] .logo-light-mode {
    display: inline-block !important;
}
[data-theme="light"] .logo-dark-mode {
    display: none !important;
}

/* Scroll to Top Button */
.scroll-to-top {
  position: fixed;
  bottom: 45px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-hover));
  color: #11171b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(148, 207, 20, 0.4);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s, box-shadow 0.3s;
  border: none;
}

.scroll-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  box-shadow: 0 6px 20px rgba(148, 207, 20, 0.6);
  transform: translateY(-3px);
  color: #11171b;
}

.scroll-to-top:active {
  transform: translateY(-8px);
}

@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 35px;
    right: 20px;
    width: 44px;
    height: 44px;
    font-size: 20px;
  }
}

/* Light Mode Team Page Gradients */
[data-theme='light'] .tm-profile-card__image-placeholder,
[data-theme='light'] .tm-expert-card__avatar {
    background: linear-gradient(135deg, rgba(148, 207, 20, 0.15), rgba(20, 26, 30, 0.05)) !important;
}
[data-theme='light'] .tm-flexible__illustration {
    background: linear-gradient(145deg, rgba(148, 207, 20, 0.08), rgba(20, 26, 30, 0.05)) !important;
}
[data-theme='light'] .tm-stats {
    background: linear-gradient(135deg, rgba(148, 207, 20, 0.06), rgba(20, 26, 30, 0.05)) !important;
}
