/* Reset dan Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
    border-bottom: 2px solid #4a6fa5;
}

.header h1 {
    color: #2c3e50;
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e1e8ed;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Daftar Ujian Styles */
.daftar-ujian {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

/* Tambahkan ini untuk grid mobile */
.mapel-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-left: 5px solid #4a6fa5;
}

.mapel-nama {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
    flex-grow: 1;
}

.mapel-info {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 20px;
    flex-grow: 0;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 25px;
    background: #4a6fa5;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
    margin-top: auto; /* Untuk mendorong tombol ke bawah di card */
}

.btn:hover {
    background: #3a5a80;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 111, 165, 0.3);
}

/* Tombol Mulai Ujian - Warna Hijau */
.btn-ujian {
    background: #27ae60 !important;
    border-color: #27ae60 !important;
}

.btn-ujian:hover {
    background: #219653 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.btn-success {
    background: #27ae60;
}

.btn-success:hover {
    background: #219653;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: #f39c12;
}

.btn-warning:hover {
    background: #d68910;
}

.btn-secondary {
    background: #95a5a6;
    margin-top: 10px;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: #4a6fa5;
    outline: none;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background: #4a6fa5;
    color: white;
    font-weight: 600;
}

.table tr:hover {
    background-color: #f8f9fa;
}

.table-actions {
    display: flex;
    gap: 10px;
}

/* Alert Styles */
.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px 0;
    color: #7f8c8d;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
}

/* Responsive Design - Grid 3 kolom untuk mobile */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    /* Grid 3 kolom untuk mobile */
    .daftar-ujian {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .mapel-item {
        padding: 15px;
        margin-bottom: 0;
    }
    
    .mapel-nama {
        font-size: 1rem;
        line-height: 1.3;
        min-height: 40px; /* Untuk menjaga konsistensi tinggi judul */
    }
    
    .mapel-info {
        font-size: 0.8rem;
        margin-bottom: 15px;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .table-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    /* Untuk layar sangat kecil, grid 2 kolom */
    .daftar-ujian {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .card {
        padding: 15px;
    }
    
    .mapel-nama {
        font-size: 1rem;
    }
}

/* Untuk layar sangat kecil (kurang dari 360px) */
@media (max-width: 360px) {
    .daftar-ujian {
        grid-template-columns: 1fr;
    }
}

/* Login Page Specific Styles */
.login-container {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Session timeout warning */
.session-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.9rem;
}