/* Responsive Design - utilities/responsive.css */

/* Large Tablets and Small Laptops: 992px and below */
@media (max-width: 992px) {
    .nav-container {
        padding: 0 var(--spacing-xs);
    }
    
    .hero h1 {
        font-size: 3.5rem;
    }
    
    .hero p {
        font-size: var(--font-size-lg);
    }
    
    .section {
        padding: var(--spacing-3xl) var(--spacing-md);
    }
    
    .section.with-navbar {
        padding-top: calc(var(--navbar-height) + var(--spacing-2xl));
    }
    
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: var(--spacing-md);
    }
    
    .speaker-card {
        padding: var(--spacing-lg);
    }
    
    .speaker-photo {
        width: 100px;
        height: 100px;
        font-size: var(--font-size-2xl);
    }
    
    .story-card {
        margin-bottom: var(--spacing-xl);
    }
    
    .story-content {
        padding: var(--spacing-lg);
    }
    
    .alumni-grid {
        /* grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); */
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: var(--spacing-md);
    }
    
    .modal-content {
        margin: 5% auto;
        padding: var(--spacing-lg);
    }
}

/* Tablets: 768px and below */
@media (max-width: 768px) {
    /* Navigation */
    .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .cta-button {
        padding: 0.6rem var(--spacing-lg);
        font-size: var(--font-size-sm);
    }

    .dropdown {
        display: none;
    }
    
    .mobile-dropdown {
        display: block;
    }

    .featured-program-card {
        grid-template-columns: 1fr;
    }
    
    .program-highlights-grid {
        grid-template-columns: 1fr;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        flex-direction: row !important;
        padding-left: 50px;
    }
    
    .timeline-date {
        position: absolute;
        left: -40px;
        width: 80px;
    }
    
    .timeline-content {
        margin: 0;
    }
    
    .photo-masonry {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .gallery-nav {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-lg);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-prev {
        left: 10px;
    }
    
    .nav-next {
        right: 10px;
    }
    
    .image-counter {
        top: 10px;
        right: 10px;
        padding: 0.3rem 0.6rem;
        font-size: var(--font-size-xs);
    }
    
    .gallery-info-overlay {
        padding: var(--spacing-md) var(--spacing-sm) 0.8rem;
        transform: translateY(0);
        background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    }
    
    .gallery-info-overlay h4 {
        font-size: var(--font-size-base);
    }
    
    .gallery-info-overlay p {
        font-size: var(--font-size-xs);
    }

    .program-intro-section {
        padding: 2rem 1.5rem 1.5rem 1.5rem;
    }
    
    .program-header h2 {
        font-size: 2rem;
    }
    
    .program-highlights-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .highlight-item {
        max-width: none;
        padding: 0.8rem;
    }
    
    .main-gallery {
        height: 250px;
    }
    
    .program-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .program-nav-prev {
        left: 10px;
    }
    
    .program-nav-next {
        right: 10px;
    }    

    .application-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .options-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .faq-question {
        padding: var(--spacing-md);
        font-size: var(--font-size-sm);
    }
    
    .faq-answer p {
        padding: var(--spacing-md);
        font-size: var(--font-size-sm);
    }
    
    .application-card {
        padding: var(--spacing-lg);
    }
    
    .option-card {
        padding: var(--spacing-lg);
    }
    
    .fee-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .about-card {
        padding: var(--spacing-lg);
    }
    
    .about-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .partnerships-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .partnership-item {
        padding: var(--spacing-sm);
    }
    
    .partnership-item:hover {
        transform: none;
    }
    
    .partnerships-section {
        padding: var(--spacing-lg);
    }
}

/* Small Tablets and Large Phones: 600px and below */
@media (max-width: 600px) {
    /* Navigation */
    .navbar {
        padding: 0.6rem 0.3rem;
        /* flex-shrink: 0; */
    }
    
    .nav-container {
        gap: 0.3rem;
    }
    
    .logo-icon {
        width: 35px;
        height: 35px;
    }
    
    .logo-main {
        font-size: calc(0.8 * var(--font-size-xl));
    }
    
    .cta-button {
        padding: var(--spacing-xs) var(--spacing-lg);
        font-size: var(--font-size-sm);
        min-width: auto;
    }
    
    /* Hero */
    .hero h1 {
        font-size: var(--font-size-xl);
    }
    
    .hero p {
        font-size: var(--font-size-base);
    }
    
    /* Sections */
    .section {
        padding: var(--spacing-xl) 0.8rem;
    }
    
    .section.with-navbar {
        padding-top: calc(var(--navbar-height) + var(--spacing-2xl));
    }
    
    .section-title {
        font-size: var(--font-size-xl);
    }
    
    .section-subtitle {
        font-size: var(--font-size-base);
        margin-bottom: var(--spacing-xl);
    }
    
    /* Cards */
    .card {
        padding: var(--spacing-md);
    }
    
    .card h3 {
        font-size: var(--font-size-lg);
    }
    
    /* Grid */
    .grid {
        margin-top: var(--spacing-md);
    }

    /* Speaker Cards */
    .speaker-card {
        padding: var(--spacing-md);
        flex-direction: column;
        text-align: center;
    }
    
    .speaker-photo {
        width: 80px;
        height: 80px;
        font-size: var(--font-size-md);
        margin-bottom: var(--spacing-sm);
    }
    
    .speaker-content h3 {
        font-size: var(--font-size-lg);
    }
    
    /* Story Cards */
    .story-header {
        padding: var(--spacing-lg);
    }
    
    .story-avatar {
        width: 60px;
        height: 60px;
        font-size: var(--font-size-xl);
    }
    
    .story-content {
        padding: var(--spacing-lg);
    }
    
    .story-impact {
        padding: var(--spacing-sm);
    }
    
    /* Alumni */
    .alumni-header {
        padding: var(--spacing-lg);
    }
    
    .alumni-avatar {
        width: 70px;
        height: 70px;
        font-size: var(--font-size-xl);
    }
    
    .alumni-content {
        padding: var(--spacing-lg);
    }
    
    /* Stats */
    .stats-section {
        padding: var(--spacing-xl) 0.8rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .stat-item {
        padding: var(--spacing-sm);
    }
    
    .stat-item h3 {
        font-size: 1.8rem;
    }
    
    .stat-item p {
        font-size: var(--font-size-sm);
    }
}

/* Mobile Phones: 480px and below */
@media (max-width: 480px) {
    /* Navigation */
    .navbar {
        padding: 0 var(--spacing-xs);
        flex-shrink: 0;
        height: calc(0.7 * var(--navbar-height));
        display: flex;
        align-items: center;
    }
    
    .nav-container {
        gap: calc(0.1 * var(--spacing-xs));
        align-items: center;
        display: flex;
        justify-content: space-between;
        height: 100%;
        width: 100%;
    }

    .nav-actions {
        flex-shrink: 0;
        gap: var(--spacing-sm);
        min-width: 160px;
        height: 100%;
        min-width: 160px;
        align-items: center;
    }
    
    /* logo */ 
    .logo-main, .logo-sub {
        display: none;
    }

    .logo {
        display: flex;
        align-items: center;
        gap: var(--spacing-xs);
        min-width: 0;
        max-width: calc(100% - 180px);
        flex: 1;
    }
    
    .logo-main {
        font-size: var(--font-size-sm);
        margin-left: calc(-1 * var(--spacing-xs));
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.1;
    }
    
    .logo-sub {
        margin-left: calc(-1 * var(--spacing-xs));
        font-size: 8px;
    }
    
    .logo img {
        width: 60px;
        height: 60px;
        flex-shrink: 0;
    }

    .cta-nav-button {
        padding: 0.5rem var(--spacing-md);
        font-size: calc(1 * var(--font-size-xs));
        font-weight: bold;
        order: 3;
        min-width: auto;
        margin-right: -10px;
    }

    /* language selector */
    .language-selector {
        order: 2; 
    }

    .language-toggle {
        padding: 0.4rem calc(0.8 * var(--spacing-sm));
        font-size: var(--font-size-md);
        min-width: 50px;
        height: 40px;
    }
    
    .language-toggle span:last-child {
        display: none; /* Hide dropdown arrow */
    }
    
    #current-lang {
        display: none; /* Show only flag */
    }
    
    .flag {
        width: 18px;
        height: 18px;
    }

    .language-toggle .flag {
        margin: 0 auto;
    }
    
    .language-option .flag {
        margin: 0; 
    }
    
    /* Mobile Menu */
    .mobile-menu-btn {
        order: 1;
        width: 40px;
        height: 40px;
        padding: 0.1rem;
    }

    .mobile-menu {
        top: 60px; /* Match new navbar height */
    }
    
    .mobile-menu-content {
        padding: 1rem;
    }
    
    .mobile-nav-link {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .mobile-dropdown-menu {
        padding-left: 1rem;
        background: #f8f9fa;
    }
    
    .mobile-dropdown-item {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        color: #666;
    }
    
    .hamburger {
        height: 2px;
        margin: 3px 0;
    }

    /* Hero */
    .hero {
        padding: 0 var(--spacing-xs);
    }
    
    .hero h1 {
        font-size: var(--font-size-2xl);
        line-height: 1.2;
    }
    
    .hero p {
        font-size: 0.95rem;
        margin-bottom: var(--spacing-md);
    }
    
    .hero-cta {
        gap: 0.8rem;
    }
    
    /* Sections */
    .section {
        padding: var(--spacing-lg) var(--spacing-xs);
    }
    
    .section.with-navbar {
        padding-top: calc(0.7 * var(--navbar-height) + var(--spacing-2xl));
    }
    
    .section-title {
        font-size: var(--font-size-2xl);
        line-height: 1.2;
    }
    
    .section-subtitle {
        font-size: 0.95rem;
        margin-bottom: var(--spacing-lg);
    }
    
    /* Cards */
    .card {
        padding: var(--spacing-lg);
    }
    
    .card-icon {
        width: 100%;
        height: 120px;
        border-radius: 18px;
        background: var(--primary-gradient);
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: var(--spacing-md);
        font-size: var(--font-size-xl);
        color: var(--text-white);
    }
    
    .card h3 {
        font-size: var(--font-size-lg);
        margin-bottom: 0.8rem;
    }
    
    .thumbnail {
        width: 50px;
        height: 38px;
        margin: 0.2rem;
    }
    
    .gallery-nav {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    
    .program-nav {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    
    /* Prevent text selection during swipes */
    .program-main-gallery,
    .main-gallery {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }
    
    /* Better touch feedback */
    .program-dot,
    .thumbnail {
        touch-action: manipulation;
    }
    
    .image-counter {
        font-size: 0.75rem;
        padding: 0.25rem var(--spacing-xs);
    }
    
    .gallery-info-overlay {
        padding: var(--spacing-sm) 0.8rem 0.6rem;
    }
    
    .gallery-info-overlay h4 {
        font-size: var(--font-size-sm);
    }
    
    .gallery-info-overlay p {
        font-size: 0.75rem;
    }
    
    /* Modal */
    .modal-content {
        margin: 5% auto;
        padding: var(--spacing-sm);
        width: 98%;
        border-radius: var(--radius-lg);
    }
    
    .close {
        top: 0.8rem;
        right: 0.8rem;
        font-size: var(--font-size-md);
        width: 28px;
        height: 28px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    /* Previous Programs */
    .filter-tab {
        padding: 0.6rem var(--spacing-sm);
        font-size: var(--font-size-sm);
    }
    
    .featured-content {
        padding: var(--spacing-md);
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .stories-masonry {
        grid-template-columns: 1fr;
    }
    
    /* Stats Grid Mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .stat-item {
        padding: var(--spacing-sm);
    }
    
    .stat-item h3 {
        font-size: 1.5rem;
    }
    
    .stat-item p {
        font-size: var(--font-size-sm);
    }
    
    /* Impact Stats Mobile */
    .impact-stats {
        gap: 0.8rem;
        flex-direction: column;
    }
    
    .impact-stat {
        min-width: auto;
    }
    
    .impact-stat strong {
        font-size: var(--font-size-lg);
    }
    
    .impact-stat span {
        font-size: var(--font-size-xs);
    }

    .program-intro-section {
        padding: 1.5rem 1rem 1rem 1rem;
    }
    
    .program-header h2 {
        font-size: 1.8rem;
    }
    
    .main-gallery {
        height: 200px;
    }
    
    .highlight-item {
        padding: 0.6rem;
        gap: 0.6rem;
    }
    
    .program-info-panel {
        padding: 1.5rem;
    }

    .about-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .about-intro .section-title {
        font-size: var(--font-size-xl);
    }
}

/* Very Small Screens: 320px and below */
@media (max-width: 380px) {
    .nav-actions {
        gap: 1rem;
    }

    .logo-main, .logo-sub {
        display: none;
    }

    .logo {
        margin: 0;
    }

    .hero h1 {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .card {
        padding: var(--spacing-sm);
    }
    
    .speaker-card,
    .story-card,
    .alumni-card {
        margin-bottom: var(--spacing-md);
    }
    
    .stats-grid {
        gap: 0.8rem;
    }
    
    .stat-item {
        padding: 0.8rem;
    }
    
    .stat-item h3 {
        font-size: 1.3rem;
    }
    
    .modal-content {
        padding: 0.8rem;
        margin: 2% auto;
    }
    
    .thumbnail-grid {
        gap: 0.25rem;
        padding: 0.5rem;
    }
    
    .thumbnail {
        width: 60px;
        height: 45px;
    }
}