/* ===== RESPONSIVE STYLES ===== */

/* Large Devices (Desktops, less than 1200px) */
@media (max-width: 1199.98px) {
    html {
        font-size: 15px;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .contact-info {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Medium Devices (Tablets, less than 992px) */
@media (max-width: 991.98px) {
    html {
        font-size: 14px;
    }

    .hero .container,
    .about-content {
        flex-direction: column;
        gap: var(--spacing-lg);
    }

    .hero-content,
    .about-text {
        padding-right: 0;
        text-align: center;
        order: 1;
    }

    .hero-image,
    .about-image {
        order: 0;
        margin-bottom: var(--spacing-md);
    }

    .hero-title::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .hero-buttons {
        justify-content: center;
    }

    .footer-content {
        flex-direction: column;
        gap: var(--spacing-lg);
    }

    .footer-logo {
        text-align: center;
        margin-bottom: var(--spacing-md);
    }

    .footer-logo .social-links {
        justify-content: center;
    }

    .footer-links {
        justify-content: space-between;
        width: 100%;
    }
}

/* Small Devices (Landscape Phones, less than 768px) */
@media (max-width: 767.98px) {
    .header {
        padding: var(--spacing-xs) 0;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-list {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: auto;
        max-height: calc(100vh - 70px);
        background-color: var(--light-bg);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: var(--spacing-md);
        transition: all 0.3s ease;
        border-top: var(--brutal-border-width) solid var(--brutal-border-color);
        z-index: 999;
        padding: var(--spacing-md) 0;
        overflow-y: auto;
    }

    .nav-list.active {
        left: 0;
    }
    
    .auth-links.active {
        display: flex;
        position: fixed;
        left: 0;
        width: 100%;
        background-color: var(--light-bg);
        z-index: 999;
        padding-bottom: var(--spacing-md);
        top: auto;
        bottom: 0;
        box-shadow: 0 -5px 10px rgba(0,0,0,0.05);
    }

    .nav-link {
        font-size: 1.2rem;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.3rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .courses-grid,
    .faculty-grid,
    .events-grid {
        grid-template-columns: 1fr;
    }

    .stats-container {
        flex-wrap: wrap;
    }

    .stat-item {
        flex: 1 0 calc(50% - var(--spacing-sm));
    }

    .footer-links {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }

    .contact-info {
        grid-template-columns: 1fr;
    }

    .event-card {
        flex-direction: column;
    }

    /* Fix for event-date in event cards (not in info section) */
    .event-card .event-date {
        flex-direction: row;
        width: 100%;
        margin: -1rem -1rem 1rem -1rem;
        border-radius: calc(var(--clay-radius) - 8px) calc(var(--clay-radius) - 8px) 0 0;
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .event-card .event-content {
        padding-left: 0;
    }
    
    /* Header responsive styles */
    .logo {
        gap: var(--spacing-xs);
    }
    
    .school-logo {
        width: 45px;
        height: 45px;
    }
    
    .logo h1 {
        font-size: 1.1rem;
    }
}

/* Extra Small Devices (Portrait Phones, less than 576px) */
@media (max-width: 575.98px) {
    html {
        font-size: 13px;
    }

    .container {
        width: 100%;
        padding: 0 15px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: var(--spacing-sm);
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .btn {
        width: 100%;
    }

    .testimonial-author {
        flex-direction: column;
        text-align: center;
    }

    .slider-controls {
        gap: var(--spacing-sm);
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* Animation for Menu Toggle */
@media (max-width: 767.98px) {
    .menu-toggle.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}

/* Adjust Clay Card Styles for Mobile */
@media (max-width: 575.98px) {
    .clay-card {
        padding: var(--spacing-sm);
        border-width: 2px;
        box-shadow: 
            4px 4px 0 var(--brutal-shadow-color),
            inset 1px 1px 3px var(--clay-shadow-light),
            inset -1px -1px 3px var(--clay-shadow-dark);
    }

    .btn {
        border-width: 2px;
        box-shadow: 4px 4px 0 var(--brutal-shadow-color);
    }
}


/* Info Section Responsive Styles */
@media (max-width: 991.98px) {
    .info-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .info-card {
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 767.98px) {
    .notice-item,
    .event-item {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    
    .notice-date,
    .event-date {
        margin-bottom: var(--spacing-xs);
        width: 100%;
        max-width: 100%;
        flex-direction: row;
        justify-content: center;
        height: 45px;
    }
    
    .event-day {
        margin-right: 5px;
    }
    
    .event-month {
        margin-left: 5px;
    }
    
    .principal-image {
        width: 120px;
        height: 120px;
    }

    /* Fix for upcoming events container in mobile view */
    .info-card {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .events-list {
        width: 100%;
        box-sizing: border-box;
    }

    .event-content {
        width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
        box-sizing: border-box;
    }
    
    .event-content h4 {
        font-size: 1rem;
    }
    
    .event-content p {
        font-size: 0.9rem;
        max-width: 100%;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .info-card:last-child {
        grid-column: span 2;
    }
}

/* Event Gallery Responsive Styles */
@media (max-width: 991.98px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
}

@media (max-width: 767.98px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .event-photo-caption {
        padding: var(--spacing-xs);
    }
    
    .event-photo-caption h3 {
        font-size: 1.2rem;
    }
    
    .event-photo-caption p {
        font-size: 0.9rem;
    }
    
    .video-gallery-title {
        font-size: 1.5rem;
    }
    
    /* Fix for upcoming events section */
    .events .events-grid {
        width: 100%;
    }
    
    .events .event-card {
        width: 100%;
    }
    
    .events .event-content {
        width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}