/* ============================================================
   MOBILE RESPONSIVE STYLES
   Optimized for phones and tablets
   ============================================================ */

/* ===== MOBILE BREAKPOINTS ===== */
/* Small phones: 320px - 480px */
/* Large phones: 481px - 768px */
/* Tablets: 769px - 1024px */

/* ===== BASE MOBILE STYLES (768px and below) ===== */
@media (max-width: 768px) {
    /* Container */
    .container {
        padding: 0 15px;
        max-width: 100%;
    }
    
    /* Typography */
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 28px !important;
        line-height: 1.3;
    }
    
    h2 {
        font-size: 24px !important;
    }
    
    h3 {
        font-size: 18px !important;
    }
    
    p {
        font-size: 14px;
        line-height: 1.6;
    }
    
    /* Header */
    header {
        position: sticky;
        top: 0;
        z-index: 1000;
    }
    
    .header-top {
        padding: 10px 0;
    }
    
    .header-top-left {
        flex-direction: column;
        gap: 5px;
        font-size: 11px;
    }
    
    .header-top-left span {
        font-size: 11px;
    }
    
    .btn-request-staffing {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    /* Navigation */
    nav {
        padding: 10px 0;
    }
    
    .nav-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .logo {
        z-index: 1001;
        position: relative;
    }
    
    .logo img {
        max-height: 35px;
    }
    
    .logo-icon {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .logo-text .main {
        font-size: 14px;
    }
    
    .logo-text .sub {
        font-size: 8px;
    }
    
    /* Mobile Menu */
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
        flex-direction: column;
        padding: 80px 0 20px;
        transition: left 0.3s ease;
        z-index: 9999;
        overflow-y: auto;
        gap: 0;
        box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-menu a {
        color: var(--white);
        padding: 16px 24px;
        display: block;
        font-size: 16px;
        width: 100%;
    }
    
    .nav-menu a:hover {
        background: rgba(255,255,255,0.1);
    }
    
    .nav-menu .btn-book {
        background: var(--accent);
        color: var(--black);
        margin: 10px 20px;
        text-align: center;
        border-radius: 8px;
    }
    
    /* Hamburger Menu */
    .mobile-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 25px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 10001;
        position: relative;
    }
    
    .mobile-toggle span {
        width: 30px;
        height: 3px;
        background: var(--primary);
        border-radius: 10px;
        transition: all 0.3s ease;
        transform-origin: center;
    }
    
    .mobile-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translateY(8px);
    }
    
    .mobile-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translateY(-8px);
    }
    
    /* Mobile Overlay */
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
    }
    
    .mobile-overlay.active {
        display: block;
    }
    
    /* Hero Section */
    .hero {
        padding: 40px 0;
    }
    
    .hero .container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .hero-content {
        text-align: center;
    }
    
    .hero h1 {
        font-size: 28px;
        margin-bottom: 15px;
    }
    
    .hero p {
        font-size: 15px;
        margin-bottom: 20px;
    }
    
    .hero-badge {
        font-size: 10px;
        padding: 6px 14px;
        margin-bottom: 15px;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .hero-buttons .btn {
        width: 100%;
        text-align: center;
    }
    
    .hero-image {
        order: -1;
    }
    
    .hero-image img {
        max-width: 100%;
    }
    
    .quality-badge {
        top: 10px;
        right: 10px;
        padding: 12px 16px;
    }
    
    .quality-badge .icon {
        font-size: 20px;
    }
    
    .quality-badge .text {
        font-size: 10px;
    }
    
    /* Hero Center */
    .hero-center {
        min-height: 250px !important;
        padding: 30px 0 !important;
    }
    
    /* Sections */
    section {
        padding: 40px 0;
    }
    
    /* Background Image Sections - Mobile Optimization */
    section[style*="background-image"] {
        background-size: contain !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
    }
    
    section[style*="background-image"] .services-grid {
        padding: 25px 12px !important;
        border-radius: 15px !important;
        background-size: contain !important;
        background-repeat: no-repeat !important;
        gap: 15px !important;
    }
    
    section[style*="background-image"] .features-grid {
        padding: 25px 12px !important;
        gap: 12px !important;
    }
    
    section[style*="background-image"] .testimonial-grid {
        padding: 25px 12px !important;
        border-radius: 15px !important;
        gap: 15px !important;
    }
    
    section[style*="background-image"] > div[style*="backdrop-filter"] {
        backdrop-filter: blur(2px) !important;
    }
    
    .features-section[style*="background-image"] {
        background-attachment: scroll !important;
        padding: 30px 0 !important;
    }
    
    .section-header {
        margin-bottom: 30px;
    }
    
    .section-header h2 {
        font-size: 26px;
        margin-bottom: 10px;
    }
    
    .section-header p {
        font-size: 14px;
    }
    
    /* Features Grid */
    .features-section {
        padding: 30px 0;
        margin-top: -20px;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .feature-card-horizontal {
        padding: 18px;
        text-align: center;
    }
    
    .feature-card-horizontal .icon {
        width: 45px;
        height: 45px;
        font-size: 22px;
        margin: 0 auto 10px;
    }
    
    .feature-card-horizontal h3 {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .feature-card-horizontal p {
        font-size: 11px;
        line-height: 1.4;
    }
    
    /* Services Grid */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .service-card {
        padding: 18px;
        display: flex;
        flex-direction: column;
    }
    
    .service-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
        margin-bottom: 10px;
    }
    
    .service-card h3 {
        font-size: 15px;
        margin-bottom: 6px;
        line-height: 1.2;
        min-height: 36px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .service-card p {
        font-size: 11px;
        margin-bottom: 10px;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        flex-grow: 1;
    }
    
    .service-price {
        font-size: 14px;
        margin-top: auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Services Column Grid */
    .services-column-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .service-column-card {
        padding: 20px;
    }
    
    .service-column-card .service-icon {
        font-size: 35px;
    }
    
    .service-column-card h3 {
        font-size: 16px;
    }
    
    .service-column-card p {
        font-size: 13px;
    }
    
    /* Staff Grid */
    .staff-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .staff-card {
        max-width: 400px;
        margin: 0 auto;
    }
    
    .staff-photo {
        height: 250px;
    }
    
    .staff-info {
        padding: 18px;
    }
    
    .staff-info h3 {
        font-size: 18px;
    }
    
    .staff-role {
        font-size: 14px;
    }
    
    .staff-rank {
        font-size: 12px;
        padding: 4px 10px;
    }
    
    .staff-info .btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    /* Testimonials - Horizontal Scrolling on Mobile */
    .testimonial-grid {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 15px;
        padding-bottom: 15px;
        scrollbar-width: thin;
    }
    
    .testimonial-grid::-webkit-scrollbar {
        height: 6px;
    }
    
    .testimonial-grid::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.1);
        border-radius: 10px;
    }
    
    .testimonial-grid::-webkit-scrollbar-thumb {
        background: var(--primary);
        border-radius: 10px;
    }
    
    .testimonial-card {
        min-width: 280px;
        max-width: 280px;
        flex-shrink: 0;
        scroll-snap-align: start;
        padding: 20px;
    }
    
    .testimonial-message {
        font-size: 13px;
        line-height: 1.5;
    }
    
    .author-info h4 {
        font-size: 14px;
    }
    
    .author-info p {
        font-size: 12px;
    }
    
    /* Auto-scroll animation */
    @keyframes scroll-testimonials {
        0% {
            transform: translateX(0);
        }
        100% {
            transform: translateX(calc(-280px * var(--testimonial-count) - 15px * var(--testimonial-count)));
        }
    }
    
    .testimonial-grid.auto-scroll {
        animation: scroll-testimonials 20s linear infinite;
    }
    
    .testimonial-grid.auto-scroll:hover {
        animation-play-state: paused;
    }
    
    /* Buttons */
    .btn {
        padding: 12px 24px;
        font-size: 14px;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 18px;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .form-control {
        padding: 12px 14px;
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    /* Booking Form */
    .booking-form {
        padding: 24px;
    }
    
    .booking-form div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
    
    .booking-form-section {
        padding: 18px;
        margin-bottom: 18px;
    }
    
    .booking-form-section-title {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    /* Contact Form */
    .contact-form,
    .contact-info-card {
        padding: 24px;
    }
    
    .contact-form div[style*="grid-template-columns"],
    .contact-page div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .contact-info-item {
        padding: 14px;
    }
    
    .contact-info-icon {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    
    /* Job Listing */
    .job-listing-card {
        padding: 20px;
    }
    
    .job-application-form {
        padding: 24px;
    }
    
    .job-application-form div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
    
    /* Blog Posts */
    .blog-post-card {
        margin-bottom: 20px;
    }
    
    .blog-post-header {
        padding: 14px 16px;
    }
    
    .blog-post-header h3 {
        font-size: 17px;
    }
    
    .blog-post-image {
        height: 200px;
    }
    
    .blog-post-content {
        padding: 14px 16px;
    }
    
    .blog-post-actions {
        padding: 8px 16px;
    }
    
    .blog-action-btn {
        font-size: 12px;
        padding: 8px 6px;
    }
    
    .blog-comments-section {
        padding: 14px 16px;
    }
    
    /* Footer */
    footer {
        padding: 40px 0 20px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-col {
        text-align: center;
    }
    
    .footer-col h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .footer-col ul {
        padding: 0;
    }
    
    .footer-col ul li {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .footer-bottom {
        font-size: 12px;
        padding-top: 15px;
    }
    
    /* Banner Slider */
    .banner-slide {
        min-height: 400px;
    }
    
    .banner-prev,
    .banner-next {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .banner-prev {
        left: 10px;
    }
    
    .banner-next {
        right: 10px;
    }
    
    .banner-dots {
        bottom: 15px;
    }
    
    .banner-dots .dot {
        width: 8px;
        height: 8px;
    }
    
    /* FAQ */
    .faq-item {
        margin-bottom: 10px;
    }
    
    .faq-question {
        padding: 14px 16px;
        font-size: 14px;
    }
    
    .faq-toggle {
        width: 26px;
        height: 26px;
        font-size: 20px;
    }
    
    .faq-answer {
        padding: 0 16px 14px 16px;
        font-size: 13px;
    }
    
    /* Modal */
    .modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .modal-content form {
        padding: 20px;
    }
}

/* ===== SMALL MOBILE (480px and below) ===== */
@media (max-width: 480px) {
    /* Container */
    .container {
        padding: 0 12px;
    }
    
    /* Hide header top on very small screens */
    .header-top {
        display: none;
    }
    
    /* Typography */
    h1 {
        font-size: 24px !important;
    }
    
    h2 {
        font-size: 20px !important;
    }
    
    h3 {
        font-size: 16px !important;
    }
    
    /* Hero */
    .hero {
        padding: 30px 0;
    }
    
    .hero h1 {
        font-size: 24px;
    }
    
    .hero p {
        font-size: 13px;
    }
    
    .hero-badge {
        font-size: 9px;
        padding: 5px 12px;
    }
    
    /* Sections */
    section {
        padding: 30px 0;
    }
    
    /* Background Image Sections - Small Mobile */
    section[style*="background-image"] .services-grid {
        padding: 20px 8px !important;
        border-radius: 12px !important;
        background-size: contain !important;
        background-repeat: no-repeat !important;
        gap: 12px !important;
    }
    
    section[style*="background-image"] .features-grid {
        padding: 20px 8px !important;
        gap: 10px !important;
    }
    
    section[style*="background-image"] .testimonial-grid {
        padding: 20px 8px !important;
        border-radius: 12px !important;
        gap: 12px !important;
    }
    
    section[style*="background-image"] .service-card,
    section[style*="background-image"] .feature-card-horizontal,
    section[style*="background-image"] .testimonial-card {
        background: rgba(255, 255, 255, 0.9) !important;
        backdrop-filter: blur(8px) !important;
    }
    
    .section-header h2 {
        font-size: 22px;
    }
    
    .section-header p {
        font-size: 13px;
    }
    
    /* Cards */
    .service-card,
    .staff-card,
    .testimonial-card {
        padding: 14px;
    }
    
    .service-card {
        display: flex;
        flex-direction: column;
    }
    
    .service-icon {
        width: 45px;
        height: 45px;
        font-size: 22px;
        margin-bottom: 8px;
    }
    
    .service-card h3 {
        font-size: 13px;
        margin-bottom: 5px;
        line-height: 1.2;
        min-height: 32px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .service-card p {
        font-size: 10px;
        line-height: 1.3;
        margin-bottom: 8px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        flex-grow: 1;
    }
    
    .service-price {
        font-size: 13px;
        margin-top: auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Features - 2 Column on Small Mobile */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .feature-card-horizontal {
        padding: 14px;
    }
    
    .feature-card-horizontal .icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
        margin: 0 auto 8px;
    }
    
    .feature-card-horizontal h3 {
        font-size: 13px;
        margin-bottom: 5px;
    }
    
    .feature-card-horizontal p {
        font-size: 10px;
    }
    
    /* Staff */
    .staff-photo {
        height: 220px;
    }
    
    .staff-info {
        padding: 15px;
    }
    
    .staff-info h3 {
        font-size: 16px;
    }
    
    .staff-role {
        font-size: 13px;
    }
    
    /* Forms */
    .booking-form,
    .contact-form,
    .job-application-form {
        padding: 20px;
    }
    
    .booking-form-section {
        padding: 15px;
    }
    
    /* Blog */
    .blog-post-image {
        height: 180px;
    }
    
    .blog-post-header h3 {
        font-size: 15px;
    }
    
    .blog-action-btn {
        font-size: 11px;
        padding: 6px 4px;
    }
    
    .blog-action-btn span {
        font-size: 14px !important;
    }
    
    /* Footer */
    .footer-col h3 {
        font-size: 16px;
    }
    
    .footer-col ul li {
        font-size: 13px;
    }
    
    .footer-bottom {
        font-size: 11px;
    }
    
    /* Testimonials - Small Mobile */
    .testimonial-card {
        min-width: 260px;
        max-width: 260px;
        padding: 16px;
    }
    
    .testimonial-message {
        font-size: 12px;
        line-height: 1.4;
    }
    
    .author-info h4 {
        font-size: 13px;
    }
    
    .author-info p {
        font-size: 11px;
    }
}

/* ===== TABLET (769px - 1024px) ===== */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 0 30px;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .services-grid,
    .staff-grid,
    .testimonial-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .services-column-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== LANDSCAPE MODE ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 30px 0;
    }
    
    .hero h1 {
        font-size: 24px;
    }
    
    .hero p {
        font-size: 13px;
        margin-bottom: 15px;
    }
    
    section {
        padding: 30px 0;
    }
    
    .nav-menu {
        padding: 60px 0 20px;
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    /* Increase tap targets */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-menu a {
        min-height: 44px;
    }
    
    .form-control {
        min-height: 44px;
    }
    
    /* Remove hover effects */
    .service-card:hover,
    .staff-card:hover,
    .testimonial-card:hover,
    .feature-card-horizontal:hover {
        transform: none;
    }
    
    /* Add active states */
    .btn:active {
        transform: scale(0.98);
    }
    
    .service-card:active,
    .staff-card:active {
        transform: scale(0.98);
    }
}

/* ===== PREVENT ZOOM ON INPUT FOCUS (iOS) ===== */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="url"],
    input[type="password"],
    input[type="date"],
    input[type="time"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid var(--white);
    }
    
    .service-card,
    .staff-card,
    .testimonial-card {
        border: 2px solid var(--gray-900);
    }
}
