/*
 * Modern Theme Override for Fitbook Admin Panel
 * Loaded LAST to override all HopeUI + Bootstrap defaults
 * ============================================================
 */

/* ─── Global Smoothing & Background ─── */
body,
.content-page,
.conatiner-fluid {
    background-color: #f5f6fa !important;
}

/* Subtle global transitions (not on *) */
input,
select,
textarea,
button,
.btn,
.form-control,
.form-select,
.card,
.nav-link,
.badge,
.page-link {
    transition: all 0.2s ease !important;
}

/* ─── Typography ─── */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 600 !important;
    color: #232942 !important;
}

.dark h1, .dark h2, .dark h3, .dark h4, .dark h5, .dark h6,
.dark .h1, .dark .h2, .dark .h3, .dark .h4, .dark .h5, .dark .h6 {
    color: #e4e6eb !important;
}

/* ─── Modern Form Inputs ─── */
.form-control,
.form-select,
select.form-control {
    border-radius: 10px !important;
    border: 1.5px solid #e0e0e0 !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
    background-color: #fff !important;
    color: #3a3f51 !important;
}

.form-control:focus,
.form-select:focus,
select.form-control:focus {
    border-color: #e8734a !important;
    box-shadow: 0 0 0 3px rgba(232, 115, 74, 0.15) !important;
    outline: none !important;
}

.form-control::placeholder {
    color: #b0b5c3 !important;
    font-weight: 400 !important;
}

.form-label,
label {
    font-weight: 500 !important;
    font-size: 13px !important;
    color: #5a607f !important;
    margin-bottom: 6px !important;
}

.dark .form-control,
.dark .form-select,
.dark select.form-control {
    background-color: #2a2d3e !important;
    border-color: #3d4057 !important;
    color: #d1d5db !important;
}

.dark .form-control:focus,
.dark .form-select:focus {
    border-color: #e8734a !important;
    box-shadow: 0 0 0 3px rgba(232, 115, 74, 0.2) !important;
}

/* Input groups */
.input-group .form-control {
    border-radius: 10px !important;
}
.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}
.input-group > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}
.input-group-text {
    border-radius: 10px !important;
    border: 1.5px solid #e0e0e0 !important;
    background-color: #f8f9fc !important;
    font-size: 14px !important;
}

/* Textarea */
textarea.form-control {
    border-radius: 12px !important;
    min-height: 100px;
}

/* ─── Modern Buttons ─── */
.btn {
    border-radius: 10px !important;
    padding: 8px 20px !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    letter-spacing: 0.2px !important;
    border: none !important;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: #e8734a !important;
    border-color: #e8734a !important;
    color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #d4623c !important;
    border-color: #d4623c !important;
    box-shadow: 0 4px 14px rgba(232, 115, 74, 0.35) !important;
}

.btn-outline-primary {
    color: #e8734a !important;
    border: 1.5px solid #e8734a !important;
    background: transparent !important;
}

.btn-outline-primary:hover {
    background-color: #e8734a !important;
    color: #fff !important;
}

.btn-danger {
    border-radius: 10px !important;
    background-color: #e74c3c !important;
    border-color: #e74c3c !important;
}

.btn-danger:hover {
    background-color: #c0392b !important;
    box-shadow: 0 4px 14px rgba(231, 76, 60, 0.3) !important;
}

.btn-success {
    background-color: #27ae60 !important;
    border-color: #27ae60 !important;
}

.btn-success:hover {
    background-color: #219a52 !important;
    box-shadow: 0 4px 14px rgba(39, 174, 96, 0.3) !important;
}

.btn-sm {
    padding: 5px 14px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
}

.btn-lg {
    padding: 12px 28px !important;
    font-size: 16px !important;
    border-radius: 12px !important;
}

/* Icon-only buttons (actions) */
.btn-icon {
    border-radius: 10px !important;
}

/* ─── Modern Cards ─── */
.card {
    border-radius: 16px !important;
    border: none !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06) !important;
    overflow: hidden;
}

.card-header {
    border-radius: 16px 16px 0 0 !important;
    background: #fff !important;
    border-bottom: 1px solid #f0f0f0 !important;
    padding: 16px 24px !important;
    font-weight: 600 !important;
}

.card-body {
    padding: 20px 24px !important;
}

