/* avatar image */
img.avatar.avatar-sm.me-3 {
    width: 70px;
    height: 70px;
    border-radius: 50%;
}

/* Language switcher dropdown (simple + modern) */
.language-switcher-menu .menu-link.language-switcher-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent !important;
}
.language-switcher-menu .menu-link.language-switcher-item:hover,
.language-switcher-menu .menu-link.language-switcher-item:focus {
    background: transparent !important;
    color: inherit;
}
.language-switcher-menu .menu-link.language-switcher-item.active {
    background: transparent !important;
}
.language-switcher-menu .language-flag {
    display: block;
    object-fit: cover;
    border-radius: 2px;
}
.border-rounded {
    border-radius: 50%;
}
.w-60px {
    width: 60px;
}
.h-60px {
    height: 60px;
}
.w-fit {
    width: fit-content;
}

.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e9ecef;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-marker {
    position: absolute;
    left: -20px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #e9ecef;
}

.timeline-content {
    padding-left: 10px;
}

.timeline-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
}

.timeline-text {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 0;
}

/* Search/filter bar in card header: keep inside card, allow wrap */
.card-header .search-filter-bar {
    min-width: 0;
    flex: 1 1 auto;
}
.card-header .search-filter-bar .form-control,
.card-header .search-filter-bar select {
    min-width: 0;
}

/* pagination */
.pagination {
    margin-bottom: 0;
}
.pagination .page-link {
    border: 1px solid #e1e3ea;
    color: #7e8299;
    background-color: #ffffff;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.475rem;
    margin: 0 2px;
}
.pagination .page-link:hover {
    background-color: #f8f9fa;
    border-color: #e1e3ea;
    color: #7e8299;
}
.pagination .page-item.active .page-link {
    background-color: #009ef7;
    border-color: #009ef7;
    color: #ffffff;
}
.pagination .page-item.disabled .page-link {
    background-color: #f8f9fa;
    border-color: #e1e3ea;
    color: #b5b5c3;
}
.pagination .page-link:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 158, 247, 0.25);
}

/* File Upload Component Styles */
.file-upload-container {
    margin-bottom: 1.5rem;
}

.file-upload-area {
    position: relative;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background-color: #f9fafb;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-upload-area:hover {
    border-color: #0d6efd;
    background-color: #f0f8ff;
}

.file-upload-area.dragover {
    border-color: #0d6efd;
    background-color: #e3f2fd;
    transform: scale(1.02);
}

.file-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.file-upload-content i {
    font-size: 3rem;
    color: #0d6efd;
    margin-bottom: 1rem;
}

.file-upload-text {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.file-upload-main-text {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    display: block;
}

.file-upload-sub-text {
    font-size: 0.875rem;
    color: #6b7280;
}

.file-preview {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.file-preview-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.file-preview-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.file-preview-name {
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
    text-align: center;
    word-break: break-word;
}

.file-remove-btn {
    margin-top: 0.5rem;
}

.file-remove-btn:hover {
    transform: translateY(-1px);
}
.trainer-of-month-row {
	--bs-table-bg: #fff8db;
}

.trainer-crown-badge {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 4px;
    border-radius: 999px;
}

.trainer-crown-icon {
    width: 28px;
    height: 28px;
}


.leaderboard-avatar {
	width: 40px;
	height: 40px;
	object-fit: cover;
	border-radius: 50%;
}
.trainer-profile-highlight {
    border: 3px solid #f6c000 !important;
    padding: 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fffaf0;
}

.trainer-profile-crown-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 4px;
    border-radius: 999px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.12);
}

.trainer-profile-crown-icon {
    width: 36px;
    height: 36px;
}

html[dir="rtl"] .accordion-button::after {
    margin-right: auto;
    margin-left: 0;
}
/* RTL layout fixes (Admin) */
@media (min-width: 992px) {
    /* Move fixed sidebar to the right in RTL */
    html[dir="rtl"] [data-kt-app-sidebar-fixed="true"] .app-sidebar {
        left: auto;
        right: 0;
    }

    /* Push main wrapper from the right instead of left in RTL */
    html[dir="rtl"] [data-kt-app-sidebar-fixed="true"] .app-wrapper {
        margin-right: calc(var(--bs-app-sidebar-width) + var(--bs-app-sidebar-gap-start, 0px) + var(--bs-app-sidebar-gap-end, 0px));
        margin-left: 0;
    }

    /* Push header from the right instead of left in RTL */
    html[dir="rtl"] [data-kt-app-header-fixed="true"][data-kt-app-sidebar-fixed="true"][data-kt-app-sidebar-push-header="true"] .app-header,
    html[dir="rtl"] [data-kt-app-header-fixed="true"][data-kt-app-header-stacked="true"][data-kt-app-sidebar-fixed="true"][data-kt-app-sidebar-push-header="true"] .app-header,
    html[dir="rtl"] [data-kt-app-header-fixed="true"][data-kt-app-sidebar-sticky="on"][data-kt-app-sidebar-push-header="true"] .app-header {
        right: calc(var(--bs-app-sidebar-width) + var(--bs-app-sidebar-gap-start, 0px) + var(--bs-app-sidebar-gap-end, 0px));
        left: 0;
    }

    /* Keep sidebar toggle icon at 0deg in RTL */
    html[dir="rtl"] .app-sidebar-toggle i {
        transform: rotateZ(0deg) !important;
    }

    /* Move modal close button to the left in RTL */
    html[dir="rtl"] .modal-header .btn-close {
        margin: calc(-.5 * var(--bs-modal-header-padding-y)) auto calc(-.5 * var(--bs-modal-header-padding-y)) calc(-.5 * var(--bs-modal-header-padding-x));
    }

    /* Select2: clear (X) icon on the left in RTL for all select inputs */
    html[dir="rtl"] .select2-container .select2-selection--single .select2-selection__clear {
        right: auto;
        left: 8px;
    }
    html[dir="rtl"] .select2-container--bootstrap5 .select2-selection__clear {
        right: auto;
        left: 1rem;
    }
    html[dir="rtl"] .select2-container .select2-selection--multiple .select2-selection__choice__remove {
        float: left;
        margin-left: 4px;
        margin-right: 0;
    }

    /* DataTables buttons: align to the right in RTL */
    html[dir="rtl"] .dataTables_wrapper .dt-buttons {
        float: right !important;
    }
}

