/* Dark Mode Overrides */
body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-mode nav {
    background-color: #1a237e !important;
    /* Keep blue darken-4 or make it darker */
}

/* Cards and Panels */
body.dark-mode .card,
body.dark-mode .card-panel,
body.dark-mode .modal,
body.dark-mode .modal-content,
body.dark-mode .modal-footer,
body.dark-mode .grey.lighten-5 {
    background-color: #1e1e1e !important;
    color: #e0e0e0;
}

/* Collections (Lists) */
body.dark-mode .collection,
body.dark-mode .collection-item,
body.dark-mode .collection-header {
    background-color: #1e1e1e !important;
    border-color: #333 !important;
    color: #e0e0e0 !important;
}

/* Inputs */
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
    color: #fff !important;
    border-bottom: 1px solid #757575 !important;
}

body.dark-mode .input-field label {
    color: #9e9e9e !important;
}

body.dark-mode .input-field input:focus+label,
body.dark-mode .input-field textarea:focus+label {
    color: #64b5f6 !important;
}

/* Links and Text */
body.dark-mode a {
    color: #64b5f6;
    /* Light blue */
}

body.dark-mode .blue-text.text-darken-4 {
    color: #90caf9 !important;
    /* Lighter blue for dark bg */
}

body.dark-mode .grey-text.text-darken-4 {
    color: #eeeeee !important;
}

body.dark-mode .card-title {
    color: #fff !important;
}

/* Tables */
body.dark-mode table.striped>tbody>tr:nth-child(odd) {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Dropdowns */
body.dark-mode .dropdown-content {
    background-color: #1e1e1e;
}

body.dark-mode .dropdown-content li>a,
body.dark-mode .dropdown-content li>span {
    color: #90caf9;
}

body.dark-mode .dropdown-content li:hover {
    background-color: #333;
}

/* Specific elements */
body.dark-mode .ebs-list-wrap .collection-header {
    background-color: #2c2c2c !important;
    /* Slightly lighter than card */
}

/* Fix bright images in dark mode */
body.dark-mode img[src*="blank.png"] {
    filter: invert(1) opacity(0.8);
}

body.dark-mode .card-image img {
    filter: brightness(0.8);
}

body.dark-mode .card-image.card-image-vb img[src*="blank.png"] {
    filter: invert(1) brightness(0.8);
}

/* Fix specific white cards */
body.dark-mode .white {
    background-color: #1e1e1e !important;
}

/* Scrollbar (Chrome/Safari) */
body.dark-mode ::-webkit-scrollbar {
    width: 10px;
}

body.dark-mode ::-webkit-scrollbar-track {
    background: #1e1e1e;
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 5px;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #777;
}