:root {
    --primary-color: #246bfd;
    --primary-light: #e9f0ff;
    --secondary-color: #ff8c00;
    --success-color: #16a34a;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f6f8fb;
    --app-bg: #ffffff;
    --text-primary: #181a20;
    --text-secondary: #757c8e;
    --text-main: #181a20;
    --text-muted: #757c8e;
    --border-color: #f0f0f5;
    --card-shadow: 0 10px 30px rgba(0,0,0,0.05);
    --transition: all 0.25s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* Custom Premium Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
}
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.4); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.7); }
::-webkit-scrollbar-button { display: none !important; width: 0; height: 0; }
::-webkit-scrollbar-corner { background: transparent; }

body {
    background-color: #e0f0f8;
    display: flex;
    justify-content: center;
    align-items: center;
    height: var(--app-height, 100dvh);
    min-height: var(--app-height, 100dvh);
    width: 100%;
    margin: 0;
    overflow: hidden;
    position: fixed; /* Ultimate iOS body scroll lock */
    -webkit-text-size-adjust: 100%;
}

/* === Page Transition (Pengganti hx-boost) === */
/* Fade in saat halaman pertama kali tampil */
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.app-container {
    animation: pageFadeIn 0.22s ease-out both;
}
/* Saat navigasi keluar (ditambahkan via JS) */
body.page-leaving .app-container {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.15s ease-in, transform 0.15s ease-in;
}

/* Main App Container simulating mobile screen */
.app-container {
    width: 100%;
    max-width: 100%;
    height: var(--app-height, 100dvh);
    background-color: var(--app-bg);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@media (min-width: 480px) {
    .app-container {
        max-width: 414px; /* iPhone Max width */
        height: 90vh;
        max-height: 896px;
        border-radius: 30px;
        box-shadow: 0 25px 50px rgba(0,0,0,0.1);
    }
}

.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 120px; /* Ensure content clears bottom nav */
    -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
}

/* Hide scrollbar */
.main-content::-webkit-scrollbar,
.horizontal-scroll::-webkit-scrollbar,
.categories-scroll::-webkit-scrollbar {
    display: none;
}
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-logo {
    height: 32px;
    object-fit: contain;
}

.brand-text {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.2px;
}

.avatar-sm {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.greeting-section {
    padding: 0 24px 16px;
}

.greeting-section h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.greeting-section p {
    font-size: 14px;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    gap: 12px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--text-main);
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--bg-color);
}

.icon-btn.notification {
    position: relative;
}

.badge {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 8px;
    height: 8px;
    background-color: #ff4747;
    border-radius: 50%;
    border: 2px solid var(--app-bg);
}

/* Search Section */
.search-section {
    padding: 0 24px 16px;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--bg-color);
    border-radius: 16px;
    padding: 12px 16px;
    gap: 12px;
}

