@import url("../../elastic/styles/styles.min.css");

/* QuantumBytz Roundcube Theme
 * Extends the Elastic skin with QuantumBytz brand colors
 *
 * Brand Primary:  #EC6224 (burnt orange)
 * Brand Hover:    #D85520
 * Dark BG:        #111827 (gray-900)
 * Mid BG:         #1F2937 (gray-800)
 * Light BG:       #F9FAFB (gray-50)
 * Text Dark:      #111827 (gray-900)
 * Text Mid:       #4B5563 (gray-600)
 * Text Light:     #9CA3AF (gray-400)
 * Border:         #E5E7EB (gray-200)
 */

/* === LOGO === */
#logo {
    background: none !important;
    max-height: 40px;
    width: auto;
}

/* === TASK MENU (left sidebar) === */
#taskmenu {
    background-color: #111827 !important;
}

#taskmenu a {
    color: #D1D5DB !important;
}

#taskmenu a:hover,
#taskmenu a.selected {
    background-color: #1F2937 !important;
    color: #fff !important;
}

#taskmenu a.compose {
    color: #EC6224 !important;
}

#taskmenu a.compose:hover {
    color: #D85520 !important;
}

#taskmenu a.logout {
    color: #EF4444 !important;
}

/* === HEADER / TOOLBAR === */
.header,
#layout > .sidebar .header,
#layout > .list .header,
#layout > .content .header {
    background-color: #F9FAFB !important;
    color: #111827 !important;
    border-bottom: 1px solid #E5E7EB !important;
}

.header a,
.header .button,
.header h2 {
    color: #111827 !important;
}

#layout > .content .header .toolbar a {
    color: #4B5563 !important;
}

#layout > .content .header .toolbar a:hover {
    background-color: #F3F4F6 !important;
    color: #111827 !important;
}

/* === PRIMARY BUTTONS === */
.btn-primary,
button.btn-primary,
input.btn-primary,
a.btn-primary {
    background-color: #EC6224 !important;
    border-color: #EC6224 !important;
    color: #fff !important;
}

.btn-primary:hover,
button.btn-primary:hover,
a.btn-primary:hover {
    background-color: #D85520 !important;
    border-color: #D85520 !important;
}

.btn-primary:focus,
.btn-primary:active {
    background-color: #C44A1A !important;
    border-color: #C44A1A !important;
    box-shadow: 0 0 0 0.2rem rgba(236, 98, 36, 0.35) !important;
}

/* === LINKS === */
a {
    color: #EC6224;
}

a:hover {
    color: #D85520;
}

/* === LIST SELECTION === */
.messagelist tr.selected td,
.listing tr.selected td,
#mailboxlist li.selected > a {
    background-color: rgba(236, 98, 36, 0.08) !important;
}

.messagelist tr.focused td,
.listing tr.focused td {
    border-left-color: #EC6224 !important;
}

/* Unread count badge */
.unreadcount,
span.unreadcount {
    background-color: #EC6224 !important;
    color: #fff !important;
}

/* List focus indicator */
.focus-indicator,
.listing li > a:focus,
.listing li.focused > a {
    border-left-color: #EC6224 !important;
}

/* === CHECKBOXES & FORM INPUTS === */
.custom-control-input:checked ~ .custom-control-label::before,
input[type="checkbox"]:checked + label::before {
    background-color: #EC6224 !important;
    border-color: #EC6224 !important;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus {
    border-color: #EC6224 !important;
    box-shadow: 0 0 0 0.2rem rgba(236, 98, 36, 0.25) !important;
}

/* === MENU HOVER === */
.popupmenu li a:hover,
.popupmenu li a.active,
.popover .listing li a:hover,
.popover .listing li a.active {
    background-color: #EC6224 !important;
    color: #fff !important;
}

/* === FOOTER === */
.footer,
#layout .footer {
    background-color: #F9FAFB !important;
    color: #6B7280 !important;
    border-top: 1px solid #E5E7EB !important;
}

/* === QUOTA BAR === */
.quota .bar .value {
    background-color: #EC6224 !important;
}

/* === SPINNER === */
.spinner-border,
.loading::after {
    border-color: #EC6224 !important;
    border-right-color: transparent !important;
}

/* === LOGIN PAGE === */
body.login-page #layout {
    background: linear-gradient(135deg, #111827 0%, #1F2937 50%, #111827 100%) !important;
}

body.login-page #logo {
    width: 220px;
    height: 60px;
    margin: 0 auto 1.5rem;
}

body.login-page .formcontent {
    color: #111827;
}

#login-form {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

#login-form .box-inner {
    padding: 2rem;
}

#login-form .formbuttons .btn {
    background-color: #EC6224 !important;
    border-color: #EC6224 !important;
    border-radius: 8px;
    font-weight: 600;
    color: #fff !important;
}

#login-form .formbuttons .btn:hover {
    background-color: #D85520 !important;
    border-color: #D85520 !important;
}

/* === CONTENT AREAS === */
#layout > .sidebar {
    background-color: #fff !important;
    border-right: 1px solid #E5E7EB !important;
}

#layout > .list {
    background-color: #fff !important;
    border-right: 1px solid #E5E7EB !important;
}

#layout > .content {
    background-color: #fff !important;
}

/* === SEARCHBAR === */
.searchbar {
    background-color: #F3F4F6 !important;
    border-bottom: 1px solid #E5E7EB !important;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-thumb {
    background-color: #D1D5DB;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #9CA3AF;
}

::-webkit-scrollbar-track {
    background-color: #F3F4F6;
}

/* === DARK MODE === */
@media (prefers-color-scheme: dark) {
    #taskmenu {
        background-color: #0a0f1a !important;
    }

    .header,
    #layout > .sidebar .header,
    #layout > .list .header,
    #layout > .content .header {
        background-color: #111827 !important;
        color: #F3F4F6 !important;
        border-bottom-color: #1F2937 !important;
    }

    .header a,
    .header .button,
    .header h2 {
        color: #F3F4F6 !important;
    }

    #layout > .sidebar,
    #layout > .list {
        background-color: #1a2332 !important;
        border-right-color: #1F2937 !important;
    }

    #layout > .content {
        background-color: #1F2937 !important;
        color: #D1D5DB !important;
    }

    #layout > .content .header .toolbar a {
        color: #D1D5DB !important;
    }

    #layout > .content .header .toolbar a:hover {
        background-color: #374151 !important;
        color: #fff !important;
    }

    .messagelist tr.selected td,
    .listing tr.selected td {
        background-color: rgba(236, 98, 36, 0.15) !important;
    }

    .footer,
    #layout .footer {
        background-color: #111827 !important;
        color: #6B7280 !important;
        border-top-color: #1F2937 !important;
    }

    .searchbar {
        background-color: #111827 !important;
        border-bottom-color: #1F2937 !important;
    }

    body.login-page #layout {
        background: linear-gradient(135deg, #0a0f1a 0%, #111827 50%, #0a0f1a 100%) !important;
    }

    #login-form {
        background-color: #1F2937;
        color: #F3F4F6;
    }

    ::-webkit-scrollbar-thumb {
        background-color: #4B5563;
    }

    ::-webkit-scrollbar-track {
        background-color: #111827;
    }
}
