/* Responsive Design - Enhanced for All Devices */

/* ===== GLOBAL RESPONSIVE SETTINGS ===== */
@media (max-width: 575.98px) {
    /* Extra Small Devices (Phones) */
    :root {
        --spacing-xl: 3rem;
        --spacing-lg: 2rem;
        --spacing-md: 1.5rem;
        --spacing-sm: 1rem;
    }
    
    html {
        font-size: 14px;
    }
    
    body {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    /* Typography */
    h1 { font-size: 2rem !important; }
    h2 { font-size: 1.75rem !important; }
    h3 { font-size: 1.5rem !important; }
    h4 { font-size: 1.25rem !important; }
    h5 { font-size: 1.1rem !important; }
    h6 { font-size: 1rem !important; }
    
    .display-1 { font-size: 2.5rem !important; }
    .display-2 { font-size: 2.25rem !important; }
    .display-3 { font-size: 2rem !important; }
    .display-4 { font-size: 1.75rem !important; }
    
    /* Containers */
    .container, 
    .container-sm, 
    .container-md, 
    .container-lg, 
    .container-xl, 
    .container-xxl {
        padding-right: 15px !important;
        padding-left: 15px !important;
    }
    
    
    /* Section Spacing */
    section {
        padding: 3rem 0 !important;
    }
    
    .py-5 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    .pt-5 {
        padding-top: 3rem !important;
    }
    
    .pb-5 {
        padding-bottom: 3rem !important;
    }
    
    /* Navigation Fix */
    .navbar {
        padding: 0.75rem 0;
    }
    
    .navbar-brand {
        max-width: 70%;
    }
    
    .nav-logo {
        height: 35px;
    }
    
    .nav-brand-text {
        font-size: 0.9rem;
        display: inline-block;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .navbar-toggler {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .navbar-collapse {
        background: rgba(126, 3, 156, 0.614);
        padding: 1rem;
        margin-top: 0.5rem;
        border-radius: 8px;
    }
    
    .nav-link {
        padding: 0.75rem 0.5rem !important;
        font-size: 0.95rem;
    }
    
    .dropdown-menu {
        background: rgba(255, 255, 255, 0.1);
        border: none;
        box-shadow: none;
    }
    
    .dropdown-item {
        color: rgba(255, 255, 255, 0.9);
        padding: 0.75rem 1rem;
    }
    
    .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.2);
    }
    
    /* Hero Section Fix */
    .hero-section {
        min-height: 100vh;
        height: auto;
        padding: 4rem 0;
    }
    
    .hero-title {
        font-size: 2rem !important;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem !important;
        margin-bottom: 1.5rem;
        line-height: 1.4;
    }
    
    .hero-description {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .scroll-indicator {
        bottom: 1rem;
        font-size: 1.25rem;
    }
    
    /* Statistics Section */
    .statistics-section .row {
        margin: 0 -5px;
    }
    
    .statistics-section [class*="col-"] {
        padding: 0 5px;
    }
    
    .stat-card {
        padding: 1.5rem 0.5rem;
        margin-bottom: 1rem;
    }
    
    .stat-icon {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }
    
    .stat-number {
        font-size: 1.75rem;
        margin-bottom: 0.25rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }
    
    /* Announcements Ticker */
    .announcement-ticker {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .ticker-label {
        font-size: 0.9rem;
    }
    
    .ticker-content {
        width: 100%;
        overflow: hidden;
    }
    
    .ticker-track {
        display: flex;
        animation: ticker-mobile 25s linear infinite;
        gap: 2rem;
    }
    
    .ticker-item {
        font-size: 0.85rem;
        padding: 0.25rem 0;
        white-space: nowrap;
    }
    
    @keyframes ticker-mobile {
        0% { transform: translateX(100%); }
        100% { transform: translateX(-400%); }
    }
    
    /* Features Section */
    .features-section .row {
        margin: 0 -10px;
    }
    
    .features-section [class*="col-"] {
        padding: 0 10px;
        margin-bottom: 1.5rem;
    }
    
    .feature-card {
        padding: 1.5rem 1rem;
        height: auto;
        margin-bottom: 0;
    }
    
    .feature-icon {
        font-size: 2rem;
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }
    
    .feature-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .feature-description {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    /* Programs Section */
    .programs-section {
        padding: 3rem 0;
    }
    
    .program-card {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
        height: auto;
    }
    
    .program-icon {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .program-title {
        font-size: 1.25rem;
    }
    
    .program-duration {
        font-size: 0.9rem;
    }
    
    .program-features {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }
    
    .program-features li {
        margin-bottom: 0.5rem;
    }
    
    .program-cta .btn {
        width: 100%;
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    /* News Section */
    .news-section .row {
        margin: 0 -10px;
    }
    
    .news-section [class*="col-"] {
        padding: 0 10px;
        margin-bottom: 1.5rem;
    }
    
    .news-card {
        margin-bottom: 0;
    }
    
    .news-image {
        height: 150px;
    }
    
    .news-content {
        padding: 1.25rem 1rem;
    }
    
    .news-meta {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .news-title {
        font-size: 1rem;
        line-height: 1.3;
        margin-bottom: 0.5rem;
    }
    
    .news-excerpt {
        font-size: 0.85rem;
        line-height: 1.5;
        margin-bottom: 0.75rem;
    }
    
    /* Testimonials */
    .testimonials-section {
        padding: 3rem 0;
    }
    
    .testimonial-content {
        padding: 0 1rem;
    }
    
    .testimonial-text p {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .quote-icon {
        font-size: 1.5rem;
    }
    
    .testimonial-author {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .testimonial-avatar {
        width: 50px;
        height: 50px;
    }
    
    .author-name {
        font-size: 1rem;
    }
    
    .author-info,
    .author-company {
        font-size: 0.8rem;
    }
    
    .carousel-control-prev,
    .carousel-control-next {
        width: 40px;
        height: 40px;
    }
    
    /* Gallery Section */
    .gallery-section .row {
        margin: 0 -5px;
    }
    
    .gallery-section [class*="col-"] {
        padding: 0 5px;
        margin-bottom: 10px;
    }
    
    .gallery-item {
        height: 120px;
    }
    
    .gallery-overlay {
        opacity: 0.8;
    }
    
    .gallery-overlay i {
        font-size: 1.5rem;
    }
    
    .gallery-overlay p {
        font-size: 0.75rem;
    }
    
    /* CTA Section */
    .cta-section {
        padding: 3rem 0;
        text-align: center;
    }
    
    .cta-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .cta-description {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }
    
    .cta-section .btn {
        width: 100%;
        max-width: 280px;
        margin: 0.5rem auto;
        display: block;
    }
    
    /* Newsletter Section */
    .newsletter-section {
        padding: 3rem 0;
    }
    
    .newsletter-form .input-group {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .newsletter-form .form-control {
        width: 100%;
        padding: 0.875rem;
        font-size: 0.95rem;
    }
    
    .newsletter-form .btn {
        width: 100%;
        padding: 0.875rem;
    }
    
    /* Footer */
    .site-footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-brand {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
        margin-bottom: 2rem;
    }
    
    .footer-logo {
        height: 40px;
    }
    
    .footer-college-name {
        font-size: 1.25rem;
    }
    
    .footer-description {
        font-size: 0.85rem;
        text-align: center;
        margin-bottom: 1.5rem;
    }
    
    .social-links {
        justify-content: center;
        margin-bottom: 2rem;
    }
    
    .social-link {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }
    
    .footer-heading {
        font-size: 1rem;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }
    
    .footer-links {
        margin-bottom: 1.5rem;
    }
    
    .footer-links li {
        margin-bottom: 0.5rem;
    }
    
    .footer-links a {
        font-size: 0.85rem;
    }
    
    .footer-contact {
        margin-bottom: 1.5rem;
    }
    
    .footer-contact li {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
        align-items: flex-start;
    }
    
    .footer-contact i {
        margin-top: 0.25rem;
        font-size: 0.9rem;
    }
    
    .footer-newsletter {
        margin-bottom: 1.5rem;
    }
    
    .footer-subheading {
        font-size: 0.95rem;
        margin-bottom: 0.75rem;
    }
    
    .footer-newsletter-form .input-group {
        flex-direction: column;
    }
    
    .footer-newsletter-form .form-control {
        margin-bottom: 0.5rem;
    }
    
    .footer-bottom {
        padding-top: 1.5rem;
        text-align: center;
    }
    
    .copyright {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }
    
    .footer-policies {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }
    
    .footer-policies a {
        font-size: 0.8rem;
    }
    
    /* Back to Top Button */
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
   
    
    /* Buttons */
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .btn-xl {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    /* Forms */
    .form-control-lg {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
    
    /* Utility Classes */
    .text-center-xs {
        text-align: center !important;
    }
    
    .d-xs-block {
        display: block !important;
    }
    
    .d-xs-none {
        display: none !important;
    }
    
    .mb-xs-3 {
        margin-bottom: 1rem !important;
    }
    
    .mt-xs-3 {
        margin-top: 1rem !important;
    }
    
    /* Parallax Disable on Mobile */
    .parallax-section {
        background-attachment: scroll !important;
        background-position: center !important;
        background-size: cover !important;
    }
    
    .parallax-bg {
        position: absolute !important;
        transform: none !important;
        will-change: auto !important;
    }
}

/* ===== SMALL DEVICES (Landscape phones, 576px and up) ===== */
@media (min-width: 576px) and (max-width: 767.98px) {
    html {
        font-size: 15px;
    }
    
    h1 { font-size: 2.25rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.75rem; }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .hero-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero-buttons .btn {
        min-width: 200px;
        margin: 0.5rem;
    }
    
    .stat-card {
        padding: 2rem 1rem;
    }
    
    .feature-card,
    .program-card {
        padding: 2rem 1.5rem;
    }
    
    .news-card {
        height: auto;
    }
    
    .news-image {
        height: 180px;
    }
    
    .gallery-item {
        height: 150px;
    }
    
    .navbar-brand {
        max-width: 250px;
    }
    
    .footer-brand {
        flex-direction: row;
        text-align: left;
    }
}

/* ===== MEDIUM DEVICES (Tablets, 768px and up) ===== */
@media (min-width: 768px) and (max-width: 991.98px) {
    html {
        font-size: 15px;
    }
    
    .container {
        padding: 0 1.5rem;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .feature-card,
    .program-card {
        padding: 2rem 1.5rem;
    }
    
    .news-card {
        height: auto;
    }
    
    .news-image {
        height: 200px;
    }
    
    .gallery-item {
        height: 180px;
    }
    
    .footer-brand {
        flex-direction: row;
        text-align: left;
    }
}

/* ===== LARGE DEVICES (Desktops, 992px and up) ===== */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
}

/* ===== EXTRA LARGE DEVICES (Large desktops, 1200px and up) ===== */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* ===== DEVICE SPECIFIC FIXES ===== */

/* iPhone SE and small phones */
@media (max-width: 374px) {
    .hero-title {
        font-size: 1.75rem !important;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
    }
    
    .stat-card {
        padding: 1rem 0.5rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .feature-card {
        padding: 1.25rem 0.75rem;
    }
    
    .gallery-item {
        height: 100px;
    }
}

/* Galaxy Fold and very narrow screens */
@media (max-width: 280px) {
    html {
        font-size: 12px;
    }
    
    .navbar-brand {
        max-width: 60%;
    }
    
    .nav-brand-text {
        font-size: 0.8rem;
        max-width: 120px;
    }
}

/* iPad Portrait */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .hero-section {
        min-height: 80vh;
    }
    
    .feature-card,
    .program-card {
        margin-bottom: 1.5rem;
    }
}

/* iPad Landscape */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
    .hero-section {
        min-height: 90vh;
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    /* Increase tap target sizes */
    .nav-link {
        padding: 1rem 0.75rem !important;
        min-height: 44px;
    }
    
    .btn {
        padding: 1rem 1.5rem;
        min-height: 44px;
    }
    
    .dropdown-item {
        padding: 1rem 1.25rem;
        min-height: 44px;
    }
    
    /* Disable hover effects */
    .hover-lift:hover,
    .hover-scale:hover,
    .hover-rotate:hover {
        transform: none !important;
    }
    
    .feature-card:hover,
    .program-card:hover,
    .news-card:hover {
        transform: none !important;
        box-shadow: var(--shadow-md) !important;
    }
    
    /* Show gallery overlay always on touch */
    .gallery-overlay {
        opacity: 0.7 !important;
    }
    
    /* Increase form input sizes */
    input, 
    select, 
    textarea {
        font-size: 16px !important; /* Prevents iOS zoom */
        min-height: 44px;
    }
}

/* ===== HIGH RESOLUTION DISPLAYS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-section .parallax-bg {
        background-image: url('assets/images/banners/hero-bg-1@2x.jpg');
    }
    
    .programs-section .parallax-bg {
        background-image: url("../../pages/academics/index.html");
    }
    
    .testimonials-section .parallax-bg {
        background-image: url('assets/images/parallax/testimonials-bg@2x.jpg');
    }
}

/* ===== REDUCED MOTION PREFERENCE ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .ticker-track {
        animation: none !important;
    }
    
    .scroll-indicator {
        animation: none !important;
    }
    
    .animate-on-scroll {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}



/* ===== PRINT STYLES ===== */
@media print {
    /* Hide unnecessary elements */
    .navbar,
    .back-to-top,
    .page-loader,
    .hero-buttons,
    .social-links,
    .newsletter-section,
    .footer-newsletter,
    .footer-policies,
    .scroll-indicator,
    .ticker-label,
    .ticker-content {
        display: none !important;
    }
    
    /* Adjust typography */
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000 !important;
        background: #fff !important;
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: #000 !important;
        page-break-after: avoid;
    }
    
    /* Links */
    a {
        color: #000 !important;
        text-decoration: underline;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        font-weight: normal;
    }
    
    /* Sections */
    section {
        padding: 1rem 0 !important;
        page-break-inside: avoid;
    }
    
    /* Cards */
    .feature-card,
    .program-card,
    .news-card,
    .stat-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        page-break-inside: avoid;
        background: #fff !important;
        color: #000 !important;
    }
    
    /* Remove background colors */
    .bg-primary,
    .bg-secondary,
    .bg-dark,
    .bg-light,
    .parallax-section {
        background: #fff !important;
        color: #000 !important;
    }
    
    /* Images */
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    /* Footer */
    .site-footer {
        border-top: 2px solid #000;
        margin-top: 2rem;
    }
    
    /* Page breaks */
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    img {
        page-break-inside: avoid;
    }
    
    .program-card,
    .news-card {
        page-break-inside: avoid;
    }
}

/* ===== ACCESSIBILITY: HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000000;
        --secondary-color: #0000ff;
        --accent-color: #ff0000;
    }
    
    .feature-card,
    .program-card,
    .news-card,
    .stat-card {
        border: 2px solid #000 !important;
    }
    
    .btn {
        border: 2px solid #000 !important;
    }
    
    .nav-link {
        border-bottom: 2px solid transparent;
    }
    
    .nav-link:hover,
    .nav-link.active {
        border-bottom-color: #000;
    }
}

/* ===== FIX FOR IOS SAFARI ===== */
@supports (-webkit-touch-callout: none) {
    /* Safari specific fixes */
    .hero-section {
        height: -webkit-fill-available;
        min-height: -webkit-fill-available;
    }
    
    /* Fix for Safari 100vh issue */
    .vh-100-ios {
        height: 100vh;
        height: -webkit-fill-available;
    }
    
    /* Prevent text size adjustment on orientation change */
    body {
        -webkit-text-size-adjust: 100%;
    }
}

/* ===== FIX FOR IOS FORM ZOOM ===== */
@media screen and (max-width: 767px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* ===== CUSTOM UTILITY CLASSES FOR RESPONSIVE ===== */
.responsive-img {
    max-width: 100%;
    height: auto;
    display: block;
}

.responsive-iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
}

.text-truncate-2 {
    display: -webkit-box;
    --webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    --webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== GRID SYSTEM ENHANCEMENTS ===== */
.row.gutter-sm {
    margin-right: -5px;
    margin-left: -5px;
}

.row.gutter-sm > [class*="col-"] {
    padding-right: 5px;
    padding-left: 5px;
}

.row.gutter-md {
    margin-right: -10px;
    margin-left: -10px;
}

.row.gutter-md > [class*="col-"] {
    padding-right: 10px;
    padding-left: 10px;
}

/* ===== FIX FOR BOOTSTRAP COLUMNS ON MOBILE ===== */
@media (max-width: 575.98px) {
    .row-cols-xs-1 > * {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .row-cols-xs-2 > * {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS FOR MOBILE ===== */
@media (max-width: 767px) {
    /* Reduce animations on mobile */
    .feature-card,
    .program-card,
    .news-card {
        transition: none;
    }
    
    /* Optimize images */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Reduce shadow complexity */
    .feature-card,
    .program-card,
    .news-card {
        box-shadow: var(--shadow-sm);
    }
}