/* ==========================================
   TK ABA KARANGKEMIRI - MAIN STYLES (RESPONSIVE IMPROVED)
   Tema: Hijau Aisyiyah
   ========================================== */

:root {
    --primary-green: #00834B;
    --light-green: #84C59E;
    --white: #FFFFFF;
    --accent-yellow: #F4BC00;
    --dark-gray: #333333;
    --light-gray: #f5f5f5;
    --border-radius: 15px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Quicksand', sans-serif;
    color: var(--dark-gray);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==========================================
   NAVBAR - IMPROVED RESPONSIVE
   ========================================== */
.navbar {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0, 131, 75, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    height: 60px;
    width: auto;
}

.logo-text h1 {
    font-size: 20px;
    color: var(--primary-green);
    font-weight: 600;
    margin-bottom: 2px;
}

.logo-text p {
    font-size: 12px;
    color: var(--dark-gray);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--dark-gray);
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary-green);
}

.nav-menu .btn-ppdb {
    background: var(--primary-green);
    color: var(--white);
    padding: 10px 25px;
    border-radius: 25px;
    transition: all 0.3s;
}

.nav-menu .btn-ppdb:hover {
    background: var(--light-green);
    transform: translateY(-2px);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--primary-green);
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

/* ==========================================
   HERO SECTION - IMPROVED RESPONSIVE
   ========================================== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--light-green) 100%);
    padding: 80px 20px;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><circle cx="100" cy="100" r="80" fill="rgba(255,255,255,0.05)"/></svg>');
    background-size: 100px;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content h2 {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content p {
    font-size: clamp(14px, 2vw, 18px);
    margin-bottom: 30px;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 35px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: clamp(14px, 1.5vw, 16px);
    transition: all 0.3s;
    display: inline-block;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: var(--white);
    color: var(--primary-green);
}

.btn-primary:hover {
    background: var(--accent-yellow);
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-secondary:hover {
    background: var(--white);
    color: var(--primary-green);
}

.hero-image img {
    width: 100%;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* ==========================================
   SECTIONS - IMPROVED RESPONSIVE
   ========================================== */
section {
    padding: clamp(40px, 8vw, 80px) 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: clamp(24px, 4vw, 36px);
    color: var(--primary-green);
    margin-bottom: 15px;
    font-weight: 700;
}

.section-title p {
    font-size: clamp(14px, 2vw, 18px);
    color: var(--dark-gray);
    opacity: 0.8;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--accent-yellow);
    margin: 20px auto 0;
    border-radius: 2px;
}

/* ==========================================
   PROGRAM CARDS - IMPROVED RESPONSIVE
   ========================================== */
.program-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 30px;
}

.program-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: var(--border-radius);
    text-align: center;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0, 131, 75, 0.1);
    border: 2px solid transparent;
}

.program-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 131, 75, 0.2);
    border-color: var(--light-green);
}

.program-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-green), var(--light-green));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    font-size: 36px;
    color: var(--white);
}

.program-card h3 {
    font-size: clamp(18px, 2.5vw, 22px);
    color: var(--primary-green);
    margin-bottom: 15px;
    font-weight: 600;
}

.program-card p {
    color: var(--dark-gray);
    font-size: clamp(13px, 1.8vw, 15px);
    line-height: 1.7;
}

/* ==========================================
   BERITA & GALERI - IMPROVED RESPONSIVE
   ========================================== */
.news-grid,
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 30px;
}

.news-card,
.gallery-item {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.news-card:hover,
.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 131, 75, 0.2);
}

.news-image,
.gallery-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.news-content {
    padding: 25px;
}

.news-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 14px;
    color: var(--light-green);
    flex-wrap: wrap;
}

.news-meta i {
    margin-right: 5px;
}

.news-card h3 {
    font-size: clamp(16px, 2.5vw, 20px);
    color: var(--primary-green);
    margin-bottom: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.news-card p {
    color: var(--dark-gray);
    font-size: clamp(13px, 1.8vw, 15px);
    margin-bottom: 20px;
    line-height: 1.6;
}

.read-more {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.3s;
    font-size: clamp(13px, 1.8vw, 15px);
}

.read-more:hover {
    gap: 10px;
}

/* ==========================================
   FORM PPDB - IMPROVED RESPONSIVE
   ========================================== */
.form-ppdb {
    background: var(--white);
    padding: clamp(20px, 5vw, 40px);
    border-radius: var(--border-radius);
    box-shadow: 0 5px 20px rgba(0, 131, 75, 0.1);
}

.form-section {
    margin-bottom: 40px;
    padding: clamp(20px, 4vw, 30px);
    background: var(--light-gray);
    border-radius: 10px;
    border-left: 4px solid var(--primary-green);
}

.form-section h3 {
    color: var(--primary-green);
    margin-bottom: 25px;
    font-size: clamp(18px, 3vw, 22px);
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark-gray);
    font-weight: 500;
    font-size: clamp(13px, 1.8vw, 14px);
}