.card-footer {
    background: #fff !important;
    border-top: 1px solid #f0f0f0 !important;
    border-radius: 0 0 16px 16px !important;
    padding: 16px 24px !important;
}

.dark .card {
    background-color: #1e2235 !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2) !important;
}

.dark .card-header {
    background: #1e2235 !important;
    border-bottom-color: #2d3148 !important;
}

.dark .card-footer {
    background: #1e2235 !important;
    border-top-color: #2d3148 !important;
}

/* ─── Modern Sidebar ─── */
.sidebar {
    border-right: none !important;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.04) !important;
}

.sidebar .sidebar-body {
    padding: 8px !important;
}

.sidebar .nav-link {
    border-radius: 10px !important;
    margin: 2px 8px !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    color: #6b7280 !important;
}

.sidebar .nav-link:hover {
    background-color: rgba(232, 115, 74, 0.08) !important;
    color: #e8734a !important;
    border-radius: 10px !important;
}

.sidebar .nav-link.active {
    background-color: rgba(232, 115, 74, 0.12) !important;
    color: #e8734a !important;
    font-weight: 500 !important;
    border-radius: 10px !important;
}

.sidebar .nav-link .icon {
    color: inherit !important;
}

.sidebar .nav-link.active .icon svg,
.sidebar .nav-link:hover .icon svg {
    color: #e8734a !important;
}

/* Sidebar sub-menu items */
.sidebar .sub-nav .nav-link,
.sidebar-default .navbar-nav .nav-item .nav-link[data-bs-toggle="collapse"] ~ .sub-nav .nav-link {
    border-radius: 8px !important;
    margin: 1px 12px 1px 20px !important;
    padding: 8px 14px !important;
    font-size: 13px !important;
}

.sidebar .sub-nav .nav-link:hover {
    background-color: rgba(232, 115, 74, 0.06) !important;
    color: #e8734a !important;
}

.sidebar .sub-nav .nav-link.active {
    background-color: rgba(232, 115, 74, 0.1) !important;
    color: #e8734a !important;
    font-weight: 500 !important;
}

/* Sidebar header/logo area */
.sidebar .sidebar-header {
    padding: 16px 20px !important;
    border-bottom: 1px solid #f0f0f0 !important;
}

.dark .sidebar {
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15) !important;
}

.dark .sidebar .sidebar-header {
    border-bottom-color: #2d3148 !important;
}

.dark .sidebar .nav-link {
    color: #9ca3af !important;
}

.dark .sidebar .nav-link:hover {
    background-color: rgba(232, 115, 74, 0.1) !important;
    color: #e8734a !important;
}

.dark .sidebar .nav-link.active {
    background-color: rgba(232, 115, 74, 0.15) !important;
    color: #e8734a !important;
}

/* ─── Modern Tables ─── */
.table {
    border-radius: 12px !important;
    overflow: hidden !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.table thead th {
    background: #f8f9fc !important;
    border-bottom: 2px solid #eee !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.6px !important;
    color: #7c8290 !important;
    padding: 14px 16px !important;
    white-space: nowrap !important;
}

.table tbody td {
    vertical-align: middle !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    color: #3a3f51 !important;
    border-bottom: 1px solid #f2f3f7 !important;
}

.table tbody tr:last-child td {
    border-bottom: none !important;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.015) !important;
}

.table tbody tr:hover {
    background-color: rgba(232, 115, 74, 0.03) !important;
}

.dark .table thead th {
    background: #252840 !important;
    border-bottom-color: #2d3148 !important;
    color: #9ca3af !important;
}

.dark .table tbody td {
    color: #d1d5db !important;
    border-bottom-color: #2d3148 !important;
}

/* ─── DataTables Wrapper ─── */
.dataTables_wrapper {
    border-radius: 16px;
    background: white;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border-radius: 10px !important;
    border: 1.5px solid #e0e0e0 !important;
    padding: 6px 12px !important;
    font-size: 14px !important;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #e8734a !important;
    box-shadow: 0 0 0 3px rgba(232, 115, 74, 0.15) !important;
    outline: none !important;
}

.dataTables_wrapper .dataTables_info {
    font-size: 13px !important;
    color: #7c8290 !important;
    padding-top: 12px !important;
}

