/* Enhanced Responsive Design for All Screen Sizes */

/* ============================================
   TABLE OF CONTENTS
   ============================================
   1. Base Responsive Utilities
   2. Mobile First Approach (320px+)
   3. Small Mobile (375px+)
   4. Mobile (576px+)
   5. Tablet Portrait (768px+)
   6. Tablet Landscape (992px+)
   7. Desktop (1200px+)
   8. Large Desktop (1400px+)
   9. Ultra Wide (1920px+)
   10. Touch Optimizations
   11. Orientation Specific
   ============================================ */

/* 1. Base Responsive Utilities */
.container-fluid {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.img-fluid {
    max-width: 100%;
    height: auto;
}

/* 2. Mobile First (320px - 374px) */
@media (min-width: 320px) {
    .container {
        max-width: 100%;
        padding: 0 12px;
    }
    
    body {
        font-size: 14px;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.1rem; }
    h4 { font-size: 1rem; }
}

/* 3. Small Mobile (375px+) */
@media (min-width: 375px) {
    .container {
        max-width: 100%;
        padding: 0 15px;
    }
    
    body {
        font-size: 15px;
    }
}

/* 4. Mobile (576px - Small devices) */
@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
    
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.2rem; }
}

/* 5. Tablet Portrait (768px - Medium devices) */
@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
    
    body {
        font-size: 16px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.7rem; }
    h3 { font-size: 1.4rem; }
}

/* 6. Tablet Landscape (992px - Large devices) */
@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
    
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.6rem; }
}

/* 7. Desktop (1200px - Extra large devices) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* 8. Large Desktop (1400px+) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    h1 { font-size: 3rem; }
    h2 { font-size: 2.5rem; }
}

/* 9. Ultra Wide (1920px+) */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
}

/* 10. Touch Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Touch device optimizations */
    .btn,
    .nav-link,
    a {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Remove hover effects on touch devices */
    .btn:hover,
    .nav-link:hover,
    a:hover {
        transform: none;
    }
    
    /* Add touch feedback */
    .btn:active,
    .nav-link:active,
    a:active {
        opacity: 0.7;
        transform: scale(0.98);
    }
}

/* 11. Orientation Specific */
/* Portrait */
@media (orientation: portrait) {
    .hero-section {
        min-height: 70vh;
    }
    
    .navbar {
        padding: 0.5rem 0;
    }
}

/* Landscape */
@media (orientation: landscape) and (max-height: 500px) {
    .hero-section {
        min-height: 100vh;
        padding: 80px 0 40px;
    }
    
    .navbar {
        padding: 0.25rem 0;
    }
    
    .navbar-logo {
        width: 32px !important;
        height: 32px !important;
    }
}

/* ============================================
   Specific Component Responsive Fixes
   ============================================ */

/* Cards */
@media (max-width: 767.98px) {
    .service-card,
    .team-card,
    .stat-card,
    .value-card,
    .course-card {
        margin-bottom: 1rem;
    }
}

/* Tables */
@media (max-width: 767.98px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
}

/* Images */
@media (max-width: 576px) {
    img {
        max-width: 100%;
        height: auto;
    }
}

/* Modals */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
}

/* Forms */
@media (max-width: 576px) {
    .form-control,
    .form-select,
    textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
}