.search-icon, .filter-icon {
    color: var(--text-muted);
    width: 20px;
    height: 20px;
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 15px;
    color: var(--text-main);
    outline: none;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

/* Categories Scroll */
.categories-scroll {
    display: flex;
    gap: 12px;
    padding: 8px 24px 16px;
    overflow-x: auto;
    white-space: nowrap;
}

.category-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    background: var(--app-bg);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.category-chip .sm-icon {
    width: 16px;
    height: 16px;
    color: var(--primary-color);
}

.category-chip.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.category-chip.active .sm-icon {
    color: white;
}
.category-chip:not(.active):hover {
    background: var(--bg-color);
}

/* Sections */
.section {
    padding: 16px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px 16px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.see-all {
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

/* Horizontal Courses Scroll */
.courses-scroll {
    display: flex;
    gap: 16px;
    padding: 8px 24px 12px; /* Added spacing from header */
    overflow-x: auto;
}

.course-card {
    min-width: 240px;
    width: 240px;
    background: var(--app-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease;
}

.course-card:active {
    transform: scale(0.98);
}

.card-image-wrap {
    position: relative;
    height: 140px;
    padding: 12px;
}

.card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.fav-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: white;
}

.fav-btn .heart-icon {
    width: 16px;
    height: 16px;
}

.fav-btn.active .heart-icon.fill {
    fill: white;
    color: white;
}

.card-content {
    padding: 12px 16px 20px;
}

.course-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-main);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-meta {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.course-meta .dot {
    margin: 0 4px;
}

.star-icon {
    width: 14px;
    height: 14px;
    color: #ffc107;
    margin-right: 2px;
}
.star-icon.fill {
    fill: #ffc107;
}

.course-meta .rating {
    color: var(--text-main);
    font-weight: 600;
}

.course-price {
    display: flex;
    align-items: center;
    gap: 8px;
}

.course-price .price {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.course-price .old-price {
    font-size: 13px;
    color: #ff8b9f;
    text-decoration: line-through;
    font-weight: 500;
}


/* Continue Learning Section */
.continue-learning {
    padding: 16px 24px;
}

.continue-learning .section-header {
    padding: 0 0 16px 0;
}

.progress-card {
    display: flex;
    align-items: center;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--app-bg);
    margin-bottom: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.progress-img {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    overflow: hidden;
    margin-right: 16px;
    flex-shrink: 0;
}

.progress-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.progress-info {
    flex: 1;
}

.tag {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 4px;
}

.tag-blue {
    background-color: var(--primary-light);
    color: var(--primary-color);
}
.tag-orange {
    background-color: #fff0df;
    color: var(--secondary-color);
}

.progress-info h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.enroll-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avatar-group {
    display: flex;
}

.avatar-group img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid var(--app-bg);
    margin-left: -6px;
}
.avatar-group img:first-child {
    margin-left: 0;
}

.enroll-count {
    font-size: 12px;
    color: var(--text-muted);
}

.progress-circle-wrap {
    position: relative;
    width: 50px;
    height: 50px;
    margin-left: 12px;
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.35s;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.progress-ring__circle.bg {
    stroke: var(--primary-light);
}
.progress-ring__circle.fg {
    stroke-linecap: round;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-main);
}


/* Bottom Navigation */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 16px 32px 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    background: var(--app-bg);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -10px 20px rgba(0,0,0,0.02);
    z-index: 9999;
    transform: translateZ(0); /* Force hardware acceleration on iOS */
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text-muted);
    transition: var(--transition);
}

.nav-item i {
    width: 24px;
    height: 24px;
}

.nav-item span {
    font-size: 11px;
    font-weight: 600;
}

.nav-item.active {
    color: var(--primary-color);
}
.nav-item:hover:not(.active) {
    color: var(--text-main);
}

/* Tutors Section */
.tutors-scroll {
    display: flex;
    gap: 20px;
    padding: 8px 24px 12px;
    overflow-x: auto;
}

.tutor-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 72px;
}

.tutor-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
    border: 2px solid transparent;
    transition: var(--transition);
}

.tutor-card:hover .tutor-avatar {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.tutor-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
    white-space: nowrap;
}

/* Detail Page Styles */
.detail-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    z-index: 100;
    background: transparent;
}
.detail-header .back-btn {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
}
.detail-header .icon-btn {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border: none;
}
.detail-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.8);
    padding: 6px 12px;
    border-radius: 12px;
    backdrop-filter: blur(8px);
}

.detail-content {
    padding-bottom: 80px;
}

.detail-hero {
    position: relative;
    height: 300px;
    width: 100%;
}

.detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge-group {
    position: absolute;
    bottom: 32px;
    left: 24px;
    display: flex;
    gap: 8px;
}

.badge-tag {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    backdrop-filter: blur(8px);
}

.badge-tag.online {
    background: rgba(36, 107, 253, 0.9);
}
.badge-tag.period {
    background: rgba(255, 140, 0, 0.9);
}
.tiny-icon {
    width: 12px;
    height: 12px;
}

.detail-body {
    padding: 24px;
    background: var(--app-bg);
    border-radius: 30px 30px 0 0;
    margin-top: -24px;
    position: relative;
    z-index: 2;
}

.detail-title {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.4;
    color: var(--text-main);
    margin-bottom: 16px;
}

.detail-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.tutor-info-sm {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

.tutor-info-sm img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.rating-info {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
}
.rating-info strong {
    color: var(--text-main);
}

.tab-nav {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content-panel {
    display: none !important;
}

.tab-content-panel.active {
    display: block !important;
    animation: cdFadeIn 0.3s ease;
}

@keyframes cdFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.info-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-color);
    border-radius: 16px;
}

.info-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
}
.info-icon.bg-blue { background: var(--primary-color); }
.info-icon.bg-orange { background: var(--secondary-color); }

.info-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.info-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.schedule-section h3, .about-section h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}

.schedule-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
}

