/* ===== Mobile Responsive Sidebar ===== */
@media (max-width: 768px) {

    /* Sidebar full screen on mobile */
    .sidebar {
        width: 220px;
        left: -220px;
        border-radius: 0;
    }

    .sidebar.active {
        left: 0;
    }

    /* Push main content when sidebar opens */
    .main {
        margin-left: 0;
    }

    /* Toggle button smaller */
    .toggle-btn {
        top: 0.8rem;
        left: 0.8rem;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    /* Hero text resize */
    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1rem;
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 200px;
        left: -200px;
    }

    .toggle-btn {
        padding: 0.4rem 0.9rem;
        font-size: 0.85rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    nav {
        position: absolute;
        top: 105px;
        right: 0;
        background: rgba(139, 0, 0, 0.95);
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
    }

    nav.open {
        max-height: 400px;
        /* enough for menu */

    }

    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 20px 0;
    }

    .hamburger {
        display: flex;
    }
}

/* ===== RESPONSIVE HERO ===== */
@media (max-width: 992px) {
    .vimarsh-hero h1 {
        font-size: 4rem;
    }

    .vimarsh-hero p {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .vimarsh-hero {
        padding: 40px 15px;
        border-bottom-left-radius: 30px;
        border-bottom-right-radius: 30px;
    }

    .vimarsh-hero h1 {
        font-size: 3rem;
        line-height: 1.2;
    }

    .vimarsh-hero p {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .btn-primary,
    .btn-outline {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
        padding: 12px 20px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .vimarsh-hero {
        background: url("https://res.cloudinary.com/dnwpgcx7i/image/upload/v1757593238/Collage_photot_for_Mobile_tdlpkx.png") center / cover no-repeat;
    }

    .vimarsh-hero h1 {
        font-size: 2.2rem;
    }

    .vimarsh-hero p {
        font-size: 0.9rem;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .speaker-card {
        flex: 0 0 240px;
        height: 320px;
    }
}

@media (max-width: 768px) {
    .speakers {
        padding: 60px 5%;
    }

    .speakers h2 {
        font-size: 2rem;
    }

    .speakers-track {
        gap: 20px;
        /* animation: scroll-left 30s linear infinite; */
    }

    .speaker-card {
        flex: 0 0 220px;
        height: 300px;
    }

    .speaker-back h3 {
        font-size: 1rem;
    }

    .speaker-back p {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .speakers {
        padding: 50px 20px;
    }

    .speakers h2 {
        font-size: 1.7rem;
    }

    .speakers-track {
        gap: 15px;
    }

    .speaker-card {
        flex: 0 0 180px;
        height: 260px;
    }

    .speaker-back h3 {
        font-size: 0.95rem;
    }

    .speaker-back p {
        font-size: 0.8rem;
    }
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
    .speaker-inner {
        transition: none;
    }

    .speaker-front img {
        transition: none;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .gallery {
        padding: 60px 5%;
    }

    .gallery h2 {
        font-size: 2rem;
        margin-bottom: 30px;
    }

    .slider-track img {
        width: 250px;
        height: 170px;
    }
}

@media (max-width: 768px) {
    .gallery {
        padding: 50px 5%;
    }

    .gallery h2 {
        font-size: 1.8rem;
    }

    .slider-track {
        gap: 10px;
        animation: slide 20s linear infinite;
        /* faster on smaller screens */
    }

    .slider-track img {
        width: 220px;
        height: 150px;
    }
}

@media (max-width: 480px) {
    .gallery {
        padding: 40px 20px;
    }

    .gallery h2 {
        font-size: 1.5rem;
    }

    .slider-track {
        gap: 8px;
        animation: slide 15s linear infinite;
        /* even faster for mobile */
    }

    .slider-track img {
        width: 180px;
        height: 130px;
        border-radius: 12px;
    }

    .btn-primary {
        padding: 10px 22px;
        font-size: 0.9rem;
    }
}

/* ===== MOBILE RESPONSIVENESS ===== */
@media (max-width: 1024px) {
    .registration {
        padding: 60px 6%;
    }

    .registration h2 {
        font-size: 2rem;
    }

    .form-container {
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .registration {
        padding: 50px 5%;
    }

    .registration h2 {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }

    .form-container {
        padding: 25px 20px;
        border-radius: 15px;
    }

    form .form-row {
        flex-direction: column;
        gap: 15px;
    }

    .form-group {
        flex: 1 1 100%;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 0.95rem;
        padding: 10px 12px;
    }

    form button.btn-primary {
        font-size: 1rem;
        padding: 12px 0;
    }
}

@media (max-width: 480px) {
    .registration {
        padding: 40px 4%;
    }

    .registration h2 {
        font-size: 1.6rem;
        margin-bottom: 25px;
    }

    .form-container {
        padding: 20px 15px;
        border-radius: 12px;
    }

    .form-group label {
        font-size: 0.9rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 0.9rem;
        padding: 10px;
    }

    form button.btn-primary {
        font-size: 0.95rem;
        padding: 10px 0;
    }

    .registration-fee h3 {
        font-size: 1rem;
    }

    .fee-amount {
        font-size: 1.5rem;
    }
}

/* ===== MOBILE RESPONSIVENESS ===== */
@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    #lightbox img {
        max-width: 95%;
        max-height: 75%;
    }

    .lightbox-arrow {
        font-size: 40px;
        padding: 8px;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }

    .filter-buttons {
        gap: 8px;
    }

    .filter-btn,
    .back-btn {
        padding: 8px 15px;
        font-size: 14px;
    }


    #lightbox img {
        max-width: 90%;
        max-height: 70%;
    }

    .lightbox-arrow {
        font-size: 35px;
    }

    #lightbox .close {
        font-size: 35px;
        top: 15px;
        right: 20px;
    }
}

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

    .filter-buttons {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .filter-btn,
    .back-btn {
        width: 80%;
        margin: 5px 0;
    }

    #lightbox img {
        max-width: 100%;
        max-height: 60%;
    }

    .lightbox-arrow {
        font-size: 30px;
        left: 10px;
        right: 10px;
    }

    #lightbox .close {
        font-size: 30px;
    }
}

/* Know More */
/* --- MOBILE MEDIA QUERY --- */
@media (max-width: 768px) {
    .brouchure {
        background: url('https://res.cloudinary.com/dnwpgcx7i/image/upload/v1757593238/Collage_photot_for_Mobile_tdlpkx.png') center / cover no-repeat;
    }

    .book {
        width: 90%;
        height: auto;
        /* Let the height be flexible */
        aspect-ratio: 9/16;
        /* Add an aspect ratio for consistent sizing */
        perspective: 1500px;
    }

    .page {
        width: 100%;
        height: 100%;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        /* No need to change transform or positioning */
    }

    .page img {
        height: 100%;
        /* Image fills the container height */
        width: 100%;
        /* Image fills the container width */
        object-fit: contain;
        /* This is the key to prevent stretching */
        border-radius: 8px;
    }

    .nav-btn {
        display: none;
        /* Hide navigation buttons on mobile */
    }

    .popup,
    .last-popup {
        bottom: 20px;
        width: 85%;
        font-size: 0.9rem;
        padding: 10px 15px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }

    .last-popup {
        bottom: 30px;
    }
}

@media (max-width: 480px) {
    .brouchure {
        background: url("https://res.cloudinary.com/dnwpgcx7i/image/upload/v1757593238/Collage_photot_for_Mobile_tdlpkx.png") center / cover no-repeat;
    }

    .book {
        width: 95%;
        /* Make it slightly wider to fill more of the screen */
        aspect-ratio: 9/16;
        /* Maintain aspect ratio */
        perspective: 1000px;
        /* Reduce perspective for a less dramatic 3D effect on small screens */
    }

    .page {
        height: 80% !important;
        top: 60px !important;

    }

    .page img {
        border-radius: 6px;
        /* Match page border radius */
    }

    .nav-btn {
        display: none;
        /* Keep buttons hidden */
    }

    .popup,
    .last-popup {
        bottom: 15px;
        /* Move popups slightly higher to avoid interfering with the bottom edge */
        width: 90%;
        /* Increase popup width to fill more of the screen */
        font-size: 0.8rem;
        /* Smaller font size for better readability */
        padding: 8px 12px;
        /* Reduce padding */
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        /* Softer shadow */
    }

    .last-popup {
        bottom: 25px;
        /* Adjust last-popup position accordingly */
    }
}

/* Responsive behaviour — stack rows nicely on mobile */

/* --- RESPONSIVE FOR TABLETS & MOBILES --- */
@media (max-width: 900px) {
    .schedule {
        padding: 40px 5%;
    }

    /* Turn rows into cards */
    .schedule-table table,
    .schedule-table thead,
    .schedule-table tbody,
    .schedule-table th,
    .schedule-table td,
    .schedule-table tr {
        display: block;
        width: 100%;
    }

    .schedule-table thead {
        display: none;
    }

    .schedule-table tbody tr {
        background: #fff;
        display: block;
        margin: 0 0 18px;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
        padding: 10px 12px;
        overflow: hidden;
    }

    .schedule-table td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 10px 8px;
        border-bottom: 1px solid #f2f2f2;
    }

    .schedule-table td:last-child {
        border-bottom: none;
    }

    .schedule-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #444;
        flex: 0 0 40%;
        text-align: left;
        padding-right: 8px;
    }

    .schedule-table td span {
        flex: 1;
        text-align: right;
        display: block;
        color: #333;
        word-break: break-word;
    }
}

