/* =================================
   DARK MODE - COMPLETE HARDCODED COLOR OVERRIDES
   ================================= */

/* This file specifically overrides all hardcoded colors found in style.css and components.css */

[data-theme="dark"] {
    /* Override all hardcoded backgrounds from style.css */
    
    /* Body and main containers - Override #f8fafc */
    body { background-color: #1a202c !important; color: #f7fafc !important; }
    .dashboard { background-color: #1a202c !important; }
    .main-content { background-color: #1a202c !important; }
    
    /* Stats cards backgrounds - Override #f7fafc */
    .stats-card,
    .card { 
        background-color: #2d3748 !important; 
        color: #f7fafc !important;
        border-color: #4a5568 !important;
    }
    
    /* All elements with #2d3748 color (dark text) */
    h1, h2, h3, h4, h5, h6, p, span, div, td, th, label,
    .stats-number, .page-title, .section-title {
        color: #f7fafc !important;
    }
    
    /* All elements with #4a5568 color (medium text) */
    .text-secondary, .stats-label, .form-label, .table-header {
        color: #e2e8f0 !important;
    }
    
    /* All elements with #718096 color (muted text) */
    .text-muted, .subtitle, .description {
        color: #a0aec0 !important;
    }
    
    /* Override sidebar gradient - Replace linear-gradient(135deg, #667eea 0%, #764ba2 100%) */
    .sidebar {
        background: #2d3748 !important;
        color: #f7fafc !important;
    }
    
    /* Tables - Override white backgrounds */
    .table, .inventory-table {
        background-color: #2d3748 !important;
        color: #f7fafc !important;
    }
    
    .table th {
        background-color: #4a5568 !important;
        color: #f7fafc !important;
        border-color: #4a5568 !important;
    }
    
    .table td {
        background-color: #2d3748 !important;
        color: #f7fafc !important;
        border-color: #4a5568 !important;
    }
    
    .table tbody tr:nth-of-type(odd) td {
        background-color: #374151 !important;
    }
    
    /* Forms - Override white backgrounds */
    .form-control, input, textarea, select {
        background-color: #2d3748 !important;
        color: #f7fafc !important;
        border-color: #4a5568 !important;
    }
    
    .form-control:focus, input:focus, textarea:focus, select:focus {
        background-color: #2d3748 !important;
        color: #f7fafc !important;
        border-color: #667eea !important;
        box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2) !important;
    }
    
    /* Modals - Override white backgrounds */
    .modal-content, .modal-header, .modal-body, .modal-footer {
        background-color: #2d3748 !important;
        color: #f7fafc !important;
        border-color: #4a5568 !important;
    }
    
    /* Dropdown menus */
    .dropdown-menu {
        background-color: #2d3748 !important;
        border-color: #4a5568 !important;
    }
    
    .dropdown-menu a, .dropdown-item {
        color: #f7fafc !important;
        background-color: transparent !important;
    }
    
    .dropdown-menu a:hover, .dropdown-item:hover {
        background-color: #4a5568 !important;
        color: #f7fafc !important;
    }
    
    /* Alert boxes - Override all colored backgrounds */
    .alert {
        border-color: #4a5568 !important;
    }
    
    .alert-success {
        background-color: #065f46 !important;
        color: #d1fae5 !important;
        border-color: #059669 !important;
    }
    
    .alert-danger {
        background-color: #991b1b !important;
        color: #fecaca !important;
        border-color: #dc2626 !important;
    }
    
    .alert-warning {
        background-color: #92400e !important;
        color: #fef3c7 !important;
        border-color: #d97706 !important;
    }
    
    .alert-info {
        background-color: #1e40af !important;
        color: #dbeafe !important;
        border-color: #2563eb !important;
    }
    
    /* Status badges - Keep colors but adjust for dark mode */
    .status-active { background-color: #065f46 !important; color: #d1fae5 !important; }
    .status-inactive { background-color: #991b1b !important; color: #fecaca !important; }
    .status-pending { background-color: #92400e !important; color: #fef3c7 !important; }
    
    /* Buttons - Only override outline/secondary buttons */
    .btn-outline, .btn-secondary {
        background-color: #4a5568 !important;
        color: #f7fafc !important;
        border-color: #4a5568 !important;
    }
    
    .btn-outline:hover, .btn-secondary:hover {
        background-color: #6b7280 !important;
        color: #f7fafc !important;
    }
    
    /* Override any remaining hardcoded light backgrounds */
    *[style*="background-color: #f"] {
        background-color: #2d3748 !important;
    }
    
    *[style*="background: #f"] {
        background-color: #2d3748 !important;
    }
    
    /* Override any hardcoded dark text */
    *[style*="color: #2"], *[style*="color: #3"], *[style*="color: #4"] {
        color: #f7fafc !important;
    }
    
    /* Login card specific */
    .login-card {
        background-color: #2d3748 !important;
        color: #f7fafc !important;
        border-color: #4a5568 !important;
    }
    
    /* Make sure links are visible */
    a {
        color: #93c5fd !important;
    }
    
    a:hover {
        color: #ddd6fe !important;
    }
    
    /* QR code containers - keep white background */
    canvas, .qr-code canvas {
        background-color: #ffffff !important;
        border-radius: 4px;
    }
    
    /* Stats cards specific overrides */
    .stats-value, .stat-number {
        color: #f7fafc !important;
    }
    
    .stats-label, .stat-label {
        color: #e2e8f0 !important;
    }
    
    /* Calendar specific */
    .calendar-day {
        background-color: #2d3748 !important;
        color: #f7fafc !important;
        border-color: #4a5568 !important;
    }
    
    .calendar-day:hover {
        background-color: #4a5568 !important;
    }
    
    .calendar-day.has-events {
        background-color: #667eea !important;
        color: #ffffff !important;
    }
}