.timeline {
    border-left: 2px solid var(--primary-light);
    margin-left: 8px;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.timeline-item {
    position: relative;
}

.timeline-dot {
    position: absolute;
    left: -27px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid var(--app-bg);
}

.timeline-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.timeline-content p {
    font-size: 12px;
    color: var(--text-muted);
}

.about-section p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

.bottom-cta {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--app-bg);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -10px 20px rgba(0,0,0,0.02);
}

.price-info {
    display: flex;
    flex-direction: column;
}

.price-info .label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.price-info .price {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-color);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(36, 107, 253, 0.3);
    transition: var(--transition);
}
}

/* My Courses Page */
.page-header {
    justify-content: flex-start;
    gap: 16px;
    padding: 20px 24px;
}
.page-header h2 {
    font-size: 20px;
    font-weight: 700;
    flex: 1;
}
.sticky-tab {
    padding: 0 24px;
    position: sticky;
    top: 0;
    background: var(--app-bg);
    z-index: 10;
}
.course-list-vertical {
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.enrolled-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}
.enrolled-card {
    align-items: flex-start;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}
.enrolled-card:active {
    transform: scale(0.98);
}
.next-schedule {
    font-size: 11px;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    font-weight: 600;
}
.next-schedule i {
    width: 12px;
    height: 12px;
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 4px;
    margin-bottom: 4px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
}
.progress-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}
.mt-12 { margin-top: 12px; }
.mt-24 { margin-top: 24px; }

/* My Course Detail (Active Course) */
.video-player-section {
    position: relative;
    width: 100%;
    height: 240px;
    background: #111;
    z-index: 100;
}
.back-btn-overlay {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    z-index: 101;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('https://images.unsplash.com/photo-1618761714954-0b8cd0026356?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80') center/cover;
}
.play-icon-huge {
    width: 64px;
    height: 64px;
    color: white;
    opacity: 0.9;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
    cursor: pointer;
}

.has-video {
    background: var(--app-bg);
}
.course-header-info {
    padding: 24px;
    background: var(--app-bg);
}
.course-header-info h2 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 4px;
}
.course-header-info p {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.scrollable-tabs {
    padding: 0 24px;
    overflow-x: auto;
    white-space: nowrap;
    gap: 24px;
    display: flex;
}
.scrollable-tabs .tab-btn {
    flex: none;
    padding: 12px 0;
}

.modules-list {
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.module-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--app-bg);
}
.module-item.completed {
    background: var(--bg-color);
}
.module-item.completed .module-icon {
    color: #4caf50;
}
.module-item.active-module {
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(36, 107, 253, 0.08);
}
.module-item.active-module .module-icon {
    color: var(--primary-color);
}
.module-item.locked {
    opacity: 0.5;
}
.module-item.locked .module-icon {
    color: var(--text-muted);
}
.module-icon i {
    width: 24px;
    height: 24px;
}
.module-text h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}
.module-text p {
    font-size: 12px;
    color: var(--text-muted);
}

/* Billing Card */
.billing-card {
    margin: 0 24px;
    padding: 20px;
    border-radius: 20px;
    background: linear-gradient(135deg, #fff9f2 0%, #fff 100%);
    border: 1px solid #ffe4cc;
}
.billing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.billing-header h3 {
    font-size: 15px;
    font-weight: 700;
}
.status-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
}
.status-badge.unpaid {
    background: #ffeaeb;
    color: #ff4747;
}
.billing-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.billing-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.billing-price-row .price-val {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
}
.btn-sm {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

/* Attendance Section */
.attendance-section {
    padding: 0 24px;
}
.section-header-sm {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.section-header-sm h3 {
    font-size: 16px;
    font-weight: 700;
}
.attendance-score {
    font-size: 11px;
    font-weight: 700;
    color: #4caf50;
    background: #e8f5e9;
    padding: 4px 10px;
    border-radius: 8px;
}
.attendance-stats {
    display: flex;
    gap: 12px;
}
.stat-box {
    flex: 1;
    background: var(--bg-color);
    border-radius: 16px;
    padding: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid var(--border-color);
}
.stat-num {
    font-size: 20px;
    font-weight: 800;
}
.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}
.text-green { color: #4caf50; }
.text-orange { color: var(--secondary-color); }
.text-red { color: #ff4747; }

.attendance-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.attendance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--app-bg);
}
.att-info h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}
.att-info p {
    font-size: 11px;
    color: var(--text-muted);
}
.att-status {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
}
.att-status.present {
    background: #e8f5e9;
    color: #4caf50;
}
.att-status.pending {
    background: var(--bg-color);
    color: var(--text-muted);
}

