/* dark-theme.css - Main dark theme file with all common styles */

:root {
  /* Light theme variables (your current theme) */
  --primary-shadow: 0 2px 4px rgba(0,0,0,0.1);
  --secondary-shadow: 0 1px 3px rgba(0,0,0,0.1);
  --border-radius: 8px;
  --bg-light: #f8f9fa;
  --bg-white: #ffffff;
  --text-muted: #7f8c8d;
  --text-dark: #2c3e50;
  --border-light: #dee2e6;
}

/* Dark theme variables */
[data-theme="dark"] {
  --primary-shadow: 0 2px 4px rgba(0,0,0,0.4);
  --secondary-shadow: 0 1px 3px rgba(0,0,0,0.35);
  --bg-light: #1e2a38;  /* Slightly darker and more blue-tinted than before */
  --bg-white: #121212;  /* Darker background for better contrast */
  --text-muted: #a0aec0;
  --text-dark: #e2e8f0;  /* Slightly off-white for less eye strain */
  --border-light: #4a5568;
  
  /* Override Bootstrap colors for dark theme */
  --bs-body-bg: #121212;
  --bs-body-color: #e2e8f0;
  
  /* Component-specific colors */
  --widget-bg: #263242;  /* Slightly lighter than main background for widgets */
  --calendar-highlight: #3a4a5e;
  --primary-button: #2d87c8;
  --primary-button-hover: #1e6ea8;
  --secondary-button: #586c85;
  --secondary-button-hover: #455971;
  --input-bg: #1e2a38;
  --input-border: #4a5568;
  --link-color: #63b3ed;
  --link-hover: #90cdf4;
  --danger-color: #e53e3e;
  --success-color: #38a169;
  --warning-color: #ed8936;
  --info-color: #4299e1;
}

/* Add smooth transitions for theme switching */
*, *::before, *::after {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Apply theme colors to elements */
[data-theme="dark"] body {
  background-color: var(--bg-light);
  color: var(--text-dark);
}

/* ===== LAYOUT STRUCTURE ===== */
[data-theme="dark"] .header-area,
[data-theme="dark"] .left-sidebar,
[data-theme="dark"] .main-content,
[data-theme="dark"] .right-sidebar {
  background-color: var(--bg-white);
  color: var(--text-dark);
  box-shadow: var(--primary-shadow);
}

/* Footer gets its own specific styling */
[data-theme="dark"] .footer-area {
  color: var(--text-dark);
  box-shadow: var(--primary-shadow);
}

/* ===== COMMON ELEMENTS ===== */

/* Common Card styling */
[data-theme="dark"] .card,
[data-theme="dark"] .sign-in-card,
[data-theme="dark"] .feature-card {
  background-color: var(--widget-bg);
  box-shadow: var(--secondary-shadow);
  border: 1px solid var(--border-light);
}

[data-theme="dark"] .card-title {
  color: var(--text-dark);
}

[data-theme="dark"] .card-body p {
  color: var(--text-muted);
}

/* Mini Subtitle Cards */
[data-theme="dark"] .mini-subtitle-card {
  background: var(--widget-bg);
  border: 1px solid var(--border-light);
  box-shadow: var(--secondary-shadow);
  color: var(--text-dark);
}

[data-theme="dark"] .mini-subtitle-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.5);
  color: var(--text-dark);
}

[data-theme="dark"] .no-poster-mini {
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--border-light) 100%);
  color: var(--text-muted);
}

[data-theme="dark"] .mini-title {
  color: var(--text-dark);
}

[data-theme="dark"] .mini-type-year,
[data-theme="dark"] .mini-type,
[data-theme="dark"] .mini-year {
  color: var(--text-muted);
}

