/* ============================================
   Jurnal Mengajar - SMPN 6 Singaraja
   Custom Styles
   ============================================ */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #16a085;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Sidebar */
#sidebar-wrapper {
    min-height: 100vh;
    margin-left: -250px;
    transition: margin 0.25s ease-out;
    position: fixed;
    z-index: 1000;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

body.sb-sidenav-toggled #sidebar-wrapper {
    margin-left: 0;
}

#page-content-wrapper {
    min-width: 100vw;
    padding-left: 0;
    transition: padding 0.25s ease-out;
}

body.sb-sidenav-toggled #page-content-wrapper {
    padding-left: 250px;
}

@media (min-width: 768px) {
    #sidebar-wrapper {
        margin-left: 0;
    }
    
    #page-content-wrapper {
        min-width: 0;
        width: 100%;
        padding-left: 250px;
    }
    
    body.sb-sidenav-toggled #sidebar-wrapper {
        margin-left: -250px;
    }
    
    body.sb-sidenav-toggled #page-content-wrapper {
        padding-left: 0;
    }
}

.sidebar-heading {
    font-size: 1.2rem;
    font-weight: 600;
}

.list-group-item-action {
    padding: 0.75rem 1.25rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.list-group-item-action:hover {
    background-color: #f8f9fa;
    border-left-color: var(--secondary-color);
}

.list-group-item-action.active {
    background-color: var(--secondary-color);
    border-left-color: var(--primary-color);
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

/* Badges */
.badge {
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    font-weight: 500;
}

.badge-success { background-color: #d4edda; color: #155724; }
.badge-warning { background-color: #fff3cd; color: #856404; }
.badge-danger { background-color: #f8d7da; color: #721c24; }
.badge-info { background-color: #d1ecf1; color: #0c5460; }
.badge-primary { background-color: #cce5ff; color: #004085; }
.badge-secondary { background-color: #e2e3e5; color: #383d41; }

/* Tables */
.table {
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    font-weight: 500;
    padding: 1rem;
}

.table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 0.6rem 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    width: 100%;
    max-width: 450px;
}

.login-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: #fff;
    padding: 2rem;
    text-align: center;
}

.login-header i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.login-header h2 {
    margin: 0;
    font-weight: 600;
}

.login-header p {
    margin: 0.5rem 0 0;
    opacity: 0.9;
}

.login-body {
    padding: 2rem;
}

/* Dashboard Cards */
.dashboard-card {
    border-radius: 12px;
    padding: 1.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.dashboard-card i {
    font-size: 2.5rem;
    opacity: 0.3;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.dashboard-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.dashboard-card p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

/* Print Styles */
@media print {
    @page {
        size: A4 landscape;
        margin: 10mm 8mm 10mm 8mm;
    }
    
    .no-print {
        display: none !important;
    }
    
    body {
        background: #fff;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .print-report {
        border: none !important;
        box-shadow: none !important;
    }
    
    .print-report .card-header {
        background: #fff !important;
        border-bottom: 2px solid #000 !important;
        padding: 0.5rem 0 !important;
    }
    
    .print-report .card-body {
        padding: 0 !important;
    }
    
    .print-report .table-responsive {
        overflow: visible !important;
    }
    
    .print-table {
        table-layout: fixed !important;
        border-collapse: collapse !important;
        width: 100% !important;
        font-size: 9pt !important;
    }
    
    .print-table thead {
        display: table-header-group !important;
    }
    
    .print-table thead th {
        background: #e0e0e0 !important;
        color: #000 !important;
        font-weight: bold !important;
        text-align: center !important;
        vertical-align: middle !important;
        padding: 6px 4px !important;
        border: 1px solid #333 !important;
        width: 8.33% !important;
    }
    
    .print-table tbody tr {
        page-break-inside: avoid !important;
    }
    
    .print-table tbody td {
        vertical-align: middle !important;
        padding: 5px 4px !important;
        border: 1px solid #666 !important;
        overflow-wrap: anywhere !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
    }
    
    .print-table .col-tanggal {
        width: 9% !important;
    }
    .print-table .col-hari {
        width: 7% !important;
    }
    .print-table .col-guru {
        width: 16% !important;
    }
    .print-table .col-kelas {
        width: 7% !important;
    }
    .print-table .col-mapel {
        width: 15% !important;
    }
    .print-table .col-topik {
        width: 30% !important;
    }
    .print-table .col-hadir,
    .print-table .col-sakit,
    .print-table .col-izin,
    .print-table .col-alpa {
        width: 5% !important;
        text-align: center !important;
    }
    .print-table .col-status {
        width: 6% !important;
        text-align: center !important;
    }
    
    .print-table tbody td:nth-child(1) { width: 9% !important; }
    .print-table tbody td:nth-child(2) { width: 7% !important; }
    .print-table tbody td:nth-child(3) { width: 16% !important; }
    .print-table tbody td:nth-child(4) { width: 7% !important; }
    .print-table tbody td:nth-child(5) { width: 15% !important; }
    .print-table tbody td:nth-child(6) { width: 30% !important; }
    .print-table tbody td:nth-child(7) { width: 5% !important; text-align: center !important; }
    .print-table tbody td:nth-child(8) { width: 5% !important; text-align: center !important; }
    .print-table tbody td:nth-child(9) { width: 5% !important; text-align: center !important; }
    .print-table tbody td:nth-child(10) { width: 5% !important; text-align: center !important; }
    .print-table tbody td:nth-child(11) { width: 6% !important; text-align: center !important; }
    
    .print-table thead th:nth-child(1) { width: 9% !important; }
    .print-table thead th:nth-child(2) { width: 7% !important; }
    .print-table thead th:nth-child(3) { width: 16% !important; }
    .print-table thead th:nth-child(4) { width: 7% !important; }
    .print-table thead th:nth-child(5) { width: 15% !important; }
    .print-table thead th:nth-child(6) { width: 30% !important; }
    .print-table thead th:nth-child(7) { width: 5% !important; }
    .print-table thead th:nth-child(8) { width: 5% !important; }
    .print-table thead th:nth-child(9) { width: 5% !important; }
    .print-table thead th:nth-child(10) { width: 5% !important; }
    .print-table thead th:nth-child(11) { width: 6% !important; }
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-card {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        border-radius: 10px;
    }
}

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Profile Image */
.profile-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Stat Card */
.stat-card {
    border-left: 4px solid var(--secondary-color);
}

.stat-card.success { border-left-color: var(--success-color); }
.stat-card.warning { border-left-color: var(--warning-color); }
.stat-card.danger { border-left-color: var(--danger-color); }
.stat-card.info { border-left-color: var(--info-color); }

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

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

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

.timeline-item::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--secondary-color);
    border: 2px solid #fff;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* PDF Viewer */
.pdf-viewer {
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 1rem;
    background: #f8f9fa;
}

/* Action Buttons */
.action-btns .btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    margin: 0 2px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