/* Bottom Sheet Modal */
.bottom-sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.bottom-sheet-overlay.active {
    opacity: 1;
    visibility: visible;
}
.bottom-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 75%; /* Force height to 75% as requested */
    background: var(--app-bg);
    border-radius: 24px 24px 0 0;
    padding: 24px 24px 40px;
    z-index: 1001;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}
.bottom-sheet.active {
    transform: translateY(0);
}
.bs-handle {
    width: 40px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 4px;
    margin: -8px auto 24px;
}
.bs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.bs-header h3 {
    font-size: 18px;
    font-weight: 800;
}
.bs-close {
    background: var(--bg-color);
    border: none;
    color: var(--text-main);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
.bs-search {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}
.bs-search input {
    border: none;
    background: transparent;
    flex: 1;
    outline: none;
    font-size: 14px;
    color: var(--text-main);
}
.bs-content {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.bs-content::-webkit-scrollbar { display: none; }

.materi-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--app-bg);
    cursor: pointer;
    transition: var(--transition);
}
.materi-item:active {
    transform: scale(0.98);
}
.materi-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
}
.materi-icon.vid { background: var(--primary-color); }
.materi-icon.pdf { background: #ff4747; }
.materi-icon.ppt { background: #ff8c00; }

.materi-info h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}
.materi-info p {
    font-size: 11px;
    color: var(--text-muted);
}

/* Messages List */
.chat-list { display: flex; flex-direction: column; }
.chat-item {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}
.chat-item:active { background: var(--bg-color); }
.chat-avatar {
    position: relative;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}
.chat-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #4caf50;
    border: 2px solid white;
    border-radius: 50%;
}
.chat-info { flex: 1; overflow: hidden; }
.chat-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.chat-name { font-size: 15px; font-weight: 700; color: var(--text-main); }
.chat-time { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.chat-snippet { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chat-msg { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread-badge { background: var(--primary-color); color: white; font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; display: flex; justify-content: center; align-items: center; border-radius: 9px; padding: 0 5px; flex-shrink: 0; }

/* FAB */
.fab {
    position: fixed;
    bottom: 84px; /* above bottom nav */
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 28px;
    background: var(--primary-color);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 20px rgba(36, 107, 253, 0.4);
    cursor: pointer;
    z-index: 90;
    border: none;
    transition: transform 0.2s;
}
.fab:active { transform: scale(0.9); }

/* Option Menu / Popup */
.fab-menu {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.menu-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 16px;
    background: var(--bg-color);
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}
.menu-option:active { transform: scale(0.98); }
.menu-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    flex-shrink: 0;
}
.menu-option h4 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.menu-option p { font-size: 11px; color: var(--text-muted); }

/* Chat Detail Page */
.chat-detail-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--app-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}
.chat-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    margin-left: 8px;
}
.chat-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.chat-profile-info h3 { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.chat-profile-info p { font-size: 11px; color: #4caf50; font-weight: 600; }
.chat-actions {
    display: flex;
    gap: 16px;
    color: var(--primary-color);
    cursor: pointer;
}

.chat-room {
    padding: 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 90px;
}
.chat-date {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin: 8px 0;
}
.bubble {
    max-width: 75%;
    padding: 12px 16px;
    font-size: 13.5px;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.bubble-in {
    align-self: flex-start;
    background: var(--bg-color);
    color: var(--text-main);
    border-radius: 20px 20px 20px 4px;
}
.bubble-out {
    align-self: flex-end;
    background: var(--primary-color);
    color: white;
    border-radius: 20px 20px 4px 20px;
}
.bubble-time {
    display: block;
    font-size: 10px;
    margin-top: 6px;
    opacity: 0.7;
    text-align: right;
}

.chat-input-area {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--app-bg);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--border-color);
    z-index: 100;
}
.chat-input-wrapper {
    flex: 1;
    background: var(--bg-color);
    border-radius: 24px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
    transition: var(--transition);
}
.chat-input-wrapper:focus-within {
    border-color: var(--primary-light);
    background: white;
}
.chat-input-wrapper input {
    border: none;
    background: transparent;
    flex: 1;
    outline: none;
    font-size: 14px;
}
.btn-send {
    width: 44px;
    height: 44px;
    border-radius: 22px;
    background: var(--primary-color);
    color: white;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(36, 107, 253, 0.3);
    transition: transform 0.2s;
    flex-shrink: 0;
}
.btn-send:active {
    transform: scale(0.9);
}

/* Profile Page */
.profile-hero {
    background: var(--app-bg);
    border-radius: 0 0 32px 32px;
    padding-bottom: 24px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.02);
    margin-bottom: 16px;
    position: relative;
}
.profile-cover {
    height: 140px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    position: relative;
}
.settings-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255,255,255,0.2);
    color: white;
    backdrop-filter: blur(8px);
    border: none;
}
.profile-avatar-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    margin: -50px auto 16px;
}
.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--app-bg);
    background: white;
}
.edit-avatar-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: 3px solid var(--app-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
.edit-avatar-btn i { width: 14px; height: 14px; }
.profile-info-main {
    text-align: center;
    padding: 0 24px;
}
.profile-info-main h2 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 4px;
}
.profile-info-main p {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 20px;
}
.profile-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    background: var(--bg-color);
    border-radius: 20px;
    padding: 16px;
    border: 1px solid var(--border-color);
}
.stat-item h4 {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 2px;
}
.stat-item p {
    font-size: 11px;
    color: var(--text-muted);
}
.stat-divider {
    width: 1px;
    height: 30px;
    background: var(--border-color);
}

