/**
 * Comprehensive Responsive Design CSS
 * Mobile-First Approach with Progressive Enhancement
 * Covers all breakpoints: Mobile (320px+) → Tablet (768px+) → Desktop (1200px+)
 * 
 * Load this file AFTER all other CSS files for responsive overrides
 */

/* ============================================
   GLOBAL RESPONSIVE UTILITIES
   ============================================ */

/* Prevent horizontal scroll on all devices */
html {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    position: relative;
}

/* Responsive Images */
img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
}

/* Responsive Videos and Embeds */
iframe,
embed,
object,
video {
    max-width: 100% !important;
    height: auto !important;
}

/* ============================================
   CONTAINER RESPONSIVE FIXES
   ============================================ */

.container,
.container-fluid {
    padding-left: 15px !important;
    padding-right: 15px !important;
    max-width: 100% !important;
}

@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}

/* ============================================
   HEADER RESPONSIVE ENHANCEMENTS
   ============================================ */

/* Mobile: 320px - 767px */
@media (max-width: 767px) {
    .header.header--modern {
        height: 60px !important;
        padding: 0 !important;
    }
    
    body {
        padding-top: 60px !important;
    }
    
    .header__logo {
        padding: 10px 0 !important;
    }
    
    .header__logo .logo-main--compact {
        max-height: 32px !important;
    }
    
    .header__nav--compact {
        padding: 10px 0 !important;
        flex-wrap: wrap !important;
    }
    
    .header__menu--compact {
        display: none !important;
    }
    
    .header__menu__right--compact {
        gap: 10px !important;
    }
    
    .header-cta-btn {
        padding: 8px 16px !important;
        font-size: 14px !important;
        min-height: 44px !important;
    }
    
    .header-cta-btn span {
        display: inline !important;
    }
    
    .user-avatar--compact i {
        font-size: 32px !important;
    }
    
    .login-btn--compact {
        width: 36px !important;
        height: 36px !important;
        font-size: 18px !important;
    }
    
    /* Mobile Menu Button */
    .slicknav_menu {
        display: block !important;
        position: absolute;
        right: 15px;
        top: 12px;
        z-index: 1001;
    }
    
    .slicknav_btn {
        background: #1E40AF !important;
        border-radius: 6px !important;
        padding: 8px 10px !important;
    }
    
    .slicknav_btn .slicknav_icon-bar {
        background-color: #FFFFFF !important;
        height: 2px !important;
        margin: 3px 0 !important;
    }
    
    .slicknav_nav {
        background: #FFFFFF !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        border-radius: 8px;
        margin-top: 10px;
        padding: 10px 0;
    }
    
    .slicknav_nav a {
        color: #0F172A !important;
        padding: 12px 20px !important;
        font-size: 15px !important;
        border-bottom: 1px solid #F1F5F9;
    }
    
    .slicknav_nav a:hover {
        background: #F0F9FF !important;
        color: #1E40AF !important;
    }
}

/* Tablet: 768px - 991px */
@media (min-width: 768px) and (max-width: 991px) {
    .header.header--modern {
        height: 70px !important;
    }
    
    body {
        padding-top: 70px !important;
    }
    
    .header__logo .logo-main--compact {
        max-height: 45px !important;
    }
    
    .header__menu--compact ul {
        gap: 16px !important;
    }
    
    .header__menu--compact ul li a {
        font-size: 13px !important;
    }
    
    .header-cta-btn {
        padding: 8px 16px !important;
        font-size: 14px !important;
    }
    
    .header-cta-btn span {
        display: inline !important;
    }
}

/* Desktop: 992px+ */
@media (min-width: 992px) {
    .slicknav_menu {
        display: none !important;
    }
    
    .header__menu--compact {
        display: flex !important;
    }
}

/* ============================================
   FOOTER RESPONSIVE ENHANCEMENTS
   ============================================ */

