/* Advanced Responsive Design Enhancements */

/* Container Queries (Future-proofing) */
@container (min-width: 768px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@container (min-width: 1024px) {
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Fluid Typography */
.fluid-text-xs { font-size: clamp(0.75rem, 2vw, 0.875rem); }
.fluid-text-sm { font-size: clamp(0.875rem, 2.5vw, 1rem); }
.fluid-text-base { font-size: clamp(1rem, 3vw, 1.125rem); }
.fluid-text-lg { font-size: clamp(1.125rem, 3.5vw, 1.25rem); }
.fluid-text-xl { font-size: clamp(1.25rem, 4vw, 1.5rem); }
.fluid-text-2xl { font-size: clamp(1.5rem, 5vw, 2rem); }
.fluid-text-3xl { font-size: clamp(1.875rem, 6vw, 2.5rem); }
.fluid-text-4xl { font-size: clamp(2.25rem, 8vw, 3.5rem); }

/* Responsive Spacing */
.responsive-padding {
    padding: clamp(1rem, 5vw, 3rem);
}

.responsive-margin {
    margin: clamp(1rem, 5vw, 3rem);
}

.responsive-gap {
    gap: clamp(1rem, 3vw, 2rem);
}

/* Mobile-First Grid System */
.grid-responsive {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

@media (min-width: 640px) {
    .grid-responsive {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-responsive {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .grid-responsive {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Responsive Navigation */
@media (max-width: 991px) {
    .navbar-collapse {
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(30px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: var(--radius-lg);
        margin-top: var(--space-md);
        padding: var(--space-lg);
        box-shadow: var(--shadow-elevation-4);
    }

    .navbar-nav {
        gap: var(--space-sm);
    }

    .nav-link {
        padding: var(--space-md);
        border-radius: var(--radius-md);
        justify-content: flex-start;
    }

    .nav-link:hover {
        background: rgba(0, 255, 157, 0.1);
        transform: translateX(5px);
    }

    .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        margin: var(--space-sm) 0;
        background: rgba(0, 0, 0, 0.5);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: var(--radius-md);
        backdrop-filter: blur(10px);
    }

    .dropdown-item {
        color: var(--text-secondary);
        padding: var(--space-sm) var(--space-md);
        transition: all 0.3s ease;
    }

    .dropdown-item:hover {
        background: rgba(0, 255, 157, 0.1);
        color: var(--primary-color);
        transform: translateX(5px);
    }

    .login-link {
        margin: var(--space-md) 0 0 0;
        justify-content: center;
    }
}

/* Mobile Hero Optimizations */
@media (max-width: 768px) {
    .hero-section {
        min-height: 90vh;
        padding: var(--space-xl) 0;
        text-align: center;
    }

    .hero-section .container {
        padding: 0 var(--space-lg);
    }

    .hero-section h1 {
        font-size: clamp(2rem, 10vw, 3rem);
        margin-bottom: var(--space-lg);
    }

    .hero-section .lead {
        font-size: clamp(1rem, 4vw, 1.25rem);
        margin-bottom: var(--space-xl);
    }

    .hero-image-container {
        margin-top: var(--space-xl);
    }

    .hero-image-container img {
        max-width: 90%;
    }
}

/* Tablet Optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        max-width: 90%;
    }

    .hero-section h1 {
        font-size: clamp(2.5rem, 6vw, 3.5rem);
    }

    .card, .team-card, .event-card {
        padding: var(--space-lg);
    }

    .team-image {
        width: 110px;
        height: 110px;
    }

    .faculty-card .team-image {
        width: 140px;
        height: 140px;
    }
}

/* Large Screen Optimizations */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }

    .hero-section h1 {
        font-size: clamp(3rem, 5vw, 4.5rem);
    }

    .section-title {
        font-size: clamp(2rem, 4vw, 3rem);
    }

    .card, .team-card, .event-card {
        padding: var(--space-2xl);
    }

    .team-image {
        width: 140px;
        height: 140px;
    }

    .faculty-card .team-image {
        width: 180px;
        height: 180px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn, .nav-link, .card {
        transform: none !important;
    }

    .btn:hover, .nav-link:hover, .card:hover {
        transform: none !important;
    }

    .magnetic-button {
        transform: none !important;
    }

    .custom-cursor,
    .cursor-follower {
        display: none !important;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .brand-logo,
    .footer-logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: 100vh;
        padding: var(--space-lg) 0;
    }

    .hero-section h1 {
        font-size: clamp(1.5rem, 8vw, 2.5rem);
        margin-bottom: var(--space-md);
    }

    .hero-section .lead {
        font-size: clamp(0.875rem, 3vw, 1.125rem);
        margin-bottom: var(--space-lg);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .hero-image-container::before,
    .float-animation,
    .glow-effect {
        animation: none !important;
    }

    .parallax-element {
        transform: none !important;
    }

    * {
        transition-duration: 0.1s !important;
        animation-duration: 0.1s !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #00ff00;
        --bg-glass: rgba(255, 255, 255, 0.2);
        --glass-border: rgba(255, 255, 255, 0.4);
        --text-secondary: #ffffff;
    }

    .card, .team-card, .event-card {
        border-width: 2px;
    }

    .btn {
        border-width: 2px;
        border-style: solid;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .social-links,
    .custom-cursor,
    .cursor-follower {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
        line-height: 1.4;
    }

    .hero-section,
    .card,
    .team-card {
        background: white !important;
        color: black !important;
        border: 1px solid black !important;
        box-shadow: none !important;
    }

    .section-title {
        color: black !important;
        border-bottom: 2px solid black;
        padding-bottom: 0.5rem;
    }

    .team-image img {
        filter: grayscale(100%);
    }

    a {
        color: black !important;
        text-decoration: underline !important;
    }

    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }

    .row {
        margin: 0 !important;
    }

    .col-lg-4,
    .col-md-6,
    .col-sm-12 {
        width: 100% !important;
        margin-bottom: 1rem !important;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-transparency: reduce) {
    .navbar,
    .card,
    .team-card,
    .event-card {
        backdrop-filter: none !important;
        background: rgba(10, 10, 10, 0.95) !important;
    }
}

/* Focus Visible */
.btn:focus-visible,
.nav-link:focus-visible,
.form-control:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 255, 157, 0.2);
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip Links */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: var(--text-dark);
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10001;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 6px;
}