[data-theme="dark"] .episode-info {
  background: linear-gradient(135deg, #4a90e2 0%, #6a5acd 100%);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

[data-theme="dark"] .mini-stats,
[data-theme="dark"] .mini-downloads,
[data-theme="dark"] .mini-rating {
  color: var(--text-muted);
}

[data-theme="dark"] .mini-rating i.fas.fa-star {
  color: #ffc107 !important;
}

/* Add subtle glow effect to feature cards on hover */  
[data-theme="dark"] .feature-card:hover .feature-icon {  
  text-shadow: 0 0 15px rgba(99, 179, 237, 0.8);  
}

/* Common container styling */
[data-theme="dark"] .container.py-4 {
  background-color: transparent;
}

/* Common link styles */
[data-theme="dark"] a {
  color: var(--link-color);
}

[data-theme="dark"] a:hover {
  color: var(--link-hover);
}

[data-theme="dark"] .text-decoration-none {
  color: var(--link-color);
}

[data-theme="dark"] .text-decoration-none:hover {
  color: var(--link-hover);
}

/* ===== BUTTONS ===== */

/* Common Button styles */
[data-theme="dark"] .btn-primary {
  background-color: var(--primary-button);
  border-color: var(--primary-button);
}

[data-theme="dark"] .btn-primary:hover {
  background-color: var(--primary-button-hover);
  border-color: var(--primary-button-hover);
  color: #ffffff;
}

[data-theme="dark"] .btn-secondary {
  background-color: var(--secondary-button);
  border-color: var(--secondary-button);
}

[data-theme="dark"] .btn-secondary:hover {
  background-color: var(--secondary-button-hover);
  border-color: var(--secondary-button-hover);
  color: #ffffff;
}

[data-theme="dark"] .btn-success {
  background-color: var(--success-color);
  border-color: var(--success-color);
}

[data-theme="dark"] .btn-success:hover {
  background-color: #218838;
  border-color: #1e7e34;
  color: #ffffff;
}

[data-theme="dark"] .btn-danger {
  background-color: var(--danger-color);
  border-color: var(--danger-color);
}

[data-theme="dark"] .btn-danger:hover {
  background-color: #c82333;
  border-color: #bd2130;
  color: #ffffff;
}

[data-theme="dark"] .btn-warning {
  background-color: var(--warning-color);
  border-color: var(--warning-color);
}

[data-theme="dark"] .btn-warning:hover {
  background-color: #e0a800;
  border-color: #d39e00;
  color: #ffffff;
}

[data-theme="dark"] .btn-info {
  background-color: var(--info-color);
  border-color: var(--info-color);
}

[data-theme="dark"] .btn-info:hover {
  background-color: #117a8b;
  border-color: #10707f;
  color: #ffffff;
}

/* Browse and Login buttons in subtitles section */
[data-theme="dark"] .btn-outline-secondary {
  background-color: transparent;
  border-color: var(--border-light);
  color: var(--text-dark);
}

[data-theme="dark"] .btn-outline-secondary:hover {
  background-color: var(--secondary-button);
  border-color: var(--secondary-button);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(99, 179, 237, 0.6);
}

/* Ensure all buttons have white text in dark mode */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .btn-success,
[data-theme="dark"] .btn-danger,
[data-theme="dark"] .btn-warning,
[data-theme="dark"] .btn-info {
  color: #ffffff !important;
}

/* Target all button sizes */
[data-theme="dark"] .btn-sm,
[data-theme="dark"] .btn-lg,
[data-theme="dark"] .btn-md {
  color: #ffffff;
}

/* Add subtle glow to buttons in dark mode */
[data-theme="dark"] .btn {
  box-shadow: 0 0 8px rgba(99, 179, 237, 0.4);
  transition: all 0.3s ease;
}

[data-theme="dark"] .btn:hover {
  box-shadow: 0 0 12px rgba(99, 179, 237, 0.6);
}

/* ===== FORMS ===== */

/* Common form styles */
[data-theme="dark"] .form-label {
  color: var(--text-dark);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-dark);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
  box-shadow: 0 0 0 0.25rem rgba(99, 179, 237, 0.25);
  border-color: var(--link-color);
}

[data-theme="dark"] .form-control::placeholder {
  color: rgba(180, 180, 180, 0.8);
  opacity: 0.7;
}

/* ===== ALERTS ===== */

/* Alert styling for dark theme */
[data-theme="dark"] .alert-primary {
  background-color: rgba(45, 135, 200, 0.2);
  border-color: rgba(45, 135, 200, 0.3);
  color: #e2e8f0;
}

[data-theme="dark"] .alert-secondary {
  background-color: rgba(88, 108, 133, 0.2);
  border-color: rgba(88, 108, 133, 0.3);
  color: #e2e8f0;
}

[data-theme="dark"] .alert-success {
  background-color: rgba(56, 161, 105, 0.2);
  border-color: rgba(56, 161, 105, 0.3);
  color: #e2e8f0;
}

[data-theme="dark"] .alert-danger {
  background-color: rgba(229, 62, 62, 0.2);
  border-color: rgba(229, 62, 62, 0.3);
  color: #e2e8f0;
}

[data-theme="dark"] .alert-warning {
  background-color: rgba(237, 137, 54, 0.2);
  border-color: rgba(237, 137, 54, 0.3);
  color: #e2e8f0;
}

[data-theme="dark"] .alert-info {
  background-color: rgba(66, 153, 225, 0.2);
  border-color: rgba(66, 153, 225, 0.3);
  color: #e2e8f0;
}

/* ===== TEXT COLORS ===== */

[data-theme="dark"] .text-danger {
  color: var(--danger-color) !important;
}

[data-theme="dark"] .text-success {
  color: var(--success-color) !important;
}

/* ===== HEADER ===== */

/* Welcome section styling */
[data-theme="dark"] .welcome-section {
  background-color: var(--widget-bg);
  box-shadow: var(--secondary-shadow);
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  padding: 2rem;
}

[data-theme="dark"] .index-welcome-heading {
  color: var(--text-dark);
}

[data-theme="dark"] .welcome-text {
  color: var(--text-muted);
}

/* Header content specifics */
[data-theme="dark"] .header-welcome-heading {
  color: var(--text-dark);
}

[data-theme="dark"] .welcome-subtext {
  color: var(--text-muted);
}

/* Header right section styling */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px; /* Space between elements */
}

