/**
 * Download Center - Custom Styles
 */

/* ── Primary colour override: #285A8C ───────────────────────────────────── */
:root {
    --mdb-primary:        #285A8C;
    --mdb-primary-rgb:    40, 90, 140;
    --bs-primary:         #285A8C;
    --bs-primary-rgb:     40, 90, 140;
    --bs-link-color:      #285A8C;
    --bs-link-hover-color:#1f4870;
}

.bg-primary                        { background-color: #285A8C !important; }
.text-primary                      { color: #285A8C !important; }
.border-primary                    { border-color: #285A8C !important; }

.btn-primary {
    background-color: #285A8C !important;
    border-color:     #285A8C !important;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    background-color: #1f4870 !important;
    border-color:     #1f4870 !important;
}

.btn-outline-primary {
    color:        #285A8C !important;
    border-color: #285A8C !important;
}
.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: #285A8C !important;
    color:            #fff    !important;
}

.badge.bg-primary { background-color: #285A8C !important; }

a         { color: #285A8C; }
a:hover   { color: #1f4870; }
/* ─────────────────────────────────────────────────────────────────────────── */

/* Layout */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}


/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    margin: 0.125rem 0.5rem;
}

.sidebar .nav-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.sidebar .nav-link.active {
    color: #fff;
}

.sidebar .nav-link i {
    width: 20px;
}

.sidebar-heading {
    font-size: .75rem;
    text-transform: uppercase;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.2s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 500;
}

/* Tables */
.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #6c757d;
    border-top: none;
}

.table td {
    vertical-align: middle;
}

/* Buttons */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Badges */
.badge {
    font-weight: 500;
}

/* Forms */
.form-outline .form-control:focus ~ .form-label,
.form-outline .form-control:not(:placeholder-shown) ~ .form-label {
    color: #285A8C;
}

/* Accordion */
.accordion-button:not(.collapsed) {
    background-color: rgba(40, 90, 140, 0.1);
    color: #285A8C;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: rgba(40, 90, 140, 0.5);
}

/* Alert animations */
.alert {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover shadow for cards */
.hover-shadow {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.hover-shadow:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Statistics cards */
.card .card-footer {
    background: transparent;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Code styling */
code {
    background-color: #f8f9fa;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

/* Product image placeholder */
.card-img-top.bg-light {
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .sidebar {
        position: static;
        padding-top: 0;
    }

    .navbar-brand {
        font-size: 1rem;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .navbar,
    .btn,
    footer {
        display: none !important;
    }

    main {
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Dropdown animations */
.dropdown-menu {
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal animations */
.modal.fade .modal-dialog {
    transition: transform 0.2s ease-out;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Focus styles for accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(40, 90, 140, 0.5);
    outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #285A8C;
    color: white;
    padding: 8px;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* ================================================
   Dark Theme - Discord Style
   ================================================
   Color Palette:
   - #202225: Darkest (sidebar)
   - #2f3136: Dark (secondary panels)
   - #36393f: Medium (main content)
   - #40444b: Input backgrounds
   - #4f545c: Borders/dividers
   - #72767d: Muted text
   - #b9bbbe: Secondary text
   - #dcddde: Primary text
   - #ffffff: White
   - #5865f2: Blurple (accent)
   - #3ba55c: Green (success)
   - #ed4245: Red (danger)
   - #faa61a: Yellow (warning)
   - #00aff4: Blue (links)
   ================================================ */

/* Theme toggle button */
.theme-toggle {
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
}

.theme-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

html[data-theme="dark"] .theme-toggle:hover {
    background-color: rgba(79, 84, 92, 0.4);
}

/* Dark theme base */
html[data-theme="dark"] {
    color-scheme: dark;
}

html[data-theme="dark"] body {
    background-color: #36393f !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .container-fluid {
    background-color: #36393f !important;
}

html[data-theme="dark"] main {
    background-color: #36393f !important;
}

html[data-theme="dark"] .bg-light {
    background-color: #2f3136 !important;
}

/* Sidebar - Discord style */
html[data-theme="dark"] .sidebar {
    background-color: #202225 !important;
    box-shadow: none;
}

html[data-theme="dark"] .sidebar .nav-link {
    color: #8e9297 !important;
    border-radius: 4px;
}

html[data-theme="dark"] .sidebar .nav-link:hover {
    background-color: #36393f !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .sidebar .nav-link.active {
    background-color: #5865f2 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .sidebar-heading {
    color: #72767d !important;
}

/* Cards */
html[data-theme="dark"] .card {
    background-color: #2f3136 !important;
    border: 1px solid #202225 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .card-header {
    background-color: #292b2f !important;
    border-bottom: 1px solid #202225 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .card-body {
    color: #ffffff !important;
}

html[data-theme="dark"] .card-footer {
    background-color: #292b2f !important;
    border-top: 1px solid #202225 !important;
}

/* Tables */
html[data-theme="dark"] .table {
    color: #ffffff !important;
    --mdb-table-bg: transparent !important;
}

html[data-theme="dark"] .table th {
    color: #b9bbbe !important;
    border-color: #4f545c !important;
    background-color: #2f3136 !important;
}

html[data-theme="dark"] .table td {
    border-color: #4f545c !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .table-hover tbody tr:hover {
    background-color: rgba(79, 84, 92, 0.3) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(47, 49, 54, 0.5) !important;
}

/* Borders */
html[data-theme="dark"] .border-bottom {
    border-color: #4f545c !important;
}

html[data-theme="dark"] .border {
    border-color: #4f545c !important;
}

/* Text */
html[data-theme="dark"] .text-muted {
    color: #96989d !important;
}

html[data-theme="dark"] .text-secondary {
    color: #b9bbbe !important;
}

html[data-theme="dark"] .text-body {
    color: #ffffff !important;
}

html[data-theme="dark"] small,
html[data-theme="dark"] .small {
    color: #ffffff !important;
}

html[data-theme="dark"] strong {
    color: #ffffff !important;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6 {
    color: #ffffff !important;
}

html[data-theme="dark"] p {
    color: #ffffff !important;
}

html[data-theme="dark"] label,
html[data-theme="dark"] .form-label {
    color: #ffffff !important;
}

html[data-theme="dark"] .form-check-label {
    color: #ffffff !important;
}

/* Forms - Discord style inputs */
html[data-theme="dark"] .form-control {
    background-color: #40444b !important;
    border: none !important;
    color: #ffffff !important;
    border-radius: 3px;
}

html[data-theme="dark"] .form-control:focus {
    background-color: #40444b !important;
    border: none !important;
    box-shadow: none !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .form-control::placeholder {
    color: #72767d !important;
}

html[data-theme="dark"] .form-select {
    background-color: #40444b !important;
    border: none !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .input-group-text {
    background-color: #40444b !important;
    border: none !important;
    color: #b9bbbe !important;
}

/* Modals */
html[data-theme="dark"] .modal-content {
    background-color: #36393f !important;
    border: none !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .modal-header {
    border-bottom: 1px solid #4f545c !important;
    background-color: #2f3136 !important;
}

html[data-theme="dark"] .modal-header .modal-title {
    color: #ffffff !important;
}

html[data-theme="dark"] .modal-body {
    color: #ffffff !important;
}

html[data-theme="dark"] .modal-footer {
    border-top: 1px solid #4f545c !important;
    background-color: #2f3136 !important;
}

html[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Accordion */
html[data-theme="dark"] .accordion-item {
    background-color: #2f3136 !important;
    border: 1px solid #4f545c !important;
}

html[data-theme="dark"] .accordion-button {
    background-color: #2f3136 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .accordion-button:not(.collapsed) {
    background-color: #36393f !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .accordion-button::after {
    filter: invert(1);
}

html[data-theme="dark"] .accordion-body {
    background-color: #36393f !important;
    color: #ffffff !important;
}

/* Alerts - Discord style */
html[data-theme="dark"] .alert-success {
    background-color: rgba(59, 165, 92, 0.1) !important;
    border: 1px solid #3ba55c !important;
    color: #3ba55c !important;
}

html[data-theme="dark"] .alert-danger {
    background-color: rgba(237, 66, 69, 0.1) !important;
    border: 1px solid #ed4245 !important;
    color: #ed4245 !important;
}

html[data-theme="dark"] .alert-info {
    background-color: rgba(0, 175, 244, 0.1) !important;
    border: 1px solid #00aff4 !important;
    color: #00aff4 !important;
}

html[data-theme="dark"] .alert-warning {
    background-color: rgba(250, 166, 26, 0.1) !important;
    border: 1px solid #faa61a !important;
    color: #faa61a !important;
}

/* Dropdowns */
html[data-theme="dark"] .dropdown-menu {
    background-color: #18191c !important;
    border: none !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.24);
    border-radius: 4px;
}

html[data-theme="dark"] .dropdown-item {
    color: #b9bbbe !important;
    border-radius: 2px;
    margin: 2px 8px;
    padding: 6px 8px;
    width: auto;
}

html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus {
    background-color: #5865f2 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .dropdown-divider {
    border-color: #4f545c !important;
    margin: 4px 0;
}

/* Code */
html[data-theme="dark"] code {
    background-color: #2f3136 !important;
    color: #00aff4 !important;
    border-radius: 3px;
    padding: 2px 6px;
}

html[data-theme="dark"] pre {
    background-color: #2f3136 !important;
    border-radius: 4px;
}

/* Tabs */
html[data-theme="dark"] .nav-tabs {
    border-bottom-color: #4f545c !important;
}

html[data-theme="dark"] .nav-tabs .nav-link {
    color: #b9bbbe !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    background: transparent !important;
}

html[data-theme="dark"] .nav-tabs .nav-link:hover {
    color: #ffffff !important;
    border-bottom-color: #4f545c !important;
}

html[data-theme="dark"] .nav-tabs .nav-link.active {
    color: #ffffff !important;
    background: transparent !important;
    border-bottom: 2px solid #5865f2 !important;
}

html[data-theme="dark"] .tab-content {
    border-color: #4f545c !important;
    background-color: #36393f !important;
}

/* Breadcrumb */
html[data-theme="dark"] .breadcrumb {
    background-color: transparent !important;
}

html[data-theme="dark"] .breadcrumb-item a {
    color: #00aff4 !important;
}

html[data-theme="dark"] .breadcrumb-item a:hover {
    color: #00d4ff !important;
    text-decoration: underline !important;
}

html[data-theme="dark"] .breadcrumb-item.active {
    color: #72767d !important;
}

html[data-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
    color: #4f545c !important;
}

/* Buttons - Discord style */
html[data-theme="dark"] .btn-primary {
    background-color: #5865f2 !important;
    border-color: #5865f2 !important;
}

html[data-theme="dark"] .btn-primary:hover {
    background-color: #4752c4 !important;
    border-color: #4752c4 !important;
}

html[data-theme="dark"] .btn-secondary {
    background-color: #4f545c !important;
    border-color: #4f545c !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-secondary:hover {
    background-color: #5d6269 !important;
    border-color: #5d6269 !important;
}

html[data-theme="dark"] .btn-success {
    background-color: #3ba55c !important;
    border-color: #3ba55c !important;
}

html[data-theme="dark"] .btn-success:hover {
    background-color: #2d8049 !important;
}

html[data-theme="dark"] .btn-danger {
    background-color: #ed4245 !important;
    border-color: #ed4245 !important;
}

html[data-theme="dark"] .btn-danger:hover {
    background-color: #c93b3e !important;
}

html[data-theme="dark"] .btn-outline-primary {
    color: #5865f2 !important;
    border-color: #5865f2 !important;
}

html[data-theme="dark"] .btn-outline-primary:hover {
    background-color: #5865f2 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-outline-secondary {
    color: #b9bbbe !important;
    border-color: #4f545c !important;
}

html[data-theme="dark"] .btn-outline-secondary:hover {
    background-color: #4f545c !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-outline-danger {
    color: #ed4245 !important;
    border-color: #ed4245 !important;
}

html[data-theme="dark"] .btn-outline-danger:hover {
    background-color: #ed4245 !important;
    color: #ffffff !important;
}

/* Links */
html[data-theme="dark"] a {
    color: #00aff4;
}

html[data-theme="dark"] a:hover {
    color: #00d4ff;
}

/* HR */
html[data-theme="dark"] hr {
    border-color: #4f545c !important;
}

/* Badges */
html[data-theme="dark"] .badge.bg-secondary {
    background-color: #4f545c !important;
}

html[data-theme="dark"] .badge.bg-primary {
    background-color: #285A8C !important;
}

html[data-theme="dark"] .badge.bg-success {
    background-color: #3ba55c !important;
}

html[data-theme="dark"] .badge.bg-danger {
    background-color: #ed4245 !important;
}

html[data-theme="dark"] .badge.bg-warning {
    background-color: #faa61a !important;
    color: #000000 !important;
}

html[data-theme="dark"] .badge.bg-info {
    background-color: #285A8C !important;
}

/* Scrollbar - Discord style */
html[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

html[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #2f3136;
    border-radius: 4px;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #202225;
    border-radius: 4px;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #18191c;
}

/* Progress bars */
html[data-theme="dark"] .progress {
    background-color: #4f545c !important;
}

html[data-theme="dark"] .progress-bar {
    background-color: #285A8C !important;
}

/* TinyMCE dark mode */
html[data-theme="dark"] .tox-tinymce {
    border: 1px solid #4f545c !important;
    border-radius: 4px !important;
}

html[data-theme="dark"] .tox .tox-menubar,
html[data-theme="dark"] .tox .tox-toolbar,
html[data-theme="dark"] .tox .tox-toolbar__primary,
html[data-theme="dark"] .tox .tox-toolbar__overflow {
    background-color: #2f3136 !important;
    border-bottom: 1px solid #4f545c !important;
}

html[data-theme="dark"] .tox .tox-tbtn {
    color: #b9bbbe !important;
}

html[data-theme="dark"] .tox .tox-tbtn:hover {
    background-color: #40444b !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .tox .tox-tbtn--enabled,
html[data-theme="dark"] .tox .tox-tbtn--enabled:hover {
    background-color: #285A8C !important;
}

html[data-theme="dark"] .tox .tox-edit-area__iframe {
    background-color: #40444b !important;
}

html[data-theme="dark"] .tox .tox-statusbar {
    background-color: #2f3136 !important;
    border-top: 1px solid #4f545c !important;
    color: #72767d !important;
}

/* Pagination */
html[data-theme="dark"] .page-link {
    background-color: #2f3136 !important;
    border-color: #4f545c !important;
    color: #b9bbbe !important;
}

html[data-theme="dark"] .page-link:hover {
    background-color: #36393f !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .page-item.active .page-link {
    background-color: #5865f2 !important;
    border-color: #5865f2 !important;
}

html[data-theme="dark"] .page-item.disabled .page-link {
    background-color: #202225 !important;
    color: #4f545c !important;
}

/* Navbar adjustments */
html[data-theme="dark"] .navbar {
    background-color: #202225 !important;
}

html[data-theme="dark"] .navbar-dark .navbar-nav .nav-link {
    color: #b9bbbe !important;
}

html[data-theme="dark"] .navbar-dark .navbar-nav .nav-link:hover {
    color: #ffffff !important;
}

/* Focus states */
html[data-theme="dark"] a:focus,
html[data-theme="dark"] button:focus,
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
    outline: 2px solid #285A8C !important;
    outline-offset: 2px;
}

/* Smooth transition for theme toggle */
body,
.sidebar,
.card,
.modal-content,
.dropdown-menu,
.form-control,
.btn {
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
