/* Custom Bootstrap overrides */
:root {
    --bs-primary: #FFA500;
    --bs-primary-rgb: 255, 165, 0;
    --bs-link-color: #FFA500;
    --bs-link-hover-color: #cc8400;
}

body {
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Primary button overrides */
.btn-primary {
    --bs-btn-bg: #FFA500;
    --bs-btn-border-color: #FFA500;
    --bs-btn-hover-bg: #cc8400;
    --bs-btn-hover-border-color: #cc8400;
    --bs-btn-active-bg: #b37400;
    --bs-btn-active-border-color: #b37400;
    --bs-btn-disabled-bg: #FFA500;
    --bs-btn-disabled-border-color: #FFA500;
}

.btn-outline-primary {
    --bs-btn-color: #FFA500;
    --bs-btn-border-color: #FFA500;
    --bs-btn-hover-bg: #FFA500;
    --bs-btn-hover-border-color: #FFA500;
    --bs-btn-active-bg: #FFA500;
    --bs-btn-active-border-color: #FFA500;
}

/* Nav pills active state */
.nav-pills .nav-link.active {
    background-color: #FFA500;
}

/* Form switch in primary color */
.form-check-input:checked,
.form-switch .form-check-input:checked {
    background-color: #FFA500 !important;
    border-color: #FFA500 !important;
}

.form-check-input:focus,
.form-switch .form-check-input:focus {
    border-color: #FFA500 !important;
    box-shadow: 0 0 0 0.25rem rgba(255, 165, 0, 0.25) !important;
}

.form-switch .form-check-input:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23000'/%3e%3c/svg%3e") !important;
}

/* Drag and drop cursor */
.cursor-grab {
    cursor: grab;
}

.cursor-grab:active {
    cursor: grabbing;
}

/* Pagination in primary color */
[data-bs-theme="dark"] .pagination .page-item.active .page-link,
.pagination .page-item.active .page-link {
    background-color: #FFA500 !important;
    border-color: #FFA500 !important;
    color: #000 !important;
}

[data-bs-theme="dark"] .pagination .page-link,
.pagination .page-link {
    color: #FFA500 !important;
}

[data-bs-theme="dark"] .pagination .page-link:hover,
.pagination .page-link:hover {
    color: #000 !important;
    background-color: #FFA500 !important;
    border-color: #FFA500 !important;
}

[data-bs-theme="dark"] .pagination .page-link:focus,
.pagination .page-link:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 165, 0, 0.25) !important;
}

[data-bs-theme="dark"] .pagination .page-item.disabled .page-link,
.pagination .page-item.disabled .page-link {
    color: #6c757d !important;
    background-color: transparent !important;
}

/* Tom Select dark mode */
[data-bs-theme="dark"] .ts-wrapper .ts-control {
    background-color: #212529;
    border-color: #495057;
    color: #fff;
}

[data-bs-theme="dark"] .ts-wrapper .ts-control input {
    color: #fff;
}

[data-bs-theme="dark"] .ts-wrapper .ts-control input::placeholder {
    color: #6c757d;
}

[data-bs-theme="dark"] .ts-dropdown {
    background-color: #212529;
    border-color: #495057;
    color: #fff;
}

[data-bs-theme="dark"] .ts-dropdown .optgroup-header {
    background-color: #2c3034;
    color: #adb5bd;
}

[data-bs-theme="dark"] .ts-dropdown .option {
    color: #fff;
}

[data-bs-theme="dark"] .ts-dropdown .option:hover,
[data-bs-theme="dark"] .ts-dropdown .option.active {
    background-color: #FFA500;
    color: #000;
}

[data-bs-theme="dark"] .ts-wrapper.focus .ts-control {
    border-color: #FFA500;
    box-shadow: 0 0 0 0.25rem rgba(255, 165, 0, 0.25);
}

[data-bs-theme="dark"] .ts-wrapper .ts-control .item {
    background-color: #495057;
    color: #fff;
}

/* Card header styling */
.card-header {
    background-color: #FFA500 !important;
    color: #000 !important;
    font-weight: 600;
    border-bottom: none;
}

[data-bs-theme="dark"] .card-header {
    background-color: #FFA500 !important;
    color: #000 !important;
}

/* Scroll to top button */
.btn-scroll-top {
    position: fixed;
    bottom: 2rem;
    left: calc(140px + 50vw);
    transform: translateX(-50%);
    width: 3rem;
    height: 3rem;
    z-index: 1050;
    transition: opacity 0.3s ease;
}

/* Responsive sidebar */
@media (max-width: 991.98px) {
    #mainContent {
        padding-top: 4.5rem !important;
    }

    .btn-scroll-top {
        left: 50%;
    }

    #sidebarOffcanvas {
        width: 280px !important;
    }

    #sidebarOffcanvas .offcanvas-header {
        padding-bottom: 0;
    }
}

@media (min-width: 992px) {
    #mainContent {
        padding-top: 1.5rem !important;
    }

    #sidebarOffcanvas {
        position: relative !important;
        transform: none !important;
        visibility: visible !important;
        background-color: var(--bs-dark) !important;
    }
}

/* Responsive charts */
@media (max-width: 767.98px) {
    .card-body canvas {
        min-height: 300px !important;
        height: auto !important;
    }
}