/* Mobile: 320px - 767px */
@media (max-width: 767px) {
    .footer {
        padding: 40px 0 20px !important;
    }
    
    .footer__about,
    .footer__address,
    .footer__widget {
        margin-bottom: 30px !important;
        text-align: center;
    }
    
    .footer__about__logo {
        text-align: center;
        margin-bottom: 20px;
    }
    
    .footer__about__logo .logo-main {
        max-height: 50px !important;
        margin: 0 auto;
    }
    
    .footer__about p {
        text-align: center;
        font-size: 14px;
    }
    
    .footer__address ul li {
        text-align: center;
        padding: 12px 0;
    }
    
    .footer__widget {
        text-align: center;
    }
    
    .footer__widget ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .footer__widget ul li {
        margin-bottom: 10px;
    }
    
    .footer__widget ul li a {
        font-size: 15px;
        padding: 8px 0;
        display: block;
    }
    
    .footer__social {
        justify-content: center;
        margin-top: 15px;
    }
    
    .footer__social a {
        width: 40px !important;
        height: 40px !important;
        font-size: 18px !important;
    }
    
    .footer__copyright {
        flex-direction: column !important;
        text-align: center !important;
        gap: 15px !important;
        padding-top: 20px !important;
    }
    
    .footer__copyright__text {
        margin-bottom: 0 !important;
    }
    
    .footer__copyright__text p {
        font-size: 13px !important;
    }
    
    .footer__copyright__links {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 10px !important;
    }
    
    .footer__copyright__links a {
        font-size: 13px;
        padding: 6px 12px;
    }
}