/* btn-group inside content: row-reverse in RTL */
html[dir="rtl"] #kt_app_content_container .btn-group,
html[dir="rtl"] #kt_app_content_container .btn-group-vertical {
    flex-direction: row-reverse;
}

/* Generate UUID input-group: in RTL reverse order and curve borders from right */
html[dir="rtl"] .input-group-generate-uuid {
    flex-direction: row-reverse;
}
html[dir="rtl"] .input-group-generate-uuid .form-control {
    border-radius: 0 var(--bs-border-radius) var(--bs-border-radius) 0;
}
html[dir="rtl"] .input-group-generate-uuid .btn {
    border-radius: var(--bs-border-radius) 0 0 var(--bs-border-radius);
}

/* Notifications dropdown header: button on left, title on right in RTL */
html[dir="rtl"] #notifications-dropdown .menu-item:first-child .menu-content.d-flex {
    width: 100%;
    gap: 12px;
}
html[dir="rtl"] #notifications-dropdown .menu-item:first-child .menu-content.d-flex .ms-auto {
    /* Override Bootstrap ms-auto in RTL: push button to the left (inline-end) */
    margin-inline-start: 0 !important;
    margin-inline-end: auto !important;
}

/* Toastr: show on left in RTL (Arabic) */
html[dir="rtl"] #toast-container.toast-top-right {
    left: 12px;
    right: auto;
}
html[dir="rtl"] #toast-container .toast-message {
    text-align: right;
}


/* user book life  */
/* Book-style layout */
.book-outer {
    --book-bg: #f8f4ef;
    --book-page: #fefdfb;
    --book-border: #e8e0d5;
    --book-shadow: rgba(0,0,0,0.12);
}
.book-wrapper {
    display: flex;
    gap: 0;
    min-height: 72vh;
    max-width: 1100px;
    margin: 0 auto;
}
/* Spine / sidebar as book cover edge */
.book-spine {
    flex: 0 0 56px;
    background: linear-gradient(90deg, #c9b896 0%, #d4c4a8 8%, #b8a078 50%, #d4c4a8 92%, #c9b896 100%);
    border-radius: 8px 0 0 8px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
    gap: 0.75rem;
}
.book-spine .spine-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.5);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.book-spine .btn-back {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.25);
    border: 1px solid rgba(255,255,255,0.4);
    color: #5a4a3a;
    text-decoration: none;
    transition: background 0.2s;
}
.book-spine .btn-back:hover { background: rgba(255,255,255,0.45); color: #333; }
/* Main book block */
.book-main {
    flex: 1;
    background: var(--book-bg);
    border-radius: 0 12px 12px 0;
    box-shadow: 4px 4px 24px var(--book-shadow), -2px 0 12px rgba(0,0,0,0.06);
    padding: 1.5rem;
    position: relative;
    min-height: 560px;
}
.book-stage {
    position: relative;
    width: 100%;
    min-height: 500px;
}
/* Simple paginator: only active page visible */
.book-page {
    display: none;
    width: 100%;
    min-height: 480px;
    background: var(--book-page);
    border: 1px solid var(--book-border);
    border-radius: 8px;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: auto;
}
.book-page.active {
    display: block;
}

.health-page-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--book-border);
}

.health-page-title .page-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
}
.health-page-title .page-icon.icon-profile { background: linear-gradient(135deg, #6b7fd7 0%, #4a5fc1 100%); }
.health-page-title .page-icon.icon-measure { background: linear-gradient(135deg, #5cb85c 0%, #449d44 100%); }
.health-page-title .page-icon.icon-plans { background: linear-gradient(135deg, #f0ad4e 0%, #ec971f 100%); }
.health-page-title .page-icon.icon-logs { background: linear-gradient(135deg, #5bc0de 0%, #31b0d5 100%); }
.health-page-title h4 { margin: 0; font-size: 1.2rem; font-weight: 700; color: #333; }

/* User hero on profile page */
.book-profile-hero {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(107,127,215,0.08) 0%, rgba(74,95,193,0.05) 100%);
    border-radius: 12px;
    border: 1px solid var(--book-border);
}
.book-profile-hero .hero-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.book-profile-hero .hero-info h5 { margin: 0 0 0.25rem 0; font-size: 1.15rem; }
.book-profile-hero .hero-info .text-muted { font-size: 0.9rem; }

/* Icon buttons */
.btn-icon-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
}
.btn-icon-label .fa { font-size: 0.9em; }
.book-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--book-border);
}
.book-nav .btn {
    min-width: 44px;
    padding: 0.5rem 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.book-nav .page-indicator {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}