/**
 * Dark/Light Mode Theme Toggle
 * Modern theme switching with smooth transitions
 */

/* CSS Variables for Theme Colors */
:root {
  /* Light Mode (Default) */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f7fa;
  --bg-gradient-start: #f5f7fa;
  --bg-gradient-end: #e8eef5;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border-color: #e0e0e0;
  --card-bg: #ffffff;
  --card-shadow: rgba(0, 0, 0, 0.1);
  --overlay-bg: rgba(0, 0, 0, 0.5);
  --navbar-bg: rgba(255, 255, 255, 0.95);
  --navbar-shadow: rgba(0, 0, 0, 0.1);
  --footer-bg-start: #f5f5f5;
  --footer-bg-end: #e8e8e8;
  --icon-border-bg: rgba(255, 105, 180, 0.1);
  --pattern-opacity: 0.03;
}

/* Dark Mode */
[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --bg-gradient-start: #1a1a1a;
  --bg-gradient-end: #2d2d2d;
  --text-primary: #e0e0e0;
  --text-secondary: #b0b0b0;
  --text-muted: #808080;
  --border-color: #404040;
  --card-bg: #2d2d2d;
  --card-shadow: rgba(0, 0, 0, 0.3);
  --overlay-bg: rgba(0, 0, 0, 0.7);
  --navbar-bg: rgba(26, 26, 26, 0.95);
  --navbar-shadow: rgba(0, 0, 0, 0.3);
  --footer-bg-start: #2d2d2d;
  --footer-bg-end: #1a1a1a;
  --icon-border-bg: rgba(255, 105, 180, 0.2);
  --pattern-opacity: 0.05;
}

/* Theme Toggle Button */
.theme-toggle {
  position: relative;
  width: 60px;
  height: 30px;
  background: var(--border-color);
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  padding: 3px;
  margin-left: 15px;
}

.theme-toggle:hover {
  background: #ff69b4;
}

.theme-toggle-slider {
  position: absolute;
  width: 24px;
  height: 24px;
  background: #ffffff;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  left: 3px;
}

[data-theme="dark"] .theme-toggle-slider {
  left: 33px;
}

.theme-toggle-icon {
  font-size: 12px;
  color: #ff69b4;
  transition: all 0.3s ease;
}

/* Sun Icon (Light Mode) */
.theme-toggle-icon.sun {
  display: block;
}

[data-theme="dark"] .theme-toggle-icon.sun {
  display: none;
}

/* Moon Icon (Dark Mode) */
.theme-toggle-icon.moon {
  display: none;
}

[data-theme="dark"] .theme-toggle-icon.moon {
  display: block;
}

/* Smooth Transitions for Theme Changes */
body,
.navbar,
.banner,
.feature,
.about,
.team,
.faq,
.updates-section,
.photo-gallery,
.footer,
.card,
.icon-box,
.team-detail,
.faq-item,
.update-card,
.gallery-album-card,
.mcstatus-card {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .theme-toggle {
    width: 50px;
    height: 26px;
    margin-left: 10px;
  }
  
  .theme-toggle-slider {
    width: 20px;
    height: 20px;
  }
  
  [data-theme="dark"] .theme-toggle-slider {
    left: 27px;
  }
  
  .theme-toggle-icon {
    font-size: 10px;
  }
}

/* Navbar in Mobile Dark Mode */
@media (max-width: 991px) {
  [data-theme="dark"] .navbar-collapse.show {
    background: var(--navbar-bg);
    backdrop-filter: blur(20px) saturate(180%);
  }
}