/* Tablet: 768px - 991px */
@media (min-width: 768px) and (max-width: 991px) {
    .footer {
        padding: 50px 0 25px !important;
    }
    
    .footer__about,
    .footer__address,
    .footer__widget {
        margin-bottom: 30px !important;
    }
    
    .footer__copyright {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    
    .footer__copyright__links {
        flex-direction: row !important;
        gap: 15px !important;
    }
}

/* ============================================
   HERO SECTIONS RESPONSIVE
   ============================================ */

/* Mobile: 320px - 767px */
@media (max-width: 767px) {
    .hero,
    .about-hero,
    .contact-hero,
    .faq-hero,
    .terms-hero {
        padding: 40px 0 30px !important;
        min-height: auto !important;
    }
    
    .hero h1,
    .about-hero h1,
    .contact-hero h1,
    .faq-hero h1,
    .terms-hero h1 {
        font-size: 24px !important;
        margin-bottom: 15px !important;
        padding-top: 0 !important;
        line-height: 1.3 !important;
    }
    
    .hero p,
    .about-hero p,
    .contact-hero p,
    .faq-hero p,
    .terms-hero p {
        font-size: 15px !important;
        line-height: 1.6 !important;
    }
    
    .hero__search {
        padding: 16px !important;
        border-radius: 12px !important;
    }
    
    .hero__search__row {
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .hero__search__toggle {
        width: 100% !important;
        justify-content: stretch !important;
    }
    
    .hero__search__toggle button {
        flex: 1 !important;
        padding: 12px 16px !important;
        height: 44px !important;
        font-size: 14px !important;
    }
    
    .hero__search input[type="text"],
    .hero__search select {
        width: 100% !important;
        padding: 12px 16px !important;
        height: 44px !important;
        font-size: 16px !important; /* Prevents iOS zoom */
    }
    
    .hero__search button[type="submit"] {
        width: 100% !important;
        padding: 14px 24px !important;
        height: 48px !important;
        font-size: 16px !important;
    }
    
    .hero__cta-secondary {
        padding: 10px 20px !important;
        font-size: 14px !important;
        display: block;
        text-align: center;
        margin-top: 15px;
    }
}

/* Tablet: 768px - 991px */
@media (min-width: 768px) and (max-width: 991px) {
    .hero,
    .about-hero,
    .contact-hero,
    .faq-hero,
    .terms-hero {
        padding: 60px 0 50px !important;
    }
    
    .hero h1,
    .about-hero h1,
    .contact-hero h1,
    .faq-hero h1,
    .terms-hero h1 {
        font-size: 32px !important;
    }
    
    .hero p,
    .about-hero p,
    .contact-hero p,
    .faq-hero p,
    .terms-hero p {
        font-size: 17px !important;
    }
    
    .hero__search {
        padding: 24px !important;
    }
    
    .hero__search__row {
        gap: 12px !important;
    }
}

/* ============================================
   VALUE PROPOSITION / FEATURE CARDS
   ============================================ */

/* Mobile: 320px - 767px */
@media (max-width: 767px) {
    .value-proposition,
    .mission-vision-section,
    .trust-section,
    .coverage-section {
        padding: 40px 0 !important;
    }
    
    .value-proposition__title,
    .section-title h2 {
        font-size: 22px !important;
        margin-bottom: 25px !important;
        text-align: center;
    }
    
    .value-proposition__cards {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .value-proposition__card {
        padding: 25px 20px !important;
    }
    
    .value-proposition__card__icon i {
        font-size: 28px !important;
    }
    
    .value-proposition__card__title {
        font-size: 18px !important;
        margin-bottom: 10px !important;
    }
    
    .value-proposition__card__text {
        font-size: 14px !important;
    }
    
    /* Mission/Vision Cards */
    .mission-card,
    .vision-card {
        padding: 25px 20px !important;
        margin-bottom: 20px !important;
    }
    
    .mission-card h3,
    .vision-card h3 {
        font-size: 20px !important;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .mission-card h3 i,
    .vision-card h3 i {
        font-size: 24px !important;
    }
    
    /* Trust Items */
    .trust-item {
        padding: 25px 15px !important;
        margin-bottom: 25px !important;
    }
    
    .trust-item i {
        font-size: 36px !important;
        margin-bottom: 15px !important;
    }
    
    .trust-item h4 {
        font-size: 18px !important;
        margin-bottom: 10px !important;
    }
    
    .trust-item p {
        font-size: 14px !important;
    }
}

/* Tablet: 768px - 991px */
@media (min-width: 768px) and (max-width: 991px) {
    .value-proposition,
    .mission-vision-section,
    .trust-section,
    .coverage-section {
        padding: 60px 0 !important;
    }
    
    .value-proposition__cards {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 25px !important;
    }
    
    .trust-section .row > div {
        margin-bottom: 25px;
    }
}

/* ============================================
   FORMS RESPONSIVE ENHANCEMENTS
   ============================================ */

/* Mobile: 320px - 767px */
@media (max-width: 767px) {
    .form-group {
        margin-bottom: 20px !important;
    }
    
    .form-group label {
        font-size: 14px !important;
        margin-bottom: 8px !important;
        display: block;
    }
    
    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="password"],
    .form-group input[type="tel"],
    .form-group input[type="number"],
    .form-group input[type="date"],
    .form-group input[type="time"],
    .form-group textarea,
    .form-group select {
        width: 100% !important;
        padding: 12px 16px !important;
        font-size: 16px !important; /* Prevents iOS zoom */
        min-height: 44px !important; /* Touch-friendly */
        border-radius: 8px !important;
    }
    
    .form-group textarea {
        min-height: 120px !important;
        resize: vertical;
    }
    
    .contact-form-card,
    .contact-info-card {
        padding: 25px 20px !important;
        margin-bottom: 20px !important;
    }
    
    .contact-info-card h4 {
        font-size: 20px !important;
        margin-bottom: 20px !important;
    }
    
    .contact-info-card ul li {
        padding: 12px 0 !important;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .contact-info-card ul li i {
        font-size: 18px !important;
    }
    
    .contact-info-card ul li p {
        font-size: 14px !important;
    }
    
    .response-time-notice {
        padding: 15px !important;
        flex-direction: column;
        gap: 10px;
    }
    
    .response-time-notice i {
        font-size: 20px !important;
    }
    
    .response-time-notice div h5 {
        font-size: 15px !important;
    }
    
    .response-time-notice div p {
        font-size: 13px !important;
    }
}

/* Tablet: 768px - 991px */
@media (min-width: 768px) and (max-width: 991px) {
    .contact-form-card {
        padding: 35px 30px !important;
    }
    
    .contact-info-card {
        padding: 30px 25px !important;
    }
}

/* ============================================
   BUTTONS RESPONSIVE ENHANCEMENTS
   ============================================ */

/* Mobile: 320px - 767px */
@media (max-width: 767px) {
    .primary-btn,
    .site-btn,
    button[type="submit"],
    .btn,
    .btn-primary {
        min-height: 44px !important; /* Touch-friendly */
        padding: 12px 24px !important;
        font-size: 16px !important;
        border-radius: 8px !important;
        width: 100% !important; /* Full width on mobile */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        touch-action: manipulation;
    }
    
    .secondary-cta__button,
    .instructor-cta__button {
        width: 100% !important;
        padding: 14px 24px !important;
        font-size: 16px !important;
    }
    
    .hero__cta-secondary {
        width: 100% !important;
        text-align: center !important;
    }
}

/* Tablet: 768px - 991px */
@media (min-width: 768px) and (max-width: 991px) {
    .primary-btn,
    .site-btn,
    button[type="submit"],
    .btn {
        padding: 12px 28px !important;
        font-size: 15px !important;
        min-height: 44px !important;
    }
}

/* Desktop: 992px+ */
@media (min-width: 992px) {
    .primary-btn,
    .site-btn,
    button[type="submit"],
    .btn {
        width: auto !important;
    }
}

/* ============================================
   TABLES RESPONSIVE ENHANCEMENTS
   ============================================ */

/* Mobile: 320px - 767px */
@media (max-width: 767px) {
    table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        border-collapse: collapse;
    }
    
    thead {
        display: none !important;
    }
    
    tbody {
        display: block !important;
        width: 100% !important;
    }
    
    tr {
        display: block !important;
        margin-bottom: 15px !important;
        border: 1px solid #E5E7EB !important;
        border-radius: 8px !important;
        padding: 15px !important;
        background: #FFFFFF !important;
    }
    
    td {
        display: block !important;
        text-align: right !important;
        padding: 8px 0 !important;
        border: none !important;
        position: relative;
        padding-left: 50% !important;
    }
    
    td::before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 0;
        width: 45%;
        text-align: left;
        font-weight: 600;
        color: #0F172A;
    }
    
    /* Alternative: Horizontal scroll for complex tables */
    .table-responsive {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive table {
        min-width: 600px;
    }
}

/* ============================================
   INSTRUCTOR SEARCH PAGE RESPONSIVE
   ============================================ */

/* Mobile: 320px - 767px */
@media (max-width: 767px) {
    .instructor-search-container {
        padding: 20px 15px 60px !important;
    }
    
    .instructor-search-layout {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .filter-sidebar {
        position: relative !important;
        top: 0 !important;
        margin-bottom: 20px;
        order: 2;
    }
    
    .instructor-listing {
        order: 1;
    }
    
    .filter-sidebar__title {
        font-size: 18px !important;
        margin-bottom: 20px !important;
    }
    
    .filter-sidebar__group {
        margin-bottom: 20px !important;
    }
    
    .filter-sidebar__input {
        padding: 12px 16px !important;
        font-size: 16px !important;
        min-height: 44px !important;
    }
    
    .filter-sidebar__radio-group {
        gap: 8px !important;
    }
    
    .filter-sidebar__radio-option {
        padding: 10px 16px !important;
        font-size: 14px !important;
        min-height: 44px !important;
    }
    
    .instructor-card {
        padding: 20px !important;
        margin-bottom: 20px !important;
    }
    
    .instructor-card__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .instructor-card__info {
        width: 100% !important;
    }
}

/* Tablet: 768px - 991px */
@media (min-width: 768px) and (max-width: 991px) {
    .instructor-search-layout {
        grid-template-columns: 240px 1fr !important;
        gap: 20px !important;
    }
    
    .filter-sidebar {
        position: sticky;
        top: 90px;
    }
}

/* ============================================
   FAQ PAGE RESPONSIVE
   ============================================ */

/* Mobile: 320px - 767px */
@media (max-width: 767px) {
    .faq-section {
        padding: 40px 0 80px !important;
    }
    
    .faq-accordion {
        max-width: 100% !important;
    }
    
    .faq-item {
        margin-bottom: 15px !important;
    }
    
    .faq-header {
        padding: 12px 16px !important;
    }
    
    .faq-header h3 {
        font-size: 15px !important;
        padding-right: 24px !important;
    }
    
    .faq-icon {
        font-size: 18px !important;
    }
    
    /* Force collapsed state: no content visible until .active */
    .faq-content {
        display: none !important;
        padding: 0 16px !important;
    }
    .faq-item.active .faq-content {
        display: block !important;
        padding: 0 16px 20px 16px !important;
    }
    
    .faq-content p {
        font-size: 14px !important;
        line-height: 1.6 !important;
    }
}

/* ============================================
   TERMS PAGE RESPONSIVE
   ============================================ */

/* Mobile: 320px - 767px */
@media (max-width: 767px) {
    .terms-content {
        padding: 40px 0 !important;
    }
    
    .terms-card {
        padding: 25px 20px !important;
    }
    
    .terms-section {
        margin-bottom: 30px !important;
        padding-bottom: 30px !important;
    }
    
    .terms-section h2 {
        font-size: 18px !important;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .terms-section h2 i {
        font-size: 20px !important;
    }
    
    .terms-section p {
        font-size: 14px !important;
        line-height: 1.7 !important;
    }
    
    .terms-section ul li {
        font-size: 14px !important;
        line-height: 1.7 !important;
    }
    
    .terms-highlight {
        padding: 15px !important;
    }
    
    .terms-cta {
        padding: 30px 20px !important;
        margin-top: 30px !important;
    }
    
    .terms-cta h3 {
        font-size: 20px !important;
    }
    
    .terms-cta p {
        font-size: 14px !important;
    }
}

/* ============================================
   TYPOGRAPHY RESPONSIVE
   ============================================ */

/* Mobile: 320px - 767px */
@media (max-width: 767px) {
    body {
        font-size: 16px !important;
        line-height: 1.6 !important;
    }
    
    h1 {
        font-size: 24px !important;
        line-height: 1.3 !important;
    }
    
    h2 {
        font-size: 22px !important;
        line-height: 1.3 !important;
    }
    
    h3 {
        font-size: 20px !important;
        line-height: 1.4 !important;
    }
    
    h4 {
        font-size: 18px !important;
        line-height: 1.4 !important;
    }
    
    h5 {
        font-size: 16px !important;
        line-height: 1.4 !important;
    }
    
    h6 {
        font-size: 15px !important;
        line-height: 1.4 !important;
    }
    
    p,
    span,
    li {
        font-size: 15px !important;
        line-height: 1.6 !important;
    }
}

/* Tablet: 768px - 991px */
@media (min-width: 768px) and (max-width: 991px) {
    h1 {
        font-size: 32px !important;
    }
    
    h2 {
        font-size: 26px !important;
    }
    
    h3 {
        font-size: 22px !important;
    }
}

/* ============================================
   SPACING RESPONSIVE ADJUSTMENTS
   ============================================ */

/* Mobile: 320px - 767px */
@media (max-width: 767px) {
    .spad {
        padding: 40px 0 !important;
    }
    
    section {
        padding: 40px 0 !important;
    }
    
    .mb-5 {
        margin-bottom: 30px !important;
    }
    
    .mt-5 {
        margin-top: 30px !important;
    }
    
    .py-5 {
        padding-top: 30px !important;
        padding-bottom: 30px !important;
    }
}

/* ============================================
   MODAL RESPONSIVE ENHANCEMENTS
   ============================================ */

/* Mobile: 320px - 767px */
@media (max-width: 767px) {
    .modal-dialog {
        margin: 10px !important;
        max-width: calc(100% - 20px) !important;
    }
    
    .modal-content {
        border-radius: 12px !important;
        padding: 20px !important;
    }
    
    .modal-header {
        padding: 15px 0 !important;
        border-bottom: 1px solid #E5E7EB;
        margin-bottom: 20px;
    }
    
    .modal-title {
        font-size: 20px !important;
    }
    
    .modal-body {
        padding: 0 !important;
    }
    
    .modal-footer {
        padding: 20px 0 0 0 !important;
        border-top: 1px solid #E5E7EB;
        margin-top: 20px;
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-footer .btn {
        width: 100% !important;
        margin: 0 !important;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Hide on mobile */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Show only on mobile */
@media (min-width: 768px) {
    .show-mobile-only {
        display: none !important;
    }
}

/* Hide on tablet */
@media (min-width: 768px) and (max-width: 991px) {
    .hide-tablet {
        display: none !important;
    }
}

/* Show only on desktop */
@media (max-width: 991px) {
    .show-desktop-only {
        display: none !important;
    }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Focus states for keyboard navigation */
@media (max-width: 767px) {
    a:focus,
    button:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 3px solid #1E40AF !important;
        outline-offset: 2px !important;
    }
}

/* Touch target improvements */
@media (max-width: 767px) {
    a,
    button,
    input[type="button"],
    input[type="submit"],
    .btn {
        min-height: 44px !important;
        min-width: 44px !important;
    }
}

/* ============================================
   GLOBAL FORM RESPONSIVE
   Prevent overflow and ensure inputs scale on all screens
   ============================================ */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Flex/grid form rows: allow children to shrink so inputs don't overflow */
form .row,
.form-row,
[class*="form-row"],
.hero__search__row {
    min-width: 0;
}

form .row > [class*="col-"],
.form-row > *,
[class*="form-row"] > * {
    min-width: 0;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .header,
    .footer,
    .slicknav_menu,
    .header__menu__right,
    button,
    .btn {
        display: none !important;
    }
    
    body {
        padding-top: 0 !important;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }
}