/* Navbar */
@media (max-width: 991.98px) {
    .navbar-collapse {
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Footer */
@media (max-width: 767.98px) {
    footer .col-lg-4,
    footer .col-lg-3,
    footer .col-lg-2 {
        margin-bottom: 2rem;
        text-align: center;
    }
    
    footer .social-links {
        justify-content: center;
    }
}

/* Hide on specific sizes */
.d-none-mobile {
    display: none;
}

@media (min-width: 768px) {
    .d-none-mobile {
        display: block;
    }
    
    .d-mobile-only {
        display: none;
    }
}

/* ============================================
   ENHANCED RESPONSIVE DESIGN FOR TALENTS PAGE
   ============================================ */

/* Extra Small Mobile (320px - 374px) */
@media (max-width: 374.98px) {
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .display-3 {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .display-4 {
        font-size: 1.6rem;
        line-height: 1.2;
    }
    
    .display-5 {
        font-size: 1.4rem;
        line-height: 1.2;
    }
    
    .h1 {
        font-size: 1.5rem;
    }
    
    .h2 {
        font-size: 1.3rem;
    }
    
    .h3 {
        font-size: 1.2rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .form-control {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .hero-section {
        min-height: 60vh;
        padding-top: 60px;
    }
    
    .navbar-brand-text {
        font-size: 0.9rem;
    }
    
    .navbar-logo {
        width: 24px !important;
        height: 24px !important;
    }
    
    /* Service Options for Extra Small */
    .service-option {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .service-icon {
        width: 45px;
        height: 45px;
    }
    
    .service-icon i {
        font-size: 1.1rem;
    }
    
    .service-option h6 {
        font-size: 0.9rem;
    }
    
    .service-option small {
        font-size: 0.75rem;
    }
    
    /* Modal for Extra Small */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .progress-steps {
        margin-bottom: 1rem;
    }
    
    .step {
        margin: 0 0.25rem;
    }
    
    .step-number {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .step:not(:last-child)::after {
        left: 40px;
        width: 20px;
    }
    
    .step-label {
        font-size: 0.75rem;
    }
    
    /* Floating Cards Hide on Extra Small */
    .floating-card {
        display: none;
    }
    
    .hero-visual {
        height: 250px;
    }
}

/* Small Mobile (375px - 575px) */
@media (min-width: 375px) and (max-width: 575.98px) {
    .service-option {
        padding: 1.25rem;
    }
    
    .service-icon {
        width: 50px;
        height: 50px;
    }
    
    .service-icon i {
        font-size: 1.2rem;
    }
    
    .step-number {
        width: 35px;
        height: 35px;
    }
    
    .step:not(:last-child)::after {
        left: 50px;
        width: 25px;
    }
    
    .modal-body {
        padding: 1.25rem;
    }
}

/* Mobile Landscape (576px - 767px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .service-option {
        padding: 1.5rem;
    }
    
    .service-icon {
        width: 55px;
        height: 55px;
    }
    
    .floating-card {
        display: block;
        padding: 0.75rem;
    }
    
    .floating-card.card-1 {
        top: 5%;
        right: 5%;
    }
    
    .floating-card.card-2 {
        top: 25%;
        left: 2%;
    }
    
    .floating-card.card-3 {
        bottom: 15%;
        right: 15%;
    }
    
    .hero-visual {
        height: 350px;
    }
}

/* Tablet Portrait (768px - 991px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .service-option {
        padding: 1.5rem;
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
    }
    
    .floating-card {
        padding: 1rem;
    }
    
    .hero-visual {
        height: 400px;
    }
    
    .modal-dialog {
        max-width: 600px;
    }
}

/* Tablet Landscape (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .hero-visual {
        height: 450px;
    }
    
    .floating-card {
        padding: 1rem;
    }
    
    .modal-dialog {
        max-width: 700px;
    }
}

/* Desktop (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .hero-visual {
        height: 500px;
    }
    
    .modal-dialog {
        max-width: 800px;
    }
}

/* Large Desktop (1400px - 1919px) */
@media (min-width: 1400px) and (max-width: 1919.98px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-visual {
        height: 550px;
    }
    
    .display-3 {
        font-size: 3.5rem;
    }
    
    .display-4 {
        font-size: 3rem;
    }
    
    .display-5 {
        font-size: 2.5rem;
    }
    
    .modal-dialog {
        max-width: 900px;
    }
}

/* Ultra Wide (1920px+) */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
    
    .hero-visual {
        height: 600px;
    }
    
    .display-3 {
        font-size: 4rem;
    }
    
    .display-4 {
        font-size: 3.5rem;
    }
    
    .display-5 {
        font-size: 3rem;
    }
    
    .modal-dialog {
        max-width: 1000px;
    }
    
    .service-option {
        padding: 2rem;
    }
    
    .service-icon {
        width: 70px;
        height: 70px;
    }
    
    .service-icon i {
        font-size: 1.8rem;
    }
}

/* ============================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================ */

/* Touch Devices */
@media (hover: none) and (pointer: coarse) {
    .service-option {
        min-height: 120px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .btn {
        min-height: 48px;
        min-width: 48px;
        padding: 0.75rem 1.5rem;
    }
    
    .btn-lg {
        min-height: 56px;
        padding: 1rem 2rem;
    }
    
    .form-control,
    .form-select {
        min-height: 48px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .nav-link {
        min-height: 48px;
        padding: 0.75rem 1rem;
    }
    
    /* Remove hover effects on touch */
    .service-option:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    /* Add active states for touch */
    .service-option:active {
        transform: scale(0.98);
        opacity: 0.8;
    }
    
    .btn:active {
        transform: scale(0.98);
        opacity: 0.8;
    }
}

/* ============================================
   ORIENTATION SPECIFIC OPTIMIZATIONS
   ============================================ */

/* Portrait Orientation */
@media (orientation: portrait) {
    .hero-section {
        min-height: 70vh;
    }
    
    .floating-card {
        display: none; /* Hide floating cards in portrait */
    }
    
    .hero-visual {
        height: 300px;
    }
}

/* Landscape Orientation */
@media (orientation: landscape) and (max-height: 500px) {
    .hero-section {
        min-height: 100vh;
        padding: 60px 0 40px;
    }
    
    .navbar {
        padding: 0.25rem 0;
    }
    
    .navbar-logo {
        width: 32px !important;
        height: 32px !important;
    }
    
    .floating-card {
        display: none; /* Hide floating cards in landscape mobile */
    }
    
    .hero-visual {
        height: 200px;
    }
    
    .modal-dialog {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
    }
    
    .modal-body {
        max-height: calc(100vh - 200px);
        overflow-y: auto;
    }
}

/* ============================================
   HIGH DPI DISPLAYS
   ============================================ */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .service-icon i,
    .step-number,
    .navbar-logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .floating-card,
    .service-option,
    .btn,
    .step-content {
        animation: none !important;
        transition: none !important;
    }
    
    .floating-card {
        animation: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .service-option {
        border-width: 3px;
    }
    
    .btn {
        border-width: 2px;
    }
    
    .step-number {
        border: 2px solid currentColor;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .navbar,
    .footer,
    .btn,
    .floating-element,
    .modal {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }
    
    a {
        text-decoration: none;
        color: #000;
    }
    
    .service-option {
        border: 1px solid #000;
        break-inside: avoid;
    }
    
    .hero-section {
        min-height: auto;
        padding: 20px 0;
    }
}

