/**
 * DX_LMS_M_Dls_Components.css
 * Dokumentasi standar untuk aset
 */
/* ============================================================
   DLS Components — Reusable UI Components
   Learning Management System
   ============================================================ */

/* === Card Component === */
.dls-card {
    background-color: var(--dls-surface-container-lowest);
    border-radius: var(--dls-radius-lg);
    box-shadow: var(--dls-shadow-sm);
    border: 1px solid var(--dls-surface-variant);
    overflow: hidden;
    transition:
        box-shadow 0.3s ease,
        transform 0.2s ease;
}

.dls-card:hover {
    box-shadow: var(--dls-shadow-md);
}

/* Card list data styling: solid non-white, non-gradient card surface */
.course-card,
.dls-stat-card,
.dls-card {
    background-color: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
}

html.dark .course-card,
body.dark .course-card,
html.dark .dls-stat-card,
body.dark .dls-stat-card,
html.dark .dls-card,
body.dark .dls-card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

/* === Excel-like Table Styling === */
.dls-grade-table,
.dls-table,
.tinymce-content table,
.overflow-x-auto > table {
    width: 100%;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
}

.dls-grade-table th,
.dls-table th,
.tinymce-content table th,
.overflow-x-auto > table th {
    border: 1px solid #cbd5e1 !important;
    background-color: #f1f5f9 !important;
    color: #1e293b !important;
    font-weight: 700 !important;
    padding: 10px 14px !important;
    white-space: nowrap !important;
    text-align: center !important;
}

.dls-grade-table td,
.dls-table td,
.tinymce-content table td,
.overflow-x-auto > table td {
    border: 1px solid #e2e8f0 !important;
    padding: 10px 14px !important;
    vertical-align: middle !important;
}

.dls-grade-table tbody tr:nth-child(even) td,
.dls-table tbody tr:nth-child(even) td,
.overflow-x-auto > table tbody tr:nth-child(even) td {
    background-color: #f8fafc;
}

.dls-grade-table tbody tr:hover td,
.dls-table tbody tr:hover td,
.overflow-x-auto > table tbody tr:hover td {
    background-color: #eff6ff !important;
}

/* Dark mode Excel gridlines */
html.dark .dls-grade-table th,
html.dark .dls-table th,
html.dark .tinymce-content table th,
html.dark .overflow-x-auto > table th {
    border-color: #334155 !important;
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

html.dark .dls-grade-table td,
html.dark .dls-table td,
html.dark .tinymce-content table td,
html.dark .overflow-x-auto > table td {
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

html.dark .dls-grade-table tbody tr:nth-child(even) td,
html.dark .dls-table tbody tr:nth-child(even) td,
html.dark .overflow-x-auto > table tbody tr:nth-child(even) td {
    background-color: rgba(30, 41, 59, 0.4) !important;
}

html.dark .dls-grade-table tbody tr:hover td,
html.dark .dls-table tbody tr:hover td,
html.dark .overflow-x-auto > table tbody tr:hover td {
    background-color: rgba(51, 65, 85, 0.6) !important;
}

.dls-card-body {
    padding: var(--dls-stack-md);
}

.dls-card-image {
    width: 100%;
    height: 128px;
    object-fit: cover;
    background-color: var(--dls-surface-container-high);
}

/* === Button Components === */
.dls-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--dls-font-family);
    font-size: var(--dls-label-md-size);
    font-weight: var(--dls-label-md-weight);
    line-height: var(--dls-label-md-line);
    height: 44px;
    padding: 0 24px;
    border-radius: var(--dls-radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.dls-btn:active {
    transform: scale(0.95);
}

.dls-btn-primary {
    background-color: var(--dls-primary-container);
    color: var(--dls-on-primary);
    box-shadow: 0 4px 12px rgba(226, 6, 19, 0.25);
}

.dls-btn-primary:hover {
    background-color: var(--dls-primary);
    color: var(--dls-on-primary);
}

.dls-btn-secondary {
    background-color: var(--dls-secondary);
    color: var(--dls-on-secondary);
    box-shadow: 0 4px 12px rgba(67, 85, 185, 0.2);
}

.dls-btn-secondary:hover {
    background-color: var(--dls-on-secondary-fixed-variant);
    color: var(--dls-on-secondary);
}

.dls-btn-outline {
    background-color: #E2E8F0;
    color: #1E293B;
    border: 1px solid #CBD5E1;
}

.dls-btn-outline:hover {
    background-color: #CBD5E1;
    color: #0F172A;
}

.dls-btn-block {
    width: 100%;
}

.dls-btn-rounded {
    border-radius: var(--dls-radius-full);
}

/* === Badge/Pill Components === */
.dls-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--dls-radius-full);
    font-family: var(--dls-font-family);
    font-size: var(--dls-label-sm-size);
    font-weight: var(--dls-label-sm-weight);
    line-height: var(--dls-label-sm-line);
    letter-spacing: var(--dls-label-sm-spacing);
    white-space: nowrap;
}