.profile-menu-section {
    padding: 0 24px;
    margin-bottom: 24px;
}
.profile-menu-section h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.menu-list {
    background: var(--app-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}
.menu-list-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    text-decoration: none;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}
.menu-list-item:last-child {
    border-bottom: none;
}
.menu-list-item:active {
    background: var(--bg-color);
}
.menu-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    margin-right: 16px;
}
.menu-text {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
}
.chevron {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

/* Toggle Switch */
.toggle-switch {
    width: 44px;
    height: 24px;
    background: #e0e0e0;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}
.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.toggle-switch.active {
    background: var(--primary-color);
}
.toggle-switch.active::after {
    transform: translateX(20px);
}

.btn-logout {
    width: 100%;
    background: #fff0f0;
    color: #ff4747;
    border: 1px solid #ffd6d6;
    padding: 16px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
}
.btn-logout:active {
    transform: scale(0.98);
}

/* ----------------------------------
   Enterprise Android App Animations
----------------------------------- */

/* Top Loading Bar (HTMX Request) */
.htmx-request {
    position: relative;
    pointer-events: none;
}
.htmx-request::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-color);
    z-index: 99999;
    animation: android-loading-bar 1.5s infinite ease-in-out;
    transform-origin: 0% 50%;
}
@keyframes android-loading-bar {
    0% { transform: translateX(-100%) scaleX(0.2); }
    50% { transform: translateX(0) scaleX(0.5); }
    100% { transform: translateX(100%) scaleX(0.2); }
}

/* HTMX Smooth Page Transitions */
body {
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}
body.htmx-swapping {
    opacity: 0.5;
    transform: translateY(10px);
}

/* Skeleton Loading Effect */
.skeleton {
    background: #e0e0e0;
    background: linear-gradient(90deg, #e0e0e0 25%, #f5f5f5 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite linear;
    border-radius: 8px;
    color: transparent !important;
    overflow: hidden;
}
.skeleton * {
    visibility: hidden;
}
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Custom Skeleton UI for Cards */
.skeleton-box {
    background: #e0e0e0;
    background: linear-gradient(90deg, #e0e0e0 25%, #f5f5f5 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite linear;
}
.skel-card {
    min-width: 240px;
    height: 260px;
    background: var(--app-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}
.skel-img {
    width: 100%;
    height: 140px;
    border-radius: 20px 20px 0 0;
}
.skel-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.skel-line {
    height: 12px;
    border-radius: 6px;
}

/* Login Page */
.login-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: white;
}
.login-top {
    padding: 60px 24px 24px;
}
.brand-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}
.brand-inline img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}
.brand-inline span {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}
.login-top h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
    line-height: 1.3;
}
.login-top p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

.login-body {
    padding: 32px 24px 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}
.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    width: 20px;
    height: 20px;
}
.input-icon-right {
    position: absolute;
    right: 16px;
    color: var(--text-muted);
    width: 20px;
    height: 20px;
    cursor: pointer;
}
.input-wrap input {
    width: 100%;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px 16px 16px 48px;
    font-size: 14px;
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
}
.input-wrap input:focus {
    border-color: var(--primary-light);
    background: white;
    box-shadow: 0 4px 12px rgba(36, 107, 253, 0.1);
}
.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
}
.remember-me input {
    accent-color: var(--primary-color);
    width: 16px;
    height: 16px;
}
.forgot-pass {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
}
.btn-large {
    padding: 16px;
    font-size: 16px;
}
.w-100 {
    width: 100%;
}

