/* Dark Theme Styles */
body.dark-theme {
    --bs-body-bg: #1a1a1a;
    --bs-body-color: #e0e0e0;
    --bs-border-color: #404040;
    --bs-link-color: #58a6ff;
    --bs-link-hover-color: #79b8ff;
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-theme .container {
    background-color: #1a1a1a;
}

/* Bootstrap button overrides */
body.dark-theme .btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

body.dark-theme .btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

body.dark-theme .btn-outline-primary {
    color: #58a6ff;
    border-color: #58a6ff;
}

body.dark-theme .btn-outline-primary:hover {
    background-color: #58a6ff;
    border-color: #58a6ff;
    color: #1a1a1a;
}

body.dark-theme .btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

body.dark-theme .btn-danger:hover {
    background-color: #bb2d3b;
    border-color: #b02a37;
}

body.dark-theme .btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

body.dark-theme .btn-secondary:hover {
    background-color: #5c636a;
    border-color: #565e64;
}

body.dark-theme .btn-outline-secondary {
    color: #adb5bd;
    border-color: #6c757d;
}

body.dark-theme .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

/* Dropdown menus */
body.dark-theme .dropdown-menu {
    background-color: #2d2d2d;
    border-color: #404040;
}

body.dark-theme .dropdown-item {
    color: #e0e0e0;
}

body.dark-theme .dropdown-item:hover,
body.dark-theme .dropdown-item:focus {
    background-color: #404040;
    color: #fff;
}

/* Progress bars */
body.dark-theme .progress {
    background-color: #2d2d2d;
}

body.dark-theme .progress-bar {
    background-color: #0d6efd;
}

/* List groups */
body.dark-theme .list-group-item {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

body.dark-theme .list-group-item a {
    color: var(--bs-link-color);
}

body.dark-theme .list-group-item a:hover {
    color: var(--bs-link-hover-color);
}

/* Tables */
body.dark-theme table {
    color: #e0e0e0;
}

body.dark-theme th {
    border-bottom: 2px solid #404040;
    padding: 8px;
}

body.dark-theme td {
    border-bottom: 1px solid #404040;
    padding: 8px;
}

/* Form inputs */
body.dark-theme input[type="text"],
body.dark-theme input[type="number"],
body.dark-theme input[type="file"],
body.dark-theme input[type="password"],
body.dark-theme input[type="email"],
body.dark-theme select,
body.dark-theme textarea {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

body.dark-theme input[type="text"]:focus,
body.dark-theme input[type="number"]:focus,
body.dark-theme input[type="file"]:focus,
body.dark-theme input[type="password"]:focus,
body.dark-theme input[type="email"]:focus,
body.dark-theme select:focus,
body.dark-theme textarea:focus {
    background-color: #2d2d2d;
    border-color: #58a6ff;
    color: #e0e0e0;
}

body.dark-theme .form-control {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

body.dark-theme .form-control:focus {
    background-color: #2d2d2d;
    border-color: #58a6ff;
    color: #e0e0e0;
    box-shadow: 0 0 0 0.25rem rgba(88, 166, 255, 0.25);
}

/* Links */
body.dark-theme a {
    color: var(--bs-link-color);
}

body.dark-theme a:hover {
    color: var(--bs-link-hover-color);
}

/* Alert components */
body.dark-theme .alert {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

body.dark-theme .alert-danger {
    background-color: #3d1f1f;
    border-color: #6b3030;
    color: #f0a0a0;
}

body.dark-theme .alert-warning {
    background-color: #3d3d1f;
    border-color: #6b6b30;
    color: #f0f0a0;
}

body.dark-theme .alert-success {
    background-color: #1f3d1f;
    border-color: #306b30;
    color: #a0f0a0;
}

body.dark-theme .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Text utilities */
body.dark-theme .text-muted {
    color: #9e9e9e !important;
}

/* Form labels */
body.dark-theme .form-label,
body.dark-theme .form-check-label {
    color: #e0e0e0;
}

/* HR element */
body.dark-theme hr {
    border-color: #404040;
    opacity: 0.5;
}

/* Movie hash match highlight */
body.dark-theme .moviehashmatch {
    background-color: #665500;
    color: #fff;
}

/* Theme toggle button */
#theme-toggle {
    font-size: 1.1em;
    padding: 0.375rem 0.5rem;
    color: #6c757d;
    min-width: 2.2em;
}

#theme-toggle:hover {
    color: #495057;
}

body.dark-theme #theme-toggle {
    color: #adb5bd;
}

body.dark-theme #theme-toggle:hover {
    color: #e0e0e0;
}