.dls-badge-success {
    background-color: rgba(23, 130, 41, 0.1);
    color: var(--dls-tertiary);
}

.dls-badge-primary {
    background-color: rgba(226, 6, 19, 0.1);
    color: var(--dls-primary);
}

.dls-badge-secondary {
    background-color: rgba(133, 150, 255, 0.2);
    color: var(--dls-secondary);
}

.dls-badge-surface {
    background-color: var(--dls-surface-container-high);
    color: var(--dls-on-surface);
}

.dls-badge-tertiary-container {
    background-color: var(--dls-tertiary-container);
    color: var(--dls-on-tertiary-container);
}

/* === Progress Bar === */
.dls-progress {
    width: 100%;
    height: 6px;
    background-color: var(--dls-surface-container-high);
    border-radius: var(--dls-radius-full);
    overflow: hidden;
}

.dls-progress-bar {
    height: 100%;
    border-radius: var(--dls-radius-full);
    transition: width 0.5s ease;
}

.dls-progress-bar-primary {
    background-color: var(--dls-primary-container);
}

.dls-progress-bar-secondary {
    background-color: var(--dls-secondary);
}

.dls-progress-bar-tertiary {
    background-color: var(--dls-tertiary);
}

/* === Tab Navigation === */
.dls-tab-nav {
    display: flex;
    border-bottom: 1px solid var(--dls-outline-variant);
    background-color: var(--dls-surface);
    position: sticky;
    top: var(--dls-topbar-height);
    z-index: 30;
}

.dls-tab-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    font-family: var(--dls-font-family);
    font-size: var(--dls-label-md-size);
    font-weight: var(--dls-label-md-weight);
    color: var(--dls-on-surface-variant);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.dls-tab-item:hover {
    color: var(--dls-on-surface);
    background-color: var(--dls-surface-container-low);
}

.dls-tab-item.active {
    color: var(--dls-secondary);
    border-bottom-color: var(--dls-secondary);
    font-weight: 700;
}

/* === Top App Bar === */
.dls-topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    background-color: var(--dls-surface);
    border-bottom: 1px solid var(--dls-outline-variant);
    height: var(--dls-topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--dls-container-margin);
    transition:
        left 0.3s ease,
        width 0.3s ease;
}

@media (min-width: 768px) {
    .dls-topbar {
        left: 100px;
        width: calc(100% - 100px);
    }
}
@media (min-width: 1024px) {
    .dls-topbar {
        left: 256px;
        width: calc(100% - 256px);
    }
}

.dls-topbar-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--dls-font-family);
    font-size: var(--dls-headline-md-size);
    font-weight: var(--dls-headline-md-weight);
    color: var(--dls-primary);
    letter-spacing: -0.01em;
}

.dls-topbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--dls-radius-full);
    border: none;
    background: none;
    color: var(--dls-on-surface-variant);
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
    position: relative;
}

.dls-topbar-btn:hover {
    background-color: var(--dls-surface-container-low);
}

.dls-topbar-btn:active {
    transform: scale(0.95);
}

.dls-topbar-btn .material-symbols-outlined {
    color: var(--dls-primary);
}

/* Notification badge dot */
.dls-notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--dls-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 700;
    color: var(--dls-on-primary);
}

/* === Bottom Navigation Bar (Responsive Sidebar on Desktop) === */
.dls-bottomnav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 60;
    background-color: var(--dls-surface);
    box-shadow: var(--dls-shadow-nav);
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 8px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    transition: all 0.3s ease;
}

.dls-bottomnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 16px;
    border-radius: var(--dls-radius-lg);
    text-decoration: none;
    color: var(--dls-on-surface-variant);
    transition: background-color 0.1s ease;
    cursor: pointer;
    border: none;
    background: none;
}

.dls-bottomnav-item:hover {
    background-color: var(--dls-surface-container-high);
}

.dls-bottomnav-item .material-symbols-outlined {
    margin-bottom: 2px;
}

.dls-bottomnav-item span:last-child {
    font-family: var(--dls-font-family);
    font-size: var(--dls-label-sm-size);
    font-weight: var(--dls-label-sm-weight);
    line-height: var(--dls-label-sm-line);
}

.dls-bottomnav-item.active {
    color: var(--dls-secondary);
    background-color: rgba(133, 150, 255, 0.2);
    border-radius: var(--dls-radius-lg);
}

.dls-bottomnav-item.active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1;
}

