/*
 * WiseFlea dark theme
 * -------------------
 * All app pages use body.app-dark. Bootstrap utility classes like .text-muted
 * default to gray — override BS CSS variables on dark panels so every
 * current and future template stays readable. For empty lists, prefer:
 *   {% include "partials/empty_state.html" with message=_("No items yet.") %}
 * or class .empty-state on any element.
 * For filter/toggle buttons use .btn-filter (inactive) and .btn-filter-active (selected).
 */
body.app-dark {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(to bottom right, #003366, #000033);
    background-size: cover;
    background-attachment: fixed;
    color: #ffffff;
}

/* Bootstrap 5 reads these vars for .text-muted, .text-body-secondary, etc. */
body.app-dark .container,
body.app-dark .hero,
body.app-dark .login-shell,
body.app-dark .stat-card {
    --bs-body-color: #ffffff;
    --bs-heading-color: #ffffff;
    --bs-secondary-color: #e8eef7;
    --bs-tertiary-color: #c8d4e6;
    --bs-emphasis-color: #ffffff;
    color: #ffffff;
}

body.app-dark .text-muted,
body.app-dark .text-secondary,
body.app-dark .text-body-secondary {
    color: #e8eef7 !important;
}

body.app-dark .empty-state {
    color: #ffffff;
    opacity: 0.92;
    margin: 0.75rem 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

body.app-dark h1,
body.app-dark h2,
body.app-dark h3,
body.app-dark h4,
body.app-dark h5,
body.app-dark h6,
body.app-dark .container h1,
body.app-dark .container h2,
body.app-dark .container h3,
body.app-dark .container h4,
body.app-dark .container h5,
body.app-dark .container h6 {
    color: #ffffff;
}

body.app-dark .container label,
body.app-dark .login-shell label,
body.app-dark .form-stacked label {
    color: #ffffff;
}

body.app-dark .container .form-text,
body.app-dark .login-shell .form-text {
    color: #c8d4e6 !important;
}

body.app-dark .container .text-danger,
body.app-dark .login-shell .text-danger,
body.app-dark .errorlist,
body.app-dark .errorlist li {
    color: #ff9e9e !important;
}

body.app-dark .table-dark-custom {
    --bs-table-color: #ffffff;
    --bs-table-bg: rgba(0, 0, 0, 0.4);
}

body.app-dark .table-dark-custom .empty-state,
body.app-dark .table-dark-custom td.empty-state {
    color: #ffffff !important;
}

/* Login card — solid panel so headings have real contrast */
.login-shell {
    max-width: 420px;
    margin: 60px auto;
    padding: 36px 32px 32px;
    background: rgba(8, 18, 40, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.login-shell .login-title {
    text-align: center;
    color: #ffffff;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.login-shell .login-subtitle {
    text-align: center;
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1.75rem;
    opacity: 0.92;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

.hide-hero .container {
    background: transparent;
    box-shadow: none;
    max-width: none;
    width: 100%;
    margin: 0 auto 140px;
    padding: 0 20px;
}

h2 {
    text-align: center;
    color: #FFFFFF;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

form p { width: 100%; }
p { margin: 10px 0; }

label {
    display: block;
    margin-bottom: 5px;
    color: #FFFFFF;
}

button {
    padding: 10px 20px;
    background-color: #007bff;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
}

button:hover { background-color: #0056b3; }
a:hover { text-decoration: underline; }

/* Custom gradient action buttons only — do NOT style all .btn (breaks btn-light) */
.btn-primary-action,
.btn-success-action,
.btn-warning-action {
    padding: 10px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: #ffffff !important;
    font-size: 1rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border: none;
}

.btn-primary-action { background: linear-gradient(135deg, #003366, #0055aa); }
.btn-success-action { background: linear-gradient(135deg, #006600, #009900); }
.btn-warning-action { background: linear-gradient(135deg, #aa6600, #cc8800); }

/* Filter / toggle pills (All Days, status filters, etc.) */
body.app-dark .btn-filter {
    color: #ffffff !important;
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 8px;
    box-shadow: none;
}

body.app-dark .btn-filter:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.75);
}

body.app-dark .btn-filter-active {
    color: #0a1628 !important;
    background-color: #e8eef7 !important;
    border: 1px solid #e8eef7;
    border-radius: 8px;
    box-shadow: none;
    font-weight: 600;
}

body.app-dark .btn-filter-active:hover {
    color: #0a1628 !important;
    background-color: #ffffff !important;
}

/* Bootstrap button fixes on dark backgrounds */
body.app-dark .btn-light {
    color: #0a1628 !important;
    background-color: #e8eef7 !important;
    border-color: #e8eef7 !important;
}

body.app-dark .btn-outline-light {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.55) !important;
    background-color: transparent;
}

body.app-dark .btn-outline-light:hover {
    color: #0a1628 !important;
    background-color: #e8eef7 !important;
    border-color: #e8eef7 !important;
}

body.app-dark .btn-outline-success {
    color: #7dffb0 !important;
    border-color: #3d9e6a !important;
}

body.app-dark .btn-outline-success:hover {
    color: #0a1628 !important;
    background-color: #7dffb0 !important;
}

body.app-dark .btn-primary {
    color: #ffffff !important;
}

.hero {
    /* Replace with your image: core/static/img/hero.jpg (recommended 1920×480px) */
    background: linear-gradient(rgba(0, 51, 102, 0.75), rgba(0, 0, 51, 0.85)),
                url('../img/hero.jpg') center/cover no-repeat,
                url('https://images.unsplash.com/photo-1454165804606-c3d57bc86b40?auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    height: 240px;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
    margin-bottom: 20px;
    width: 100%;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin: 0 0 15px 0;
    text-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

.hero-content p {
    font-size: 1.4rem;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.95;
}

.hide-hero .hero { display: none; }

.form-check-label {
    display: inline-block !important;
    width: auto !important;
    margin-bottom: 0;
    vertical-align: middle;
    cursor: pointer;
}

input[type="checkbox"] {
    width: auto !important;
    height: auto !important;
    margin-right: 8px;
    display: inline-block;
    vertical-align: middle;
}

.container {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    max-width: 1100px;
    width: 90%;
    margin: 40px auto 140px;
}

.footer {
    background-color: #000011;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    text-align: center;
    padding: 15px 0;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 1000;
    font-size: 0.9rem;
}

.login-shell form,
.form-stacked {
    display: flex;
    flex-direction: column;
    margin-top: 5px;
}

.form-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-top: 1rem;
}

.form-actions .btn,
.form-actions button {
    margin-top: 0;
    width: auto;
}

form:not(.d-flex) input,
form:not(.d-flex) select,
form:not(.d-flex) textarea {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

/* Form fields: white background, dark text (labels stay white outside) */
body.app-dark .form-control,
body.app-dark .form-select,
body.app-dark form:not(.d-flex) input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
body.app-dark form:not(.d-flex) select,
body.app-dark form:not(.d-flex) textarea {
    color: #212529 !important;
    background-color: #ffffff !important;
    border: 1px solid #ced4da !important;
}

body.app-dark .form-control::placeholder,
body.app-dark input::placeholder,
body.app-dark textarea::placeholder {
    color: #6c757d !important;
    opacity: 1;
}

body.app-dark input[type="date"],
body.app-dark input[type="datetime-local"],
body.app-dark input[type="time"] {
    color: #212529 !important;
    background-color: #ffffff !important;
    color-scheme: light;
}

body.app-dark input[type="date"]::-webkit-calendar-picker-indicator,
body.app-dark input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: none;
    opacity: 0.75;
    cursor: pointer;
}

.stat-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.stat-card h3 {
    font-size: 2rem;
    margin: 0;
}

.stat-card p {
    margin: 5px 0 0;
    color: #e8eef7;
}

.table-dark-custom {
    --bs-table-bg: rgba(0, 0, 0, 0.4);
    --bs-table-color: #fff;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
    filter: invert(1);
}