.form-group label.required::after {
    content: ' *';
    color: #e74c3c;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: clamp(13px, 1.8vw, 15px);
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(0, 131, 75, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.file-upload-area {
    border: 2px dashed var(--light-green);
    border-radius: 10px;
    padding: clamp(20px, 4vw, 30px);
    text-align: center;
    background: var(--white);
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload-area:hover {
    border-color: var(--primary-green);
    background: rgba(0, 131, 75, 0.05);
}

.file-upload-area i {
    font-size: clamp(32px, 6vw, 48px);
    color: var(--light-green);
    margin-bottom: 15px;
    display: block;
}

.file-upload-area p {
    color: var(--dark-gray);
    margin-bottom: 5px;
    font-size: clamp(13px, 1.8vw, 15px);
}

.file-upload-area .file-info {
    font-size: clamp(11px, 1.5vw, 13px);
    color: #999;
}

.file-preview {
    margin-top: 15px;
    padding: 15px;
    background: var(--light-gray);
    border-radius: 8px;
    display: none;
}

.file-preview.active {
    display: block;
}

.validation-status {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    display: none;
    font-size: clamp(13px, 1.8vw, 14px);
}

.validation-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.validation-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.validation-status i {
    margin-right: 10px;
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: clamp(13px, 1.8vw, 15px);
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ==========================================
   FOOTER - IMPROVED RESPONSIVE
   ========================================== */
footer {
    background: linear-gradient(135deg, var(--primary-green) 0%, #006837 100%);
    color: var(--white);
    padding: clamp(40px, 8vw, 60px) 20px 20px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    font-size: clamp(18px, 2.5vw, 20px);
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-section p,
.footer-section li {
    opacity: 0.9;
    line-height: 1.8;
    font-size: clamp(13px, 1.8vw, 15px);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: var(--white);
    text-decoration: none;
    transition: all 0.3s;
    display: inline-block;
}

.footer-section a:hover {
    color: var(--accent-yellow);
    transform: translateX(5px);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s;
}

.social-links a:hover {
    background: var(--accent-yellow);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: clamp(12px, 1.8vw, 14px);
}

/* ==========================================
   RESPONSIVE BREAKPOINTS
   ========================================== */

/* Tablet dan kecil */
@media (max-width: 992px) {
    .logo-img {
        height: 50px;
    }
    
    .logo-text h1 {
        font-size: 18px;
    }
    
    .logo-text p {
        font-size: 11px;
    }
    
    .nav-menu {
        gap: 20px;
    }
    
    .nav-menu a {
        font-size: 14px;
    }
}

/* Mobile dan Tablet */
@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 90px;
        flex-direction: column;
        background: var(--white);
        width: 100%;
        text-align: center;
        transition: left 0.3s ease-in-out;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.1);
        padding: 20px 0;
        gap: 0;
    }
    
    .nav-menu li {
        width: 100%;
        padding: 15px 0;
        border-bottom: 1px solid var(--light-gray);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu .btn-ppdb {
        display: inline-block;
        margin-top: 10px;
    }
    
    .hero-section {
        padding: 40px 20px;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .hero-content h2 {
        font-size: 28px;
    }
    
    .hero-content p {
        font-size: 14px;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .hero-image {
        order: -1;
    }
    
    .program-grid,
    .news-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Mobile kecil */
@media (max-width: 480px) {
    .navbar-container {
        padding: 0 15px;
    }
    
    .logo-img {
        height: 45px;
    }
    
    .logo-text h1 {
        font-size: 16px;
    }
    
    .logo-text p {
        font-size: 10px;
    }
    
    .hero-section {
        padding: 30px 15px;
    }
    
    .hero-content h2 {
        font-size: 24px;
    }
    
    .btn {
        padding: 12px 25px;
        font-size: 14px;
    }
    
    .section-title h2 {
        font-size: 24px;
    }
    
    .section-title p {
        font-size: 14px;
    }
    
    .program-card {
        padding: 30px 20px;
    }
    
    .program-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .news-content {
        padding: 20px;
    }
    
    .form-ppdb {
        padding: 20px;
    }
    
    .form-section {
        padding: 20px;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        padding: 40px 20px;
    }
    
    .hero-container {
        grid-template-columns: 1fr 1fr;
        text-align: left;
    }
    
    .hero-image {
        order: 2;
    }
    
    .hero-buttons {
        flex-direction: row;
        justify-content: flex-start;
    }
}

/* ==========================================
   UTILITY CLASSES - RESPONSIVE
   ========================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.p-1 { padding: 10px; }
.p-2 { padding: 20px; }
.p-3 { padding: 30px; }

/* Hide on mobile */
.hide-mobile {
    display: block;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none;
    }
}

/* Show only on mobile */
.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .show-mobile {
        display: block;
    }
}

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Loading Spinner */
.loading-spinner {
    border: 4px solid var(--light-gray);
    border-top: 4px solid var(--primary-green);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--light-gray);
    border-radius: 3px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-green), var(--light-green));
    width: 0%;
    transition: width 0.3s ease;
}

/* ==========================================
   ABOUT SECTION RESPONSIVE (untuk inline styles di index.php)
   ========================================== */
@media (max-width: 768px) {
    /* Untuk grid about section */
    div[style*="grid-template-columns: 1fr 1fr"] {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }
    
    /* Untuk stats di about section */
    div[style*="display: flex"][style*="gap: 30px"] {
        flex-direction: column !important;
        gap: 20px !important;
    }
}