/* Sidebar behavior on tablet+ */
@media (min-width: 768px) {
    .dls-bottomnav {
        top: 0;
        bottom: 0;
        width: 100px;
        height: 100dvh;
        border-radius: 0;
        border-right: 1px solid var(--dls-outline-variant);
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 24px;
        box-shadow: none;
    }
    .dls-bottomnav-item {
        margin-bottom: 24px;
        padding: 12px;
        width: 80%;
    }
}

/* Expanded Sidebar behavior on desktop */
@media (min-width: 1024px) {
    .dls-bottomnav {
        width: 256px;
        align-items: flex-start;
        padding-top: 32px;
        padding-left: 24px;
        padding-right: 24px;
    }
    .dls-bottomnav-item {
        flex-direction: row;
        width: 100%;
        justify-content: flex-start;
        padding: 12px 16px;
        margin-bottom: 8px;
    }
    .dls-bottomnav-item .material-symbols-outlined {
        margin-bottom: 0;
        margin-right: 16px;
    }
    .dls-bottomnav-item span:last-child {
        font-size: var(--dls-body-md-size);
    }
}

/* === Notification Bubble === */
.dls-notif-bubble {
    background-color: var(--dls-surface-container-lowest);
    border-radius: 16px;
    border-top-left-radius: 4px;
    padding: 16px;
    box-shadow: var(--dls-shadow-sm);
    border: 1px solid var(--dls-surface-variant);
    position: relative;
}

.dls-notif-bubble .dls-unread-dot {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 8px;
    height: 8px;
    background-color: var(--dls-primary);
    border-radius: 50%;
}

/* === Modal/Dialog ===
 * NOTE: Modals are now handled by SweetAlert2.
 * See DLS.confirm(), DLS.success(), DLS.error(), DLS.toast() in DX_LMS_Tailwind_Head.php
 */

/* === Input Components === */
.dls-input-group {
    position: relative;
    width: 100%;
}

.dls-input {
    width: 100%;
    height: 52px;
    padding: 14px 16px 14px 48px;
    background-color: var(--dls-surface-container-lowest);
    border: 1px solid var(--dls-outline-variant);
    border-radius: var(--dls-radius-lg);
    font-family: var(--dls-font-family);
    font-size: var(--dls-body-lg-size);
    color: var(--dls-on-surface);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
    outline: none;
}

.dls-input::placeholder {
    color: var(--dls-on-surface-variant);
    opacity: 0.6;
}

.dls-input:focus {
    border-color: var(--dls-secondary);
    box-shadow: 0 0 0 2px rgba(67, 85, 185, 0.15);
}

.dls-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dls-on-surface-variant);
}

.dls-input-action {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--dls-on-surface-variant);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dls-input-action:hover {
    background-color: var(--dls-surface-container-low);
}

/* Hide native Edge/IE password reveal icon */
input::-ms-reveal {
    display: none !important;
}
input::-ms-clear {
    display: none !important;
}

/* === Role Selection Card === */
.dls-role-card {
    display: flex;
    align-items: center;
    gap: var(--dls-stack-md);
    padding: var(--dls-stack-md);
    background-color: var(--dls-surface-container-lowest);
    border: 2px solid var(--dls-outline-variant);
    border-radius: var(--dls-radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.dls-role-card:hover {
    border-color: var(--dls-on-surface-variant);
}

.dls-role-card.selected {
    border-color: var(--dls-primary-container);
    background-color: rgba(226, 6, 19, 0.04);
}

.dls-role-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dls-role-card-check {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
}

.dls-role-card.selected .dls-role-card-check {
    display: flex;
}

/* === Menu List Item === */
.dls-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--dls-stack-md);
    background-color: var(--dls-surface-container-lowest);
    border: none;
    border-bottom: 1px solid var(--dls-surface-variant);
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.dls-menu-item:hover {
    background-color: var(--dls-surface-container-low);
}

.dls-menu-item:last-child {
    border-bottom: none;
}

.dls-menu-item-left {
    display: flex;
    align-items: center;
    gap: var(--dls-stack-md);
}

.dls-menu-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--dls-surface-container);
    color: var(--dls-secondary);
    transition: background-color 0.2s ease;
}

.dls-menu-item:hover .dls-menu-item-icon {
    background-color: rgba(133, 150, 255, 0.2);
}

.dls-menu-item-label {
    font-family: var(--dls-font-family);
    font-size: var(--dls-label-md-size);
    font-weight: var(--dls-label-md-weight);
    color: var(--dls-on-surface);
}

/* Highlighted menu item */
.dls-menu-item.highlighted {
    background-color: rgba(133, 150, 255, 0.1);
    position: relative;
}

.dls-menu-item.highlighted::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--dls-secondary);
}

.dls-menu-item.highlighted .dls-menu-item-label {
    font-weight: 700;
}

