/* =====================================================
   E-LEARNING 2026 - Modern Soft UI
   ===================================================== */

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --purple: #8b5cf6;
    --pink: #ec4899;

    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    --shadow-hover: 0 10px 30px rgba(15, 23, 42, 0.1);
}

/* ========== GLOBAL ========== */
body {
    background-color: var(--bg-body) !important;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif !important;
    color: var(--text-main);
    line-height: 1.6;
}

/* ========== SIDEBAR & NAVBAR FIX ========== */

/* Sidebar */
.ui.sidebar {
    background: linear-gradient(180deg, #1e40af 0%, #1e3a8a 100%) !important;
    width: 260px !important;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15) !important;
}

/* Top Navbar */
.ui.inverted.top.fixed.menu {
    background: #1e40af !important;
    height: 56px !important;
    border: none !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
}

/* ===== DESKTOP (≥ 992px) ===== */
@media (min-width: 992px) {
    .ui.sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        z-index: 100 !important;
        transform: none !important;
        visibility: visible !important;
    }

    .ui.top.fixed.menu {
        left: 260px !important;
        width: calc(100% - 260px) !important;
        z-index: 101 !important;
    }

    .pusher {
        margin-left: 260px !important;
        transform: none !important;
        min-height: 100vh;
    }

    #btn-sidebar {
        display: none !important;
    }

    .main-content {
        padding-top: 70px !important;
    }
}

/* ===== MOBILE / TABLET (< 992px) ===== */
@media (max-width: 991px) {
    .ui.sidebar {
        z-index: 110 !important;
    }

    .ui.top.fixed.menu {
        left: 0 !important;
        width: 100% !important;
    }

    .pusher {
        margin-left: 0 !important;
    }

    #btn-sidebar {
        display: flex !important;
    }

    .main-content {
        padding-top: 70px !important;
    }
}

/* ========== CONTENT ========== */
.main-content {
    padding: 1.75rem 1.5rem !important;
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 75px !important;
}

/* ========== CARDS & SEGMENTS ========== */
.ui.segment {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow) !important;
    padding: 1.5rem !important;
}

.ui.card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow) !important;
    transition: all 0.25s ease !important;
}

.ui.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover) !important;
    border-color: #cbd5e1 !important;
}

/* Statistik di dashboard */
.ui.statistic .value {
    font-weight: 700 !important;
    font-size: 2.4rem !important;
    letter-spacing: -0.5px;
}

.ui.statistic .label {
    color: var(--text-muted) !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Warna statistik */
.ui.blue.statistic .value { color: #3b82f6 !important; }
.ui.green.statistic .value { color: #10b981 !important; }
.ui.orange.statistic .value { color: #f59e0b !important; }
.ui.teal.statistic .value { color: #06b6d4 !important; }
.ui.violet.statistic .value { color: #8b5cf6 !important; }
.ui.brown.statistic .value { color: #d97706 !important; }
.ui.grey.statistic .value { color: #64748b !important; }

/* ========== TABLE ========== */
.ui.table {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
    overflow: hidden;
}

.ui.table thead th {
    background: #f8fafc !important;
    color: #475569 !important;
    font-weight: 600 !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 1rem !important;
}

.ui.table td {
    padding: 0.9rem 1rem !important;
    border-top: 1px solid #f1f5f9 !important;
}

.ui.table tr:hover td {
    background: #f8fafc !important;
}

/* ========== BUTTON ========== */
.ui.button {
    border-radius: 10px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
}

.ui.primary.button {
    background: var(--primary) !important;
}

.ui.primary.button:hover {
    background: var(--primary-dark) !important;
    transform: translateY(-1px);
}

.ui.green.button { background: var(--success) !important; }
.ui.orange.button { background: var(--warning) !important; }
.ui.teal.button { background: var(--info) !important; }
.ui.red.button { background: var(--danger) !important; }

.ui.mini.button {
    border-radius: 8px !important;
    font-size: 0.8rem !important;
}

/* ========== FORM ========== */
.ui.form input, 
.ui.form textarea, 
.ui.form select,
.ui.dropdown {
    border-radius: 10px !important;
    border: 1px solid var(--border) !important;
}

.ui.form input:focus,
.ui.form textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

/* ========== MESSAGE / ALERT ========== */
.ui.message {
    border-radius: 12px !important;
    box-shadow: var(--shadow) !important;
    border: none !important;
}

/* ========== HEADER ========== */
.ui.header {
    color: var(--text-main) !important;
}

.ui.header .sub.header {
    color: var(--text-muted) !important;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 767px) {
    .main-content {
        padding: 1rem 0.8rem !important;
        padding-top: 70px !important;
    }

    .ui.segment {
        padding: 1.2rem !important;
        border-radius: 14px !important;
    }

    .ui.statistic .value {
        font-size: 1.9rem !important;
    }

    .ui.table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Smooth scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Mencegah konten tertutup sidebar */
body.pushable {
    background: var(--bg-body) !important;
}

.ui.sidebar + .pusher {
    transform: none !important; /* penting untuk menghindari geser aneh */
}
/* Navbar Dashboard button */
#top-menu .dashboard-text {
    margin-left: 6px;
}

@media (max-width: 767px) {
    #top-menu .dashboard-text {
        display: none; /* di HP hanya tampil icon home */
    }
    
    #page-title {
        font-size: 0.95rem !important;
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
/* Desktop: beri ruang untuk sidebar */
@media (min-width: 992px) {
    .pusher {
        margin-left: 270px !important;
        transform: none !important;
    }

    #btn-sidebar {
        display: none !important; /* sembunyikan hamburger di laptop */
    }
}

@media (max-width: 991px) {
    .pusher {
        margin-left: 0 !important;
    }
}

/* ===== Perbaikan Tombol Aksi di List Materi (Mobile) ===== */
.material-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.material-actions .ui.button {
    margin: 0 !important;
}

/* Mobile */
@media (max-width: 767px) {
    .material-actions {
        gap: 6px;
    }

    .material-actions .ui.button {
        font-size: 0.8rem !important;
        padding: 0.7em 0.9em !important;
        flex: 1 1 calc(50% - 6px); /* 2 tombol per baris */
        text-align: center;
        justify-content: center;
    }

    /* Jika ingin 1 tombol full width di HP sangat kecil */
    @media (max-width: 400px) {
        .material-actions .ui.button {
            flex: 1 1 100%;
        }
    }
}