/* Dark Mode Specific Fixes and Adjustments */

/* Override any light mode colors that slip through */
.dark-mode {
    color-scheme: dark;
}

/* Scrollbar styling for dark mode */
.dark-mode ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.dark-mode ::-webkit-scrollbar-track {
    background: #1a1d24;
}

.dark-mode ::-webkit-scrollbar-thumb {
    background: #3a3f4b;
    border-radius: 5px;
}

.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #4a4f5b;
}

/* Input placeholders */
.dark-mode input::placeholder,
.dark-mode textarea::placeholder {
    color: #6c757d;
    opacity: 1;
}

/* Focus states */
.dark-mode input:focus,
.dark-mode textarea:focus,
.dark-mode select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Dropdown menus */
.dark-mode .dropdown-menu {
    background: #2c3340;
    border-color: #3a3f4b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dark-mode .dropdown-item {
    color: #e9ecef;
}

.dark-mode .dropdown-item:hover {
    background: #3a3f4b;
    color: #fff;
}

/* Tooltips */
.dark-mode .tooltip {
    background: #2c3340;
    color: #e9ecef;
    border: 1px solid #3a3f4b;
}

/* Code blocks */
.dark-mode code,
.dark-mode pre {
    background: #1a1d24;
    color: #e9ecef;
    border: 1px solid #3a3f4b;
}

/* Tables */
.dark-mode table {
    color: #e9ecef;
    border-color: #3a3f4b;
}

.dark-mode table thead {
    background: #2c3340;
    border-bottom: 2px solid #3a3f4b;
}

.dark-mode table tbody tr {
    border-bottom: 1px solid #3a3f4b;
}

.dark-mode table tbody tr:hover {
    background: #2c3340;
}

/* Badges */
.dark-mode .badge {
    background: #3a3f4b;
    color: #e9ecef;
}

.dark-mode .badge.badge-primary {
    background: var(--primary-color);
    color: white;
}

.dark-mode .badge.badge-success {
    background: #28a745;
    color: white;
}

.dark-mode .badge.badge-warning {
    background: #ffc107;
    color: #212529;
}

.dark-mode .badge.badge-danger {
    background: #c084fc;
    color: white;
}

/* Status indicators */
.dark-mode .status-dot {
    background: currentColor;
}

.dark-mode .status-online {
    color: #28a745;
}

.dark-mode .status-offline {
    color: #6c757d;
}

.dark-mode .status-away {
    color: #ffc107;
}

/* Selection */
.dark-mode ::selection {
    background: rgba(0, 123, 255, 0.3);
    color: #fff;
}

/* Dividers */
.dark-mode hr {
    border-color: #3a3f4b;
}

/* Loading spinners */
.dark-mode .spinner,
.dark-mode .loading-spinner {
    border-color: #3a3f4b;
    border-top-color: var(--primary-color);
}

/* Progress bars */
.dark-mode .progress {
    background: #1a1d24;
}

.dark-mode .progress-bar {
    background: var(--primary-color);
}

/* Alerts */
.dark-mode .alert {
    border-color: #3a3f4b;
}

.dark-mode .alert-info {
    background: #17a2b8;
    color: white;
    border-color: #17a2b8;
}

.dark-mode .alert-success {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.dark-mode .alert-warning {
    background: #ffc107;
    color: #212529;
    border-color: #ffc107;
}

.dark-mode .alert-danger {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* File upload areas */
.dark-mode .file-upload-area {
    background: #2c3340;
    border: 2px dashed #3a3f4b;
    color: #e9ecef;
}

.dark-mode .file-upload-area:hover {
    border-color: var(--primary-color);
    background: #3a3f4b;
}

/* Checkbox and radio custom styles */
.dark-mode input[type="checkbox"],
.dark-mode input[type="radio"] {
    accent-color: var(--primary-color);
}

/* Date picker */
.dark-mode input[type="date"],
.dark-mode input[type="time"],
.dark-mode input[type="datetime-local"] {
    color-scheme: dark;
}

/* Search highlights */
.dark-mode mark,
.dark-mode .highlight {
    background: rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

/* Skeleton loading */
.dark-mode .skeleton {
    background: linear-gradient(
        90deg,
        #2c3340 25%,
        #3a3f4b 50%,
        #2c3340 75%
    );
    background-size: 200% 100%;
}

/* Context menu fix */
.dark-mode .context-menu {
    background: #2c3340;
    border-color: #3a3f4b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Editor specific fixes */
.dark-mode .ql-toolbar,
.dark-mode .ql-container {
    background: #2c3340;
    border-color: #3a3f4b;
    color: #e9ecef;
}

.dark-mode .ql-editor {
    color: #e9ecef;
}

.dark-mode .ql-editor.ql-blank::before {
    color: #6c757d;
}

/* Calendar view fixes */
.dark-mode .calendar-day {
    background: #2c3340;
    border-color: #3a3f4b;
}

.dark-mode .calendar-day:hover {
    background: #3a3f4b;
}

.dark-mode .calendar-day.today {
    background: rgba(0, 123, 255, 0.2);
    border-color: var(--primary-color);
}

/* Image and media fixes */
.dark-mode img {
    opacity: 0.9;
}

.dark-mode img:hover {
    opacity: 1;
}

/* Link colors */
.dark-mode a {
    color: #4da3ff;
}

.dark-mode a:hover {
    color: #80bdff;
}

/* Print fixes */
@media print {
    .dark-mode {
        background: white !important;
        color: black !important;
    }
    
    .dark-mode * {
        background: white !important;
        color: black !important;
        border-color: black !important;
    }
}