/* --- SMALL MOBILES (≤ 480px) --- */
@media (max-width: 480px) {
    .schedule {
        padding: 28px 4%;
    }

    .schedule h2 {
        font-size: 1.8rem;
    }

    .filter-buttons {
        gap: 8px;
    }

    .filter-buttons button {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .schedule-table tbody tr {
        padding: 8px;
        margin-bottom: 14px;
    }

    .schedule-table td {
        flex-direction: column;
        align-items: flex-start;
        padding: 6px 4px;
    }

    .schedule-table td::before {
        margin-bottom: 4px;
        flex: unset;
        width: auto;
    }

    .schedule-table td span {
        text-align: left;
        width: 100%;
    }
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 768px) {
    .scroll-buttons {
        right: 12px;
        bottom: 20px;
        gap: 10px;
    }

    .scroll-buttons button {
        padding: 10px;
        border-radius: 6px;
        font-size: 0.85rem;
        justify-content: center;
        gap: 0;
        width: 42px;
        /* Square-ish */
        height: 42px;
    }

    .scroll-buttons button span {
        display: none;
        /* Hide "Top/Bottom" text */
    }

    .scroll-buttons i {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .scroll-buttons {
        right: 8px;
        bottom: 15px;
        gap: 8px;
    }

    .scroll-buttons button {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .scroll-buttons i {
        font-size: 0.9rem;
    }
}

/* comman know more page */
/* --- Mobile Sidebar Navigation --- */
@media (max-width: 760px) {
    .hamburger-menu {
        display: block;
        position: fixed;
        top: 15px;
        right: 15px;
        z-index: 1500;
        font-size: 1.2rem;
        color: #fff;
        cursor: pointer;
        background: #8b0000;
        padding: 8px 10px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(139, 0, 0, 0.15);
        transition: all 0.2s ease;
    }

    .hamburger-menu:hover {
        transform: translateY(-1px);
        background: #990000;
    }

    .year-nav {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 260px;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
        z-index: 1400;
        transition: transform 0.4s ease;
        padding: 40px 0;
        transform: translateX(100%);
    }

    .year-nav.active {
        transform: translateX(0);
    }

    .year-nav a {
        font-size: 1.1rem;
        padding: 12px 20px;
        width: 75%;
        margin: 4px 0;
        border-radius: 8px;
        text-align: center;
        transition: all 0.2s ease;
        background: transparent;
    }

    .year-nav a:hover {
        background: rgba(139, 0, 0, 0.08);
        transform: translateX(-3px);
    }

    /* Adjust the active link style for the sidebar */
    .year-nav a.active::after {
        content: none;
        /* Hide the underline */
    }

    .year-nav a.active {
        background: #f0f0f0;
        color: #8b0000;
    }

    .home-link {
        margin-top: 20px !important;
        border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
        padding-top: 20px !important;
    }

    .home-link i {
        margin-right: 8px;
    }

    .year-nav-links {
        display: flex;
        flex-direction: column;
        width: 100%;
        align-items: center;
    }

    .know-more {
        /* Reduce padding for smaller screens */
        padding: 100px 5% 60px;
        gap: 60px;
        /* Reduced gap between sections */
    }

    /* Force sections to stack on top of each other */
    .km-section,
    .km-section:nth-child(even) {
        flex-direction: column;
        text-align: center;
    }

    .km-text {
        order: 2;
        /* Puts the text below the image */
    }

    .km-img {
        order: 1;
        /* Puts the image above the text */
        width: 100%;
        /* Make images take full screen width to prevent whitespace */
        max-width: 450px;
        /* Prevent images from getting too big on tablets */
        margin-top: 0;
    }

    .km-img img {
        height: auto;
        max-height: 250px;
        /* Limit the maximum height of the image */
        object-fit: contain;
        /* Ensure the image fits within the bounds without cropping */
    }

    .km-text h2 {
        /* Adjust heading size for better fit */
        font-size: 2rem;
    }

    .km-text p {
        /* Adjust paragraph font size for readability */
        font-size: 1rem;
        line-height: 1.5;
    }
}

@media (max-width: 480px) {

    .km-text h2 {
        font-size: 1.8rem;
    }

    .km-text p {
        font-size: 0.95rem;
    }

    .custom-alert .alert-content {
        padding: 20px;
        width: 85%;
    }
}

@media (max-width: 900px) {
    .km-section {
        flex-direction: column !important;
        text-align: center;
    }

    .km-img img {
        max-height: 280px;
        object-fit: cover;
    }
}