/* 
  Sections Premium Styles
  Responsive, Modern, and Visually Rich Layouts for School CMS
*/

:root {
    /* Colors are now pulled from global header.php variables */
    --accent-color: #f59e0b;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --bg-light: #f8fafc;
    --card-shadow: 0 10px 30px rgba(0,0,0,0.08);
    --card-hover-shadow: 0 20px 40px rgba(0,0,0,0.12);
    --transition: all 0.3s ease;
}

/* Base Section Styling */
.dynamic-section {
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

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

.section-subtitle {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.section-main-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-dark);
    position: relative;
    padding-bottom: 15px;
}

.section-main-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* 1. Hero Template */
.section-hero-premium {
    min-height: 500px;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    color: #fff;
    position: relative;
    padding: 100px 0;
}

.section-hero-premium::before {
    content: '';
    position: absolute;
    top:0; left:0; width:100%; height:100%;
    /* Matching the user's screenshot with a diagonal gradient */
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.85) 0%, rgba(var(--secondary-rgb), 0.75) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    width: 100%;
    margin: 0 auto !important;
}

/* Specific centering fix for both frontend and admin builder */
.hero-premium-centered {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

.hero-premium-centered .hero-content,
.hero-premium-centered .hero-premium-content-fix {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
    width: 100% !important;
    max-width: 950px !important;
    z-index: 10 !important;
    padding: 20px 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

@media (max-width: 576px) {
    .hero-premium-centered {
        min-height: auto !important;
        padding-top: 80px !important;
        padding-bottom: 80px !important;
    }
}

/* Ensure all internal elements are centered inside the absolute box */
.hero-premium-centered h1,
.hero-premium-centered h2,
.hero-premium-centered .hero-subtitle-text,
.hero-premium-centered .hero-description-text,
.hero-premium-centered .hero-badge-circle,
.hero-premium-centered .hero-divider-accent {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
}

.hero-badge-circle {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    font-size: 2rem;
    color: #fff;
    backdrop-filter: blur(5px);
}

.hero-premium-centered h1 {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 20px;
}

@media (max-width: 991px) {
    .hero-premium-centered h1 {
        font-size: 2.8rem;
    }
}
@media (max-width: 576px) {
    .hero-premium-centered h1 {
        font-size: 2.2rem;
    }
}

.hero-subtitle-text {
    font-size: 1.5rem;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 25px;
}

@media (max-width: 768px) {
    .hero-subtitle-text {
        font-size: 1.1rem;
    }
}

.hero-divider-accent {
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    margin: 0 auto 30px;
    border-radius: 2px;
}

.hero-description-text {
    max-width: 750px;
    margin: 0 auto 50px;
    font-size: 1.25rem;
    line-height: 1.7;
    opacity: 0.85;
    font-weight: 300;
}

@media (max-width: 768px) {
    .hero-description-text {
        font-size: 0.95rem;
        margin-bottom: 30px;
    }
}

.hero-scroll-down {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    color: #fff;
    cursor: pointer;
    animation: bounce 2s infinite;
    z-index: 3;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0) translateX(-50%);}
    40% {transform: translateY(-10px) translateX(-50%);}
    60% {transform: translateY(-5px) translateX(-50%);}
}

/* Admin Preview Mode Overrides */
.admin-preview-mode .section-hero-premium {
    min-height: 400px;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.admin-preview-mode .hero-premium-centered h1 {
    font-size: 2.5rem;
}

.admin-preview-mode .hero-subtitle-text {
     font-size: 1.2rem;
}

.admin-preview-mode .hero-description-text {
    font-size: 1rem;
}

/* 2. Card Grid Template (1, 2, 3, 4 columns) */
.card-grid-wrapper {
    display: grid;
    gap: 30px;
}

.cols-1 { grid-template-columns: 1fr; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) {
    .cols-3, .cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
    .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
}

.premium-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.03);
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.premium-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--card-hover-shadow);
}

.card-icon-wrapper {
    width: 80px;
    height: 80px;
    background: rgba(var(--primary-rgb), 0.05);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    font-size: 2rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.premium-card:hover .card-icon-wrapper {
    background: var(--primary-color);
    color: #fff;
    transform: rotate(10deg);
}

.card-image-wrapper img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 20px;
}

.premium-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.premium-card p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 0;
    font-size: 1rem;
}

/* 3. Split Content Template */
.split-content-wrapper {
    display: flex;
    align-items: center;
    gap: 60px;
}

.split-media, .split-text {
    flex: 1;
}

.split-media img {
    width: 100%;
    border-radius: 25px;
    box-shadow: var(--card-hover-shadow);
}

.split-reverse {
    flex-direction: row-reverse;
}

@media (max-width: 768px) {
    .split-content-wrapper {
        flex-direction: column;
        gap: 30px;
    }
}

/* 4. Gallery Template - High Fidelity */
.premium-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.gallery-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 16/10; /* Cinematic aspect ratio */
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    background: #eee; /* Placeholder bg */
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(var(--primary-rgb), 0.9), rgba(var(--primary-rgb), 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s ease;
    backdrop-filter: blur(2px);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay i {
    color: #fff;
    font-size: 2.5rem;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item:hover .gallery-overlay i {
    transform: translateY(0);
}

@media (max-width: 576px) {
    .premium-gallery {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* 5. Rich Text Template */
.rich-text-container {
    max-width: 900px;
    margin: 0 auto;
    font-size: 1.15rem;
    line-height: 1.9;
    color: var(--text-dark);
}

.rich-text-container img {
    max-width: 100%;
    border-radius: 15px;
}

/* Animations */
[data-aos] {
    pointer-events: none;
}
.aos-animate {
    pointer-events: auto;
}
