/**
 * Dark Mode Styles for Energy Analysis System
 * Complete dark mode implementation with chart support
 */

/* Dark Mode Toggle Button */
.dark-mode-toggle {
  background: transparent;
  border: 2px solid #cbd5e0;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-right: 1rem;
  color: #333;
}

.dark-mode-toggle:hover {
  background: #f7fafc;
  border-color: #4a5568;
  transform: scale(1.1);
}

.dark-mode-toggle i {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.dark-mode-toggle:hover i {
  transform: rotate(20deg);
}

/* Dark Mode Body Styles */
body.dark-mode {
  background-color: #1a1a1a !important;
  color: #e0e0e0 !important;
}

body.dark-mode .dark-mode-toggle {
  border-color: #68d391;
  color: #68d391;
}

body.dark-mode .dark-mode-toggle:hover {
  background: #2d3748;
  border-color: #68d391;
}

/* Navigation Dark Mode */
body.dark-mode nav {
  background-color: #2d2d2d !important;
  border-bottom: 1px solid #4a5568;
}

body.dark-mode nav .logo span {
  color: #e0e0e0 !important;
}

body.dark-mode nav a {
  color: #e0e0e0 !important;
}

body.dark-mode nav a:hover {
  color: #68d391 !important;
}

/* Cards and Containers */
body.dark-mode .bg-white,
body.dark-mode .dashboard-card {
  background-color: #2d2d2d !important;
  border-color: #4a5568 !important;
}

body.dark-mode .bg-gray-50,
body.dark-mode .bg-gray-100 {
  background-color: #1a1a1a !important;
}

body.dark-mode .bg-blue-50,
body.dark-mode .bg-green-50,
body.dark-mode .bg-yellow-50,
body.dark-mode .bg-teal-100,
body.dark-mode .bg-gray-200 {
  background-color: #3a3a3a !important;
}

/* Text Colors */
body.dark-mode .text-gray-900,
body.dark-mode .text-gray-800,
body.dark-mode .text-gray-700,
body.dark-mode .text-gray-600,
body.dark-mode .text-gray-500 {
  color: #e0e0e0 !important;
}

body.dark-mode .text-black {
  color: #e0e0e0 !important;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
  color: #e0e0e0 !important;
}

body.dark-mode p,
body.dark-mode span:not(.bg-teal-100):not(.bg-gray-200):not(.bg-green-600):not(.bg-blue-600):not(.bg-red-600) {
  color: #b0b0b0 !important;
}

/* Borders */
body.dark-mode .border-gray-100,
body.dark-mode .border-gray-200,
body.dark-mode .border-gray-300 {
  border-color: #4a5568 !important;
}

/* Shadows */
body.dark-mode .shadow-sm,
body.dark-mode .shadow,
body.dark-mode .shadow-md,
body.dark-mode .shadow-lg,
body.dark-mode .shadow-xl {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3) !important;
}

/* Forms and Inputs */
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background-color: #3a3a3a !important;
  border-color: #4a5568 !important;
  color: #e0e0e0 !important;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: #718096 !important;
}

body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
  border-color: #68d391 !important;
  box-shadow: 0 0 0 3px rgba(104, 211, 145, 0.1) !important;
}

body.dark-mode option {
  background-color: #3a3a3a !important;
  color: #e0e0e0 !important;
}

/* Buttons */
body.dark-mode button,
body.dark-mode .btn,
body.dark-mode .submit-btn {
  background-color: #4a5568 !important;
  color: #e0e0e0 !important;
  border-color: #4a5568 !important;
}

body.dark-mode button:hover,
body.dark-mode .btn:hover,
body.dark-mode .submit-btn:hover {
  background-color: #2d3748 !important;
  border-color: #68d391 !important;
}

body.dark-mode .btn-primary {
  background-color: #4299e1 !important;
  border-color: #4299e1 !important;
}

body.dark-mode .btn-primary:hover {
  background-color: #3182ce !important;
}

body.dark-mode .bg-indigo-600,
body.dark-mode .bg-blue-600 {
  background-color: #4299e1 !important;
}

body.dark-mode .bg-green-600 {
  background-color: #48bb78 !important;
}

body.dark-mode .bg-red-600 {
  background-color: #f56565 !important;
}

/* Tables */
body.dark-mode table {
  background-color: #2d2d2d !important;
  color: #e0e0e0 !important;
}

body.dark-mode thead {
  background-color: #3a3a3a !important;
}

body.dark-mode tbody tr {
  border-color: #4a5568 !important;
}

body.dark-mode tbody tr:hover {
  background-color: #3a3a3a !important;
}

body.dark-mode th,
body.dark-mode td {
  border-color: #4a5568 !important;
  color: #e0e0e0 !important;
}