.dls-menu-item.highlighted .dls-menu-item-icon {
    background-color: rgba(133, 150, 255, 0.3);
}

/* Danger menu item */
.dls-menu-item.danger:hover {
    background-color: rgba(255, 218, 214, 0.2);
}

.dls-menu-item.danger .dls-menu-item-icon {
    background-color: rgba(255, 218, 214, 0.3);
    color: var(--dls-error);
}

.dls-menu-item.danger .dls-menu-item-label {
    color: var(--dls-error);
}

/* === Line Clamp === */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === Scrollbar Hide === */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* === Ring/Circle Progress (SVG based) === */
.dls-ring-progress {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dls-ring-progress svg {
    transform: rotate(-90deg);
}

.dls-ring-progress .dls-ring-value {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   SweetAlert2 DLS Theme Override
   Custom styling untuk SweetAlert2 agar sesuai dengan DLS Design System
   ============================================================ */

.swal2-popup {
    font-family: 'Inter', system-ui, sans-serif !important;
    border-radius: 24px !important;
    padding: 32px 24px 24px !important;
}

.swal2-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: var(--dls-on-surface) !important;
}

.swal2-html-container {
    font-size: 14px !important;
    color: var(--dls-on-surface-variant) !important;
}

.swal2-confirm {
    background-color: var(--dls-primary) !important;
    border-radius: 9999px !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    padding: 12px 24px !important;
    box-shadow: 0 4px 12px rgba(67, 85, 185, 0.2) !important;
}

.swal2-cancel {
    background-color: #f1f5f9 !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 9999px !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    padding: 12px 24px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

/* ============================================================
   Floating Draggable Guide Bubble (? Bubble) for Student Portal
   ============================================================ */
.dls-student-floating-guide-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.dls-student-floating-guide-bubble.is-dragging {
    cursor: grabbing;
    transform: scale(1.06);
    opacity: 0.9;
}

.dls-student-floating-guide-bubble:hover:not(.is-dragging) {
    transform: scale(1.1);
}

.dls-student-floating-guide-bubble:active:not(.is-dragging) {
    transform: scale(0.95);
}

.dls-student-floating-guide-bubble .dls-bubble-inner {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #dc2626;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: background-color 0.15s ease;
}

.dls-student-floating-guide-bubble:hover .dls-bubble-inner {
    background-color: #b91c1c;
}

html.dark .dls-student-floating-guide-bubble .dls-bubble-inner {
    border-color: #1e293b;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.dls-student-floating-guide-bubble .dls-bubble-symbol {
    font-size: 20px;
    font-weight: 700;
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1;
    user-select: none;
}

/* ============================================================
   Driver.js DENSO Theme Styling for Student Portal
   ============================================================ */
.driver-popover {
    border-radius: 14px !important;
    padding: 16px 18px 14px !important;
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.22), 0 8px 12px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #cbd5e1 !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    width: auto !important;
    max-width: min(360px, calc(100vw - 24px)) !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    box-sizing: border-box !important;
}

@media (max-width: 640px) {
    .dls-student-floating-guide-bubble {
        bottom: 84px;
        right: 16px;
    }
    .driver-popover {
        padding: 14px 14px 12px !important;
        max-width: calc(100vw - 20px) !important;
    }
    .driver-popover-footer {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }
}

html.dark .driver-popover {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

.driver-popover-title {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin-bottom: 6px !important;
}

html.dark .driver-popover-title {
    color: #f8fafc !important;
}

.driver-popover-description {
    font-size: 13px !important;
    line-height: 1.55 !important;
    color: #475569 !important;
    margin-bottom: 14px !important;
}

html.dark .driver-popover-description {
    color: #94a3b8 !important;
}

.driver-popover-next-btn {
    background-color: #dc2626 !important;
    color: #ffffff !important;
    border: 1px solid #dc2626 !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 6px 12px !important;
    cursor: pointer !important;
}

.driver-popover-prev-btn {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 6px 12px !important;
    cursor: pointer !important;
}

html.dark .driver-popover-prev-btn {
    background-color: #334155 !important;
    color: #e2e8f0 !important;
    border-color: #475569 !important;
}

.swal2-deny {
    background-color: var(--dls-primary-container) !important;
    border-radius: 9999px !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 500 !important;
}

.swal2-popup.swal2-toast {
    border-radius: 12px !important;
    padding: 12px 16px !important;
}

.dls-swal-popup {
    border-radius: 18px !important;
    max-width: min(440px, calc(100vw - 24px)) !important;
    padding: 22px 20px 18px !important;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22) !important;
}

.dls-swal-popup .swal2-footer {
    font-size: 12px !important;
    color: #64748b !important;
    border-top: 1px solid rgba(148, 163, 184, 0.25) !important;
    margin-top: 14px !important;
    padding-top: 10px !important;
}
