/*--------------------------------------------------------------
# Comprehensive Responsive Styles for All Devices
--------------------------------------------------------------*/

/* Adaptive UI - Base Mobile First Approach */

/* Extra Large Devices (4K and Large Desktops, 1400px and up) */
@media only screen and (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-coming-soon {
        padding: 120px 0;
    }
    
    .coming-soon-text {
        font-size: 72px;
    }
    
    .launching-subtitle {
        font-size: 28px;
    }
    
    .hero-tagline {
        font-size: 28px;
    }
    
    .section-padding {
        padding: 100px 0;
    }
}

/* Large Devices (Desktops, 1200px to 1399px) */
@media only screen and (min-width: 1200px) and (max-width: 1399px) {
    .hero-coming-soon {
        padding: 100px 0;
    }
    
    .coming-soon-text {
        font-size: 64px;
    }
    
    .launching-subtitle {
        font-size: 26px;
    }
    
    .hero-tagline {
        font-size: 26px;
    }
}

/* Medium Devices (Tablets, 992px to 1199px) */
@media only screen and (min-width: 992px) and (max-width: 1199px) {
    .hero-coming-soon {
        padding: 80px 0;
    }
    
    .coming-soon-text {
        font-size: 56px;
    }
    
    .launching-subtitle {
        font-size: 24px;
    }
    
    .hero-tagline {
        font-size: 24px;
    }
}

/* Small Devices (Large Tablets, 768px to 991px) */
@media only screen and (min-width: 768px) and (max-width: 991px) {
    .hero-coming-soon {
        padding: 70px 0;
    }
    
    .coming-soon-text {
        font-size: 48px;
    }
    
    .launching-subtitle {
        font-size: 22px;
    }
    
    .hero-tagline {
        font-size: 22px;
    }
    
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Extra Small Devices (Phones, 576px to 767px) */
@media only screen and (min-width: 576px) and (max-width: 767px) {
    .hero-coming-soon {
        padding: 60px 0;
    }
    
    .coming-soon-text {
        font-size: 40px;
    }
    
    .launching-subtitle {
        font-size: 20px;
    }
    
    .hero-tagline {
        font-size: 20px;
    }
    
    .container {
        padding-left: 18px;
        padding-right: 18px;
    }
}

/* Very Small Devices (Small Phones, 320px to 575px) */
@media only screen and (min-width: 320px) and (max-width: 575px) {
    /* Core Structure */
    body {
        overflow-x: hidden;
    }
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Hero Section - Launching Soon */
    .hero-coming-soon {
        padding: 50px 0;
    }
    
    .coming-soon-text {
        font-size: 32px;
    }
    
    .launching-subtitle {
        font-size: 18px;
    }
    
    .hero-tagline {
        font-size: 18px;
    }
    
    /* Header & Navigation */
    #header {
        padding: 10px 0;
    }
    
    .logo-img {
        height: 50px;
    }
    
    .navbar-collapse {
        background-color: white;
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        margin-top: 10px;
    }
    
    .navbar-nav .nav-link {
        padding: 12px 15px;
        border-bottom: 1px solid rgba(75, 0, 130, 0.1);
    }
    
    .dropdown-menu {
        border: none;
        box-shadow: none;
        padding-left: 15px;
        background-color: rgba(75, 0, 130, 0.05);
    }
    
    .header-social-icons {
        display: flex;
        justify-content: center;
        margin-top: 15px;
        margin-left: 0;
    }
    
    .hotline-button {
        margin: 15px auto;
        display: block;
        text-align: center;
    }
    
    /* Sections */
    .section-padding {
        padding: 40px 0;
    }
    
    .section-title h2 {
        font-size: 24px;
    }
    
    /* Content & Typography */
    h1 {
        font-size: 28px;
        line-height: 1.3;
    }
    
    h2 {
        font-size: 24px;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 20px;
    }
    
    p {
        font-size: 15px;
    }
    
    /* Facility Cards */
    .facility-hover-card {
        width: 100%;
        height: 280px;
    }
    
    .facility-card-container {
        flex-direction: column;
    }
    
    /* Contact Form */
    .hithalaya-contact-form {
        padding: 20px;
    }
    
    /* Map Section */
    .map-container iframe {
        height: 250px;
    }
    
    /* Footer */
    #footer {
        text-align: center;
    }
    
    .social-icons-container {
        justify-content: center;
    }
    
    /* Fix for WhatsApp & Back to Top Buttons */
    .whatsapp-widget {
        width: 50px;
        height: 50px;
        line-height: 50px;
        font-size: 28px;
    }
    
    .back-to-top {
        width: 40px;
        height: 40px;
    }
}

/* Small devices (large phones, 481px to 767px) */
@media only screen and (min-width: 481px) and (max-width: 767px) {
    /* Hero Section */
    .coming-soon-text {
        font-size: 38px;
    }
    
    .launching-subtitle {
        font-size: 20px;
    }
    
    /* Content & Typography */
    h1 {
        font-size: 32px;
    }
    
    h2 {
        font-size: 26px;
    }
    
    /* Facility Cards */
    .facility-hover-card {
        width: 100%;
    }
}

/* Medium devices (tablets, 768px to 991px) */
@media only screen and (min-width: 768px) and (max-width: 991px) {
    /* Hero Section */
    .coming-soon-text {
        font-size: 44px;
    }
    
    /* Header */
    .navbar-collapse {
        background-color: white;
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        margin-top: 10px;
    }
    
    /* Facility Cards */
    .facility-hover-card {
        width: 230px;
    }
    
    /* 2-Column Layout for Tablets */
    .facility-card-container {
        justify-content: space-around;
    }
}

/* Large devices (desktops, 992px and up) */
@media only screen and (min-width: 992px) {
    .coming-soon-text {
        font-size: 60px;
    }
}

/* Special styling for iOS devices - fixing input styling */
@supports (-webkit-touch-callout: none) {
    input, select, textarea {
        font-size: 16px !important; /* Prevents iOS zoom on input */
    }
    
    select {
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml;utf8,<svg fill='%234B0082' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
        background-repeat: no-repeat;
        background-position: right 8px center;
    }
}

/* Animation fixes for mobile */
@media only screen and (max-width: 767px) {
    .hero-coming-soon {
        padding: 50px 0;
    }
    
    .animate-on-scroll {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .floating-icon {
        display: none;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    /* Make hover states work with touch */
    .service-card:hover .card-overlay {
        opacity: 0; /* Disable hover overlay on touch devices */
    }
    
    /* Use active states instead */
    .service-card:active .card-overlay {
        opacity: 1;
    }
    
    /* Facility hover cards - require tap to see overlay */
    .facility-hover-card .facility-overlay {
        background: linear-gradient(135deg, rgba(0, 128, 128, 0.95) 0%, rgba(75, 0, 130, 0.95) 100%);
    }
}

/* Fixes for iOS Safari */
@supports (-webkit-overflow-scrolling: touch) {
    /* Fix for position:fixed elements */
    .whatsapp-widget, 
    .back-to-top {
        -webkit-transform: translateZ(0);
    }
    
    /* Fix for sticky header */
    #header {
        -webkit-backface-visibility: hidden;
    }
}

/* iPad and iPad Pro specific */
@media only screen and (min-device-width: 768px) and (max-device-width: 1366px) and (-webkit-min-device-pixel-ratio: 2) {
    .container {
        max-width: 90%;
    }
    
    /* Better touch targets for iPad */
    .nav-link, .dropdown-item, button {
        padding: 12px 15px;
    }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    .hero-coming-soon {
        padding: 30px 0;
    }
    
    .coming-soon-text {
        font-size: 32px;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
}