/* =================================================
   PRESTASI.CSS - HALAMAN PRESTASI SEKOLAH
   Tema Biru Putih - SDN 2 Karangcengis
   ================================================= */

/* ========== VARIABEL WARNA ========== */
:root {
    --primary-blue: #0a4d8c;
    --secondary-blue: #1e6eb5;
    --accent-blue: #3498db;
    --light-blue: #eef5fc;
    --pure-white: #ffffff;
    --soft-white: #f8fafd;
    --text-dark: #2c3e50;
    --text-light: #5a6a7a;
    --border-light: #d9e6f2;
    --shadow: 0 8px 20px rgba(10, 77, 140, 0.06);
    --shadow-hover: 0 12px 25px rgba(10, 77, 140, 0.1);
    --gradient-blue: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
}

/* ========== RESET & DASAR ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--soft-white);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== BANNER HALAMAN ========== */
.page-banner {
    position: relative;
    width: 100%;
    height: 280px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pure-white);
    margin-bottom: 2.5rem;
}

.banner-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
}

.banner-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.banner-content h1 {
    font-size: 2.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.breadcrumb a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: var(--pure-white);
    text-decoration: underline;
}

.breadcrumb i {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
}

/* ========== SECTION HEADER ========== */
.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-header h2 {
    font-size: 2.2rem;
    color: var(--primary-blue);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.header-line {
    width: 70px;
    height: 3px;
    background: var(--accent-blue);
    margin: 0 auto 1rem;
    border-radius: 3px;
}

.subtitle {
    color: var(--text-light);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ========== PREVIEW ROW ========== */
.preview-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

/* Stat Card */
.stat-card {
    background: var(--gradient-blue);
    border-radius: 20px;
    padding: 25px 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.stat-icon i {
    font-size: 2rem;
    color: white;
}

.stat-info {
    flex: 1;
}

.stat-number {
    display: block;
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
    color: white;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Preview Card */
.preview-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.preview-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.preview-card.placeholder {
    opacity: 0.7;
    cursor: default;
}

.preview-card.placeholder:hover {
    transform: none;
}

.preview-image {
    width: 100%;
    height: 140px;
    overflow: hidden;
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.preview-card:hover .preview-image img {
    transform: scale(1.1);
}

.preview-icon {
    height: 100px;
    background: var(--light-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-icon i {
    font-size: 2.5rem;
    color: var(--primary-blue);
}

.preview-content {
    padding: 15px;
}

.preview-content h4 {
    font-size: 1rem;
    color: var(--primary-blue);
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* Tambahkan ini untuk menghilangkan warning */
    display: box;
    line-clamp: 1;
    box-orient: vertical;
    /* Fallback untuk browser lama */
    max-height: 1.5rem;
    line-height: 1.5rem;
}

.preview-content p {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* Tambahkan ini untuk menghilangkan warning */
    display: box;
    line-clamp: 2;
    box-orient: vertical;
    /* Fallback untuk browser lama */
    max-height: 2.4rem;
    line-height: 1.2rem;
}

.preview-meta {
    display: flex;
    gap: 10px;
    font-size: 0.7rem;
    color: var(--text-light);
}

.preview-meta i {
    margin-right: 3px;
    color: var(--accent-blue);
}

/* ========== TABEL ========== */
.table-wrapper {
    background: var(--pure-white);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    margin-bottom: 2rem;
    overflow-x: auto;
}

.prestasi-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.prestasi-table th {
    background: var(--primary-blue);
    color: var(--pure-white);
    padding: 12px 15px;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prestasi-table th:first-child {
    border-top-left-radius: 15px;
}

.prestasi-table th:last-child {
    border-top-right-radius: 15px;
}

.prestasi-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-light);
}

.prestasi-table tbody tr:hover {
    background: var(--light-blue);
}

.text-center {
    text-align: center;
}

/* Nama Prestasi */
.prestasi-nama {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prestasi-nama i {
    color: var(--accent-blue);
    font-size: 1rem;
}

/* Badge Tingkat */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    min-width: 80px;
}

.badge.nasional {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.badge.provinsi {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.badge.kabupaten {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.badge.kecamatan {
    background: var(--light-blue);
    color: var(--primary-blue);
    border: 1px solid var(--border-light);
}

.badge.sekolah {
    background: #e0e7ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}

/* Tahun Badge */
.tahun-badge {
    display: inline-block;
    background: var(--light-blue);
    color: var(--primary-blue);
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Peraih Info */
.peraih-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.peraih-info i {
    color: var(--accent-blue);
    font-size: 0.9rem;
}

/* Button Detail */
.btn-detail {
    background: var(--light-blue);
    color: var(--primary-blue);
    border: 1px solid var(--border-light);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-detail:hover {
    background: var(--primary-blue);
    color: white;
}

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-hover);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-container.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    padding: 15px 20px;
    background: var(--gradient-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    color: white;
    font-size: 1.2rem;
    margin: 0;
}

.modal-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.loading {
    text-align: center;
    color: var(--text-light);
    padding: 20px;
}

.modal-foto {
    width: 100%;
    height: 200px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.modal-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-foto-placeholder {
    background: var(--light-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-foto-placeholder i {
    font-size: 3rem;
    color: var(--border-light);
}

.modal-detail h4 {
    color: var(--primary-blue);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.modal-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.modal-info-item {
    background: var(--light-blue);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
}

.modal-info-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-light);
    margin-bottom: 3px;
}

.modal-info-value {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-blue);
}

.modal-deskripsi {
    background: var(--soft-white);
    border-radius: 10px;
    padding: 15px;
}

.modal-deskripsi strong {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-blue);
}

.modal-deskripsi p {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 0.9rem;
}

/* ========== TOMBOL KEMBALI ========== */
.button-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.btn-kembali {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 10px 25px;
    background: var(--primary-blue);
    color: var(--pure-white);
    border: none;
    border-radius: 30px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-kembali:hover {
    background: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-kembali i {
    font-size: 0.85rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 992px) {
    .preview-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .banner-content h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .page-banner {
        height: 200px;
    }
    
    .banner-content h1 {
        font-size: 1.8rem;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .preview-row {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        justify-content: center;
    }
    
    .modal-info-grid {
        grid-template-columns: 1fr;
    }
    
    .button-wrapper {
        justify-content: center;
    }
    
    .btn-kembali {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .banner-content h1 {
        font-size: 1.5rem;
    }
    
    .breadcrumb {
        font-size: 0.8rem;
    }
    
    .table-wrapper {
        padding: 0.5rem;
    }
    
    .prestasi-table {
        font-size: 0.85rem;
    }
    
    .badge {
        min-width: 60px;
        font-size: 0.7rem;
    }
}