/* Chart Containers */
body.dark-mode #chartContainerDaily,
body.dark-mode #chartContainerSunday,
body.dark-mode #chartContainerGroup,
body.dark-mode #chartmain,
body.dark-mode #chartCanvas,
body.dark-mode #tree-container,
body.dark-mode #peak-container,
body.dark-mode #energy-container,
body.dark-mode #oneday-container,
body.dark-mode #shift-container,
body.dark-mode #martixchart,
body.dark-mode #sankeyChart,
body.dark-mode #sunChart,
body.dark-mode #weeklyHoursChart,
body.dark-mode #chart-history,
body.dark-mode #chart-container,
body.dark-mode #chart1,
body.dark-mode #chart2,
body.dark-mode #chart3,
body.dark-mode #chart4,
body.dark-mode #chart,
body.dark-mode .chart-container {
  background-color: #2d2d2d !important;
  border-color: #4a5568 !important;
}

/* Sidebar and Panels */
body.dark-mode #chartSelectPanel {
  background-color: #2d2d2d !important;
  border-color: #4a5568 !important;
}

body.dark-mode .glass-morphism {
  background: rgba(45, 45, 45, 0.85) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(74, 85, 104, 0.3) !important;
}

/* List Items */
body.dark-mode .list-group-item {
  background-color: #2d2d2d !important;
  border-color: #4a5568 !important;
  color: #e0e0e0 !important;
}

body.dark-mode .list-group-item:hover {
  background-color: #3a3a3a !important;
}

/* Badges and Labels */
body.dark-mode .badge,
body.dark-mode .bg-teal-100 {
  background-color: #2d4a3e !important;
  color: #68d391 !important;
}

body.dark-mode .bg-gray-200 {
  background-color: #4a5568 !important;
  color: #e0e0e0 !important;
}

body.dark-mode .text-teal-800 {
  color: #68d391 !important;
}

body.dark-mode .text-gray-700 {
  color: #e0e0e0 !important;
}

/* Icons */
body.dark-mode i.fa,
body.dark-mode i.fas,
body.dark-mode i.far {
  color: inherit !important;
}

body.dark-mode .text-success {
  color: #68d391 !important;
}

body.dark-mode .text-warning {
  color: #ecc94b !important;
}

body.dark-mode .text-primary {
  color: #4299e1 !important;
}

body.dark-mode .text-info {
  color: #38b2ac !important;
}

body.dark-mode .text-danger {
  color: #f56565 !important;
}

/* Alerts and Toasts */
body.dark-mode .alert {
  background-color: #3a3a3a !important;
  border-color: #4a5568 !important;
  color: #e0e0e0 !important;
}

body.dark-mode #errorContainer {
  background-color: rgba(45, 45, 45, 0.95) !important;
  color: #e0e0e0 !important;
  border-color: #f56565 !important;
}

/* Modals */
body.dark-mode .modal-content {
  background-color: #2d2d2d !important;
  color: #e0e0e0 !important;
}

body.dark-mode .modal-header {
  border-bottom-color: #4a5568 !important;
}

body.dark-mode .modal-footer {
  border-top-color: #4a5568 !important;
}

/* Dropdowns */
body.dark-mode .dropdown-menu {
  background-color: #2d2d2d !important;
  border-color: #4a5568 !important;
}

body.dark-mode .dropdown-item {
  color: #e0e0e0 !important;
}

body.dark-mode .dropdown-item:hover {
  background-color: #3a3a3a !important;
  color: #68d391 !important;
}

/* Scrollbar */
body.dark-mode ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body.dark-mode ::-webkit-scrollbar-track {
  background: #1a1a1a;
}

body.dark-mode ::-webkit-scrollbar-thumb {
  background: #4a5568;
  border-radius: 5px;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: #68d391;
}

/* Specific Component Overrides */
body.dark-mode .text-uppercase {
  color: #b0b0b0 !important;
}

body.dark-mode .lead {
  color: #b0b0b0 !important;
}

body.dark-mode hr {
  border-color: #4a5568 !important;
}

/* Login Page Specific */
body.dark-mode .bg-gray-50 {
  background-color: #1a1a1a !important;
}

body.dark-mode .floating-input {
  background-color: transparent !important;
  border-bottom-color: #4a5568 !important;
  color: #e0e0e0 !important;
}

body.dark-mode .floating-input:focus {
  border-bottom-color: #68d391 !important;
}

body.dark-mode label {
  color: #b0b0b0 !important;
}

body.dark-mode .floating-input:focus ~ label,
body.dark-mode .floating-input:not(:placeholder-shown) ~ label {
  color: #68d391 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .dark-mode-toggle {
    width: 36px;
    height: 36px;
    margin-right: 0.5rem;
  }
  
  .dark-mode-toggle i {
    font-size: 1rem;
  }
}

/* Animation for smooth transitions */
body,
body * {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Prevent transition on page load */
body.preload * {
  transition: none !important;
}