/* Ensure proper alignment */
.profile-container, .language-switcher-container, .theme-switch-wrapper {
  display: flex;
  align-items: center;
}

/* Profile area */
[data-theme="dark"] .profile-container {
  background-color: var(--widget-bg);
}

/* Language switcher */
[data-theme="dark"] .language-switcher-container {
  background-color: var(--widget-bg);
}

/* ===== THEME SWITCH ===== */

/* Theme switch styling - enhanced */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
  padding: 5px;
  background-color: transparent;
  box-shadow: none;
  margin: 0;
  width: fit-content;
}

.theme-switch {
  display: inline-block;
  position: relative;
  width: 50px;
  height: 28px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2d87c8;
}

input:focus + .slider {
  box-shadow: 0 0 1px #2d87c8;
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.slider-icons {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
  pointer-events: none;
}

[data-theme="dark"] .slider-icons {
  color: #e2e8f0;
}

.sun-icon, .moon-icon {
  font-size: 0.875rem;
  color: #f8f9fa;
}

[data-theme="dark"] .moon-icon {
  color: #ffffff;
}

/* ===== WIDGETS ===== */

[data-theme="dark"] .weather-widget,
[data-theme="dark"] .calendar-widget,
[data-theme="dark"] .radio-widget,
[data-theme="dark"] .google-search-widget,
[data-theme="dark"] .currency-widget,
[data-theme="dark"] .rss-widget {
  background-color: var(--widget-bg);
  box-shadow: var(--secondary-shadow);
}

/* Weather widget specific styles */
[data-theme="dark"] .weather-city {
  color: var(--text-dark);
}

[data-theme="dark"] .weather-condition {
  color: var(--text-muted);
}

[data-theme="dark"] .humidity-info {
  color: var(--text-muted);
}

[data-theme="dark"] .humidity-icon {
  color: #4da3ff;
}

/* Calendar specific styles */
[data-theme="dark"] .calendar-header {
  color: var(--text-dark);
  border-bottom: 1px solid var(--border-light);
}

[data-theme="dark"] .calendar-table th {
  color: var(--text-muted);
}

[data-theme="dark"] .calendar-table .current-day {
  background-color: var(--calendar-highlight);
  color: #ffffff;
}

/* Radio widget specific styles */
[data-theme="dark"] .radio-header {
  border-bottom: 1px solid var(--border-light);
}

[data-theme="dark"] .radio-icon {
  color: #4da3ff;
}

[data-theme="dark"] .radio-title {
  color: var(--text-dark);
}

[data-theme="dark"] .radio-info {
  color: var(--text-muted);
}

[data-theme="dark"] .radio-control-button {
  color: var(--text-dark);
  background-color: var(--input-bg);
}

[data-theme="dark"] .radio-control-button:hover {
  background-color: var(--primary-button);
  color: #ffffff;
}

/* Google search widget */
[data-theme="dark"] .google-search-title {
  color: var(--text-dark);
}

[data-theme="dark"] .google-search-container .form-control::placeholder {
  color: #a0aec0;
  opacity: 0.7;
}

[data-theme="dark"] .google-search-container .form-control {
  color: var(--text-dark);
  background-color: var(--input-bg);
  border-color: var(--input-border);
}

[data-theme="dark"] .google-search-container .form-control:focus {
  border-color: var(--link-color);
  box-shadow: 0 0 0 0.2rem rgba(99, 179, 237, 0.25);
}

[data-theme="dark"] .google-search-container .input-group {
  box-shadow: var(--secondary-shadow);
}

/* Currency widget */
[data-theme="dark"] .currency-header {
  border-bottom: 1px solid var(--border-light);
}

[data-theme="dark"] .currency-title {
  color: var(--text-dark);
}

[data-theme="dark"] .currency-rate {
  color: var(--text-dark);
}

/* RSS widget */
[data-theme="dark"] .rss-header {
  border-bottom: 1px solid var(--border-light);
}

[data-theme="dark"] .rss-title {
  color: var(--text-dark);
}

[data-theme="dark"] .rss-item-date {
  color: var(--text-muted);
}

[data-theme="dark"] .rss-item-title {
  color: var(--link-color);
}

[data-theme="dark"] .rss-item-title:hover {
  color: var(--link-hover);
}

/* Online Users Widget - Dark Theme */
[data-theme="dark"] .online-users-widget {
  background-color: var(--widget-bg);
  box-shadow: var(--secondary-shadow);
  border-radius: 8px;
}

[data-theme="dark"] .online-users-widget-compact {
  background-color: var(--widget-bg);
  color: var(--text-dark);
}

[data-theme="dark"] .online-users-header {
  color: var(--text-dark);
  border-bottom: 1px solid var(--border-light);
}

[data-theme="dark"] .online-users-icon {
  color: #4da3ff;
}

[data-theme="dark"] .online-users-title {
  color: var(--text-dark);
}

[data-theme="dark"] .online-stats {
  color: var(--text-dark);
}

[data-theme="dark"] .total-online {
  color: var(--text-dark);
}

[data-theme="dark"] .user-item {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .user-name {
  color: var(--text-dark);
}

[data-theme="dark"] .user-role {
  color: var(--text-muted);
}

[data-theme="dark"] .user-role.admin {
  color: var(--danger-color);
}

[data-theme="dark"] .anonymous-count {
  color: var(--text-muted);
}

[data-theme="dark"] .anonymous-count svg {
  color: var(--text-muted);
}

/* Dark Theme Footer */
[data-theme="dark"] .footer-area {
  background-color: var(--bg-light); /* Match dark body background */
  color: var(--text-dark);
}

/* Triangle pattern for dark theme - more visible */
[data-theme="dark"] .footer-area::before {
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="rgba(255,255,255,0.08)"><polygon points="0,0 1000,100 1000,0"/></svg>');
}

[data-theme="dark"] .footer-section {
  background-color: var(--widget-bg);
  box-shadow: var(--secondary-shadow);
  border: 1px solid var(--border-light);
}

[data-theme="dark"] .footer-section:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .footer-section h4 {
  color: var(--text-dark);
  border-bottom: 2px solid var(--border-light);
}

[data-theme="dark"] .footer-section h4 i {
  color: var(--text-muted);
}

[data-theme="dark"] .footer-links-list a {
  color: var(--text-muted);
}

[data-theme="dark"] .footer-links-list a:hover {
  color: var(--text-dark);
  background-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .footer-bottom {
  background-color: var(--widget-bg);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
}

[data-theme="dark"] .footer-bottom a {
  color: var(--link-color);
}

[data-theme="dark"] .footer-bottom a:hover {
  color: var(--link-hover);
}

[data-theme="dark"] .social-link {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

[data-theme="dark"] .social-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-dark);
}

[data-theme="dark"] .contact-info {
  color: var(--text-muted);
}

[data-theme="dark"] .contact-info i {
  color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .footer-sections {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .footer-sections {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .footer-area {
    padding: 1.5rem 1rem 1rem;
  }
  
  .social-links {
    flex-wrap: wrap;
  }
  
  .footer-section {
    min-width: unset;
  }
}

/* Server status styling */
[data-theme="dark"] .uptime .card {
  background-color: var(--widget-bg);
  box-shadow: var(--secondary-shadow);
  border: 1px solid var(--border-light);
}

[data-theme="dark"] .uptime p {
  color: var(--text-muted);
}

[data-theme="dark"] .status-up {
  color: #28a745; /* Slightly adjusted green for better visibility in dark mode */
}

[data-theme="dark"] .status-down {
  color: #dc3545; /* Slightly adjusted red for better visibility in dark mode */
}

/* Custom range inputs */
[data-theme="dark"] .custom-range::-webkit-slider-thumb {
  background: var(--primary-button);
}

[data-theme="dark"] .custom-range::-moz-range-thumb {
  background: var(--primary-button);
}

[data-theme="dark"] .custom-range::-ms-thumb {
  background: var(--primary-button);
}

[data-theme="dark"] .custom-range::-webkit-slider-runnable-track {
  background: var(--border-light);
}

[data-theme="dark"] .custom-range::-moz-range-track {
  background: var(--border-light);
}

[data-theme="dark"] .custom-range::-ms-track {
  background: var(--border-light);
}

/* Focus styles for better accessibility in dark mode */
[data-theme="dark"] *:focus {
  outline: 2px solid var(--link-color);
  outline-offset: 2px;
}

/* For smaller screens */
@media (max-width: 768px) {
  .header-right {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}