.divider {
    text-align: center;
    margin: 32px 0;
    position: relative;
}
.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--border-color);
    z-index: 1;
}
.divider span {
    background: white;
    padding: 0 16px;
    font-size: 12px;
    color: var(--text-muted);
    position: relative;
    z-index: 2;
}

.social-login-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}
.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-social:active {
    transform: scale(0.98);
}
.btn-google {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}
.btn-google img {
    width: 20px;
    height: 20px;
}
.btn-idd {
    background: #0f172a;
    border: none;
    color: white;
}
.btn-idd i {
    width: 20px;
    height: 20px;
}

.register-prompt {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    margin-top: auto;
}
.register-prompt a {
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
}

/* Affiliate / Share Box */
.affiliate-box {
    background: linear-gradient(135deg, #fffcf5, #fff5e6);
    border: 1px solid #ffe8cc;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.05);
}
.affiliate-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.affiliate-header i {
    color: var(--secondary-color);
}
.affiliate-header h3 {
    font-size: 15px;
    font-weight: 800;
    color: #d97706;
}
.affiliate-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}
.affiliate-link-wrap {
    display: flex;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}
.affiliate-link-wrap input {
    flex: 1;
    border: none;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-muted);
    background: transparent;
    outline: none;
}
.btn-copy {
    background: var(--primary-light);
    color: var(--primary-color);
    border: none;
    padding: 0 16px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}
.btn-copy:active {
    background: var(--primary-color);
    color: white;
}

/* ================================================
   PAGE-SPECIFIC GLOBAL STYLES
   Harus di style.css agar tersedia saat HTMX swap body
   ================================================ */

/* My-Courses: Tab Pills */
.tab-nav-wrap { display:flex; gap:8px; padding: 0 20px 16px; overflow-x:auto; scrollbar-width:none; }
.tab-nav-wrap::-webkit-scrollbar { display:none; }
.tab-pill { flex-shrink:0; padding: 8px 18px; border-radius:50px; border:1.5px solid #e2e8f0; background:white; font-size:13px; font-weight:600; cursor:pointer; color:#757c8e; transition:0.2s; }
.tab-pill.active { background:#246bfd; color:white; border-color:#246bfd; }
.course-list { padding: 0 20px; display:flex; flex-direction:column; gap:14px; }

/* My-Courses: Enroll Card */
.enroll-card { display:flex; flex-direction:row; align-items:center; gap:12px; background:white; border-radius:16px; padding:14px; box-shadow:0 2px 8px rgba(0,0,0,0.06); transition:0.2s; text-decoration:none; overflow:hidden; }
.enroll-card:active { transform:scale(0.98); }
.enroll-thumb { width:76px; height:76px; min-width:76px; max-width:76px; border-radius:10px; object-fit:cover; flex-shrink:0; background:#f1f5f9; display:block; }
.enroll-info { flex:1; min-width:0; display:flex; flex-direction:column; gap:5px; overflow:hidden; }
.enroll-top-row { display:flex; justify-content:space-between; align-items:center; gap:4px; }
.enroll-tag { font-size:11px; font-weight:700; color:#246bfd; text-transform:uppercase; letter-spacing:0.5px; }
.enroll-title { font-size:14px; font-weight:700; color:#181a20; line-height:1.4; margin:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.progress-bar-bg { height:5px; background:#e2e8f0; border-radius:50px; overflow:hidden; }
.progress-bar-fill { height:100%; background:#246bfd; border-radius:50px; }
.progress-text { font-size:11px; color:#757c8e; display:flex; justify-content:space-between; }
.badge-status { font-size:11px; font-weight:700; padding:2px 8px; border-radius:50px; white-space:nowrap; }
.badge-active { background:#eff6ff; color:#1d4ed8; }
.badge-done { background:#dcfce7; color:#15803d; }
.empty-state { text-align:center; padding: 60px 30px; }
.empty-icon { width:80px; height:80px; background:#f1f5f9; border-radius:50%; display:flex; align-items:center; justify-content:center; margin:0 auto 16px; color:#94a3b8; }

/* Profile page: hero harus flex-shrink:0 */
.profile-hero { flex-shrink: 0; }