.dark .dataTables_wrapper {
    background: #1e2235;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

/* ─── Modern Badges ─── */
.badge {
    border-radius: 20px !important;
    padding: 5px 12px !important;
    font-weight: 500 !important;
    font-size: 12px !important;
    letter-spacing: 0.3px !important;
}

.badge.bg-primary,
.badge.badge-primary {
    background-color: rgba(232, 115, 74, 0.12) !important;
    color: #e8734a !important;
}

.badge.bg-success,
.badge.badge-success {
    background-color: rgba(39, 174, 96, 0.12) !important;
    color: #27ae60 !important;
}

.badge.bg-danger,
.badge.badge-danger {
    background-color: rgba(231, 76, 60, 0.12) !important;
    color: #e74c3c !important;
}

.badge.bg-warning,
.badge.badge-warning {
    background-color: rgba(249, 170, 0, 0.12) !important;
    color: #d4900a !important;
}

.badge.bg-info,
.badge.badge-info {
    background-color: rgba(7, 154, 162, 0.12) !important;
    color: #079aa2 !important;
}

/* ─── Modern Select2 ─── */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    border-radius: 10px !important;
    border: 1.5px solid #e0e0e0 !important;
    min-height: 42px !important;
    padding: 4px 8px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 32px !important;
    color: #3a3f51 !important;
    font-size: 14px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: #e8734a !important;
    box-shadow: 0 0 0 3px rgba(232, 115, 74, 0.15) !important;
}

.select2-dropdown {
    border-radius: 10px !important;
    border: 1.5px solid #e0e0e0 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
    margin-top: 4px !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: rgba(232, 115, 74, 0.1) !important;
    color: #e8734a !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border-radius: 8px !important;
    border: 1.5px solid #e0e0e0 !important;
    padding: 8px 12px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    border-radius: 6px !important;
    background-color: rgba(232, 115, 74, 0.1) !important;
    color: #e8734a !important;
    border: none !important;
    padding: 4px 8px !important;
    font-size: 13px !important;
}

/* ─── Modern Pagination ─── */
.page-link {
    border-radius: 8px !important;
    margin: 0 3px !important;
    border: none !important;
    color: #6b7280 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 8px 14px !important;
    background-color: transparent !important;
}

.page-link:hover {
    background-color: rgba(232, 115, 74, 0.08) !important;
    color: #e8734a !important;
}

.page-item.active .page-link {
    background-color: #e8734a !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(232, 115, 74, 0.3) !important;
}

.page-item.disabled .page-link {
    background-color: transparent !important;
    color: #c5c9d3 !important;
}

/* ─── Modern Navbar ─── */
.iq-navbar {
    background: #fff !important;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04) !important;
    border-bottom: none !important;
}

.dark .iq-navbar {
    background: #1e2235 !important;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.15) !important;
}

/* ─── Modern Dropdowns ─── */
.dropdown-menu {
    border-radius: 12px !important;
    border: none !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1) !important;
    padding: 8px !important;
    overflow: hidden !important;
}

.dropdown-item {
    border-radius: 8px !important;
    padding: 8px 14px !important;
    font-size: 14px !important;
    color: #3a3f51 !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(232, 115, 74, 0.08) !important;
    color: #e8734a !important;
}

.dark .dropdown-menu {
    background-color: #252840 !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3) !important;
}

.dark .dropdown-item {
    color: #d1d5db !important;
}

.dark .dropdown-item:hover {
    background-color: rgba(232, 115, 74, 0.12) !important;
    color: #e8734a !important;
}

/* ─── Modern Modals ─── */
.modal-content {
    border-radius: 16px !important;
    border: none !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15) !important;
    overflow: hidden !important;
}

.modal-header {
    border-bottom: 1px solid #f0f0f0 !important;
    padding: 20px 24px !important;
}

.modal-body {
    padding: 24px !important;
}

.modal-footer {
    border-top: 1px solid #f0f0f0 !important;
    padding: 16px 24px !important;
}

.dark .modal-content {
    background-color: #1e2235 !important;
}

.dark .modal-header {
    border-bottom-color: #2d3148 !important;
}

.dark .modal-footer {
    border-top-color: #2d3148 !important;
}

/* ─── Modern Alerts ─── */
.alert {
    border-radius: 12px !important;
    border: none !important;
    padding: 14px 20px !important;
    font-size: 14px !important;
}

/* ─── Auth / Login Page ─── */
.auth-card,
.sign-in-from {
    border-radius: 20px !important;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08) !important;
}

.sign-in-from .form-control {
    border-radius: 10px !important;
}

/* ─── Breadcrumbs ─── */
.breadcrumb {
    background: transparent !important;
    padding: 0 !important;
    font-size: 13px !important;
}

.breadcrumb-item a {
    color: #7c8290 !important;
    text-decoration: none !important;
}

.breadcrumb-item.active {
    color: #3a3f51 !important;
}

/* ─── Scrollbar Styling ─── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

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

/* ─── Sub-header / Page Header ─── */
.sub-header {
    padding: 20px 0 !important;
}

/* ─── Avatar styling ─── */
.avatar {
    border-radius: 12px !important;
}

.avatar-rounded {
    border-radius: 50% !important;
}

/* ─── Form Switch ─── */
.form-check-input {
    border-radius: 20px !important;
}

.form-check-input:checked {
    background-color: #e8734a !important;
    border-color: #e8734a !important;
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(232, 115, 74, 0.15) !important;
    border-color: #e8734a !important;
}

/* ─── Progress Bars ─── */
.progress {
    border-radius: 10px !important;
    height: 8px !important;
    background-color: #f0f1f5 !important;
}

.progress-bar {
    border-radius: 10px !important;
    background-color: #e8734a !important;
}

/* ─── Tooltip ─── */
.tooltip-inner {
    border-radius: 8px !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
}

/* ─── Toast ─── */
.toast {
    border-radius: 12px !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
}

/* ─── SweetAlert2 Overrides ─── */
.swal2-popup {
    border-radius: 16px !important;
}

.swal2-confirm {
    border-radius: 10px !important;
}

.swal2-cancel {
    border-radius: 10px !important;
}

/* ─── jQuery Confirm Overrides ─── */
.jconfirm .jconfirm-box {
    border-radius: 16px !important;
}

.jconfirm .jconfirm-box .jconfirm-buttons button {
    border-radius: 10px !important;
}

/* ─── Content area spacing ─── */
.conatiner-fluid.content-inner {
    padding: 0 24px !important;
}

@media (max-width: 767.98px) {
    .conatiner-fluid.content-inner {
        padding: 0 12px !important;
    }

    .card-body {
        padding: 16px !important;
    }

    .card-header {
        padding: 14px 16px !important;
    }
}

/* ─── Misc Cleanup ─── */
.border {
    border-color: #f0f0f0 !important;
}

hr {
    border-color: #f0f0f0 !important;
    opacity: 1 !important;
}

.dark .border {
    border-color: #2d3148 !important;
}

.dark hr {
    border-color: #2d3148 !important;
}

/* Link styling */
a {
    color: #e8734a;
    text-decoration: none;
}

a:hover {
    color: #d4623c;
}

/* ─── Specific HopeUI Override: Remove default sidebar active bar indicator ─── */
.sidebar-default .navbar-nav .nav-item .nav-link.active::before,
.sidebar-default .navbar-nav .nav-item .nav-link.active::after {
    display: none !important;
}

/* ─── Diet Program Day Builder ─── */
.day-builder-slot {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}
.day-builder-slot:last-child {
    border-bottom: none;
}
.day-builder-slot .slot-label {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.day-builder-recipe-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-top: 8px;
}
.day-builder-recipe-card img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}
.day-builder-macro {
    font-size: 12px;
    color: #6c757d;
}
.day-builder-totals {
    background: #f0f4f1;
    border-radius: 10px;
    padding: 10px 16px;
    margin-top: 12px;
}
.tier-tab.active {
    background: #e8734a !important;
    color: white !important;
}
.day-pill {
    min-width: 40px;
    text-align: center;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    background: #f0f0f0;
    border: none;
    font-size: 13px;
    font-weight: 500;
    color: #3a3f51;
}
.day-pill.active {
    background: #376B50;
    color: white;
}
.day-pill.has-data {
    border-bottom: 3px solid #376B50;
}
.day-pill:hover:not(.active) {
    background: #e0e0e0;
}
.tier-row {
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}
.tier-row:last-child {
    border-bottom: none;
}
