/* === Paste all the CSS from the previous single-file version here === */
/* ... (all the styles from body, h1, .btn, header, hero, about, etc.) ... */

/* === ADD THE FOLLOWING NEW STYLES === */

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: var(--dark-bg);
    display: flex;
    justify-content: center;
    align-items: center;
}
.loader {
    border: 8px solid var(--border-color);
    border-top: 8px solid var(--primary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Section Subtitle */
.section-subtitle {
    text-align: center;
    max-width: 700px;
    margin: -30px auto 50px auto;
    color: var(--text-muted);
}

/* Alternate Background Color for sections */
.alt-bg {
    background-color: var(--card-bg);
}

/* Stats Counter Section */
#stats {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('https://placehold.co/1920x500/111/444?text=School+Building') no-repeat center center/cover;
    padding: 100px 0;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: center;
}
.stat-item i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}
.stat-item h3 {
    font-size: 2.5rem;
    font-weight: 900;
    color: #fff;
}
.stat-item p {
    font-size: 1rem;
    color: var(--text-muted);
}

/* Gallery Page Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.gallery-item:hover img {
    transform: scale(1.1);
}
.gallery-item .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.gallery-item:hover .overlay {
    opacity: 1;
}

/* Admissions & Contact Page Styles */
.contact-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: flex-start;
}
.contact-form-container h3, .contact-details-container h3 {
    margin-bottom: 20px;
    font-size: 1.8rem;
}
.form-group {
    margin-bottom: 20px;
}
.form-group input, .form-group textarea {
    width: 100%;
    padding: 15px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
    font-size: 1rem;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}
.map-container {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}
.contact-info-list {
    list-style: none;
    padding: 0;
}
.contact-info-list li {
    margin-bottom: 15px;
    color: var(--text-muted);
    font-size: 1.1rem;
}
.contact-info-list i {
    color: var(--primary-color);
    width: 25px;
}
.form-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    text-align: center;
}
.form-message.success {
    background-color: #28a74520;
    color: #28a745;
    border: 1px solid #28a745;
}
.form-message.error {
    background-color: #dc354520;
    color: #dc3545;
    border: 1px solid #dc3545;
}


/* Back to Top Button */
#back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--dark-bg);
    border-radius: 50%;
    text-align: center;
    line-height: 50px;
    font-size: 1.2rem;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}
#back-to-top-btn.show {
    opacity: 1;
    visibility: visible;
}

/* Responsive adjustments for new sections */
@media (max-width: 992px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
}