/* ========================================
   MOBILE RESPONSIVE ENHANCEMENTS
   Complete mobile optimization for all devices
   ======================================== */

/* ========================================
   1. MOBILE-FIRST BASE STYLES
   ======================================== */

/* Ensure proper viewport behavior */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Prevent horizontal scroll */
.container,
.container-premium {
    max-width: 100%;
    overflow-x: hidden;
}

/* ========================================
   2. HEADER TOP SECTION - MOBILE
   ======================================== */

@media (max-width: 991px) {
    .header-top-premium {
        padding: 15px 0;
    }

    .header-brand-premium {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .header-logo {
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
    }

    .header-college-info h1 {
        font-size: 1.25rem;
        margin-bottom: 5px;
    }

    .header-tagline {
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    .header-top-premium {
        padding: 10px 0;
    }

    .header-logo {
        width: 50px;
        height: 50px;
    }

    .header-college-info h1 {
        font-size: 1.1rem;
    }

    .header-tagline {
        font-size: 0.7rem;
    }
}

/* ========================================
   3. NAVIGATION - MOBILE
   ======================================== */

@media (max-width: 991px) {

    /* Ensure navbar container is visible */
    .navbar-premium {
        padding: 10px 0;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Ensure container is visible */
    .navbar-premium .container-premium {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    /* Mobile menu - hidden by default, slides in from left */
    .navbar-menu {
        position: fixed;
        top: 68px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 68px);
        background: #ffffff;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        padding: 20px;
        transition: left 0.3s ease;
        z-index: 999;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        display: flex !important;
    }

    /* Show menu when active */
    .navbar-menu.active {
        left: 0;
    }

    .navbar-menu li {
        width: 100%;
        margin: 0 0 15px 0;
    }

    .navbar-link {
        display: block;
        padding: 12px 15px;
        border-radius: 8px;
        transition: all 0.3s ease;
        font-size: 1rem;
    }

    .navbar-link:hover {
        background: rgba(0, 33, 71, 0.1);
        color: #002147;
    }

    /* Hamburger menu button - MUST BE VISIBLE */
    .navbar-toggle {
        display: flex !important;
        flex-direction: column;
        gap: 5px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 10px;
        z-index: 1000;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .navbar-toggle span {
        width: 25px;
        height: 3px;
        background: #002147;
        border-radius: 3px;
        transition: all 0.3s ease;
        display: block;
    }

    .navbar-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }

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

    .navbar-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .btn-login-nav {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
    }
}

/* Mobile overlay when menu is open */
@media (max-width: 991px) {
    .navbar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 9998;
    }

    .navbar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

/* ========================================
   4. HERO SECTION - MOBILE
   ======================================== */

@media (max-width: 991px) {
    .hero-premium {
        min-height: 50vh !important;
        padding: 60px 20px;
    }

    .hero-content-premium h1 {
        font-size: 2rem;
    }

    .hero-content-premium .tagline {
        font-size: 1rem;
    }

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

    .btn-hero-primary,
    .btn-hero-secondary {
        width: 100%;
        padding: 14px 30px;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .hero-premium {
        min-height: 40vh !important;
        padding: 40px 15px;
    }

    .hero-content-premium h1 {
        font-size: 1.5rem;
    }

    .hero-content-premium .tagline {
        font-size: 0.9rem;
    }
}

/* ========================================
   5. SECTIONS - MOBILE SPACING
   ======================================== */

@media (max-width: 991px) {
    .section-premium {
        padding: 50px 0 !important;
    }

    .container-premium {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    .section-title {
        margin-bottom: 35px !important;
    }

    .section-title h2 {
        font-size: 1.75rem;
    }

    .section-title p {
        font-size: 0.95rem;
    }
}

@media (max-width: 576px) {
    .section-premium {
        padding: 40px 0 !important;
    }

    .container-premium {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    .section-title h2 {
        font-size: 1.5rem;
    }

    .section-title p {
        font-size: 0.9rem;
    }
}

/* ========================================
   6. CARDS - MOBILE LAYOUT
   ======================================== */

@media (max-width: 991px) {

    .card-premium,
    .activity-card,
    .news-card,
    .career-item {
        margin-bottom: 20px;
    }

    .card-premium h4,
    .activity-card h4,
    .news-card h4 {
        font-size: 1.1rem;
    }

    .card-premium p,
    .activity-card p,
    .news-card p {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {

    .card-premium,
    .activity-card,
    .news-card,
    .career-item {
        padding: 20px;
    }
}

/* ========================================
   7. STATS/COUNTERS - MOBILE
   ======================================== */

@media (max-width: 991px) {
    .stats-grid {
        gap: 15px !important;
        margin: 25px 0 !important;
    }

    .stat-box {
        min-height: 100px !important;
        padding: 18px 14px !important;
    }

    .stat-number {
        font-size: 2rem !important;
    }

    .stat-label {
        font-size: 0.75rem !important;
    }
}

@media (max-width: 576px) {
    .stats-grid {
        gap: 12px !important;
        margin: 20px 0 !important;
    }

    .stat-box {
        min-height: 85px !important;
        padding: 15px 10px !important;
    }

    .stat-number {
        font-size: 1.6rem !important;
    }

    .stat-label {
        font-size: 0.7rem !important;
    }
}

/* ========================================
   8. WELCOME/ABOUT SECTION - MOBILE
   ======================================== */

@media (max-width: 991px) {

    .about-image-col,
    .about-content-col {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .about-image-col {
        margin-bottom: 30px !important;
    }

    .about-title {
        font-size: 1.75rem !important;
    }

    .about-subtitle {
        font-size: 1rem !important;
    }

    .about-description {
        font-size: 0.95rem !important;
    }

    .campus-carousel-wrapper {
        height: 300px !important;
    }
}

@media (max-width: 576px) {
    .about-title {
        font-size: 1.5rem !important;
    }

    .about-subtitle {
        font-size: 0.9rem !important;
    }

    .about-description {
        font-size: 0.875rem !important;
    }

    .campus-carousel-wrapper {
        height: 250px !important;
    }
}

/* ========================================
   9. FACULTIES GRID - MOBILE
   ======================================== */

@media (max-width: 991px) {
    .row.g-4 {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 1rem;
    }

    /* 2 columns on tablet */
    .col-lg-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 576px) {

    /* 1 column on mobile */
    .col-lg-3,
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ========================================
   10. NOTICE BOARD - MOBILE
   ======================================== */

@media (max-width: 991px) {
    .notice-item {
        padding: 15px;
    }

    .notice-date {
        font-size: 0.75rem;
    }

    .notice-item h4 {
        font-size: 1rem;
    }

    .notice-item p {
        font-size: 0.875rem;
    }
}

/* ========================================
   11. ACTIVITIES & NEWS - MOBILE
   ======================================== */

@media (max-width: 991px) {

    .activity-card,
    .news-card {
        margin-bottom: 20px;
    }

    .activity-image,
    .news-image {
        height: 200px;
    }
}

@media (max-width: 576px) {

    .activity-image,
    .news-image {
        height: 180px;
    }
}

/* ========================================
   12. CAREER & PLACEMENTS - MOBILE
   ======================================== */

@media (max-width: 991px) {

    .career-list,
    .placement-stats {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .placement-stats {
        margin-top: 30px;
    }

    .career-item {
        padding: 20px;
    }

    .career-item h4 {
        font-size: 1.1rem;
    }
}

/* ========================================
   13. ADMISSION FORM - MOBILE
   ======================================== */

@media (max-width: 991px) {

    .col-md-4,
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .form-control,
    .form-select {
        font-size: 16px !important;
        /* Prevents zoom on iOS */
    }
}

/* ========================================
   14. FOOTER - MOBILE
   ======================================== */

@media (max-width: 991px) {
    .footer-premium {
        padding: 40px 0 20px;
    }

    .footer-premium .row>div {
        margin-bottom: 30px;
    }

    .footer-premium h4 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .footer-premium p,
    .footer-premium li {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .footer-premium {
        padding: 30px 0 15px;
    }

    .footer-premium h4 {
        font-size: 1rem;
    }

    .footer-premium p,
    .footer-premium li {
        font-size: 0.85rem;
    }
}

/* ========================================
   15. BUTTONS - MOBILE TOUCH FRIENDLY
   ======================================== */

@media (max-width: 991px) {

    .btn-card,
    .btn-hero-primary,
    .btn-hero-secondary,
    .btn-career-apply {
        min-height: 44px;
        /* iOS touch target */
        padding: 12px 24px;
        font-size: 0.95rem;
    }
}

/* ========================================
   16. IMAGES - MOBILE OPTIMIZATION
   ======================================== */

@media (max-width: 991px) {
    img {
        max-width: 100%;
        height: auto;
    }

    .about-campus-image,
    .carousel-slide img {
        object-fit: cover;
        width: 100%;
    }
}

/* ========================================
   17. TABLES - MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 991px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 0.875rem;
    }
}

/* ========================================
   18. SCROLL PROGRESS BAR - MOBILE
   ======================================== */

@media (max-width: 991px) {
    .scroll-progress {
        height: 3px;
    }
}

/* ========================================
   19. AFFILIATION STRIP - MOBILE
   ======================================== */

@media (max-width: 991px) {
    .affiliation-strip-premium {
        padding: 20px 0;
    }

    .affiliation-quote {
        font-size: 1.1rem;
    }

    .affiliation-details {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .affiliation-strip-premium {
        padding: 15px 0;
    }

    .affiliation-quote {
        font-size: 1rem;
    }

    .affiliation-details {
        font-size: 0.85rem;
    }
}

/* ========================================
   20. UTILITY CLASSES - MOBILE
   ======================================== */

@media (max-width: 991px) {
    .text-center-mobile {
        text-align: center !important;
    }

    .mb-mobile-3 {
        margin-bottom: 1rem !important;
    }

    .mt-mobile-3 {
        margin-top: 1rem !important;
    }

    .d-none-mobile {
        display: none !important;
    }

    .d-block-mobile {
        display: block !important;
    }
}

/* ========================================
   21. TOUCH INTERACTIONS
   ======================================== */

@media (hover: none) and (pointer: coarse) {

    /* Remove hover effects on touch devices */
    .card-premium:hover,
    .activity-card:hover,
    .news-card:hover {
        transform: none;
    }

    /* Add active states for touch */
    .card-premium:active,
    .activity-card:active,
    .news-card:active {
        transform: scale(0.98);
    }

    .btn-card:active,
    .btn-hero-primary:active,
    .btn-hero-secondary:active {
        transform: scale(0.95);
    }
}

/* ========================================
   22. LANDSCAPE MODE - MOBILE
   ======================================== */

@media (max-width: 991px) and (orientation: landscape) {
    .hero-premium {
        min-height: 70vh !important;
    }

    .campus-carousel-wrapper {
        height: 250px !important;
    }
}

/* ========================================
   23. VERY SMALL SCREENS (< 360px)
   ======================================== */

@media (max-width: 359px) {
    .header-college-info h1 {
        font-size: 1rem;
    }

    .hero-content-premium h1 {
        font-size: 1.3rem;
    }

    .section-title h2 {
        font-size: 1.3rem;
    }

    .stat-number {
        font-size: 1.4rem !important;
    }

    .btn-hero-primary,
    .btn-hero-secondary {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* ========================================
   24. ACCESSIBILITY - MOBILE
   ======================================== */

@media (max-width: 991px) {

    /* Larger tap targets */
    a,
    button {
        min-height: 44px;
        min-width: 44px;
    }

    /* Better focus states for keyboard navigation */
    a:focus,
    button:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 3px solid #667eea;
        outline-offset: 2px;
    }
}

/* ========================================
   25. PERFORMANCE OPTIMIZATIONS
   ======================================== */

@media (max-width: 991px) {

    /* Reduce animations on mobile for better performance */
    .scroll-animate {
        animation: none !important;
    }

    /* Simpler transitions */
    * {
        transition-duration: 0.2s !important;
    }
}

/* ========================================
   26. SAFE AREAS (iOS NOTCH SUPPORT)
   ======================================== */

@supports (padding: max(0px)) {

    .header-top-premium,
    .navbar-premium {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }

    .navbar-menu {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
}