/* ===================================
   ENHANCED MOBILE STYLING
   =================================== */

/* Mobile-first approach improvements */

/* Enhanced typography for mobile */
@media (max-width: 768px) {
    /* Better readability */
    body {
        font-size: 16px;
        line-height: 1.6;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    h1, h2, h3, h4, h5, h6 {
        line-height: 1.3;
        margin-bottom: 0.8em;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Improved paragraph spacing */
    p {
        margin-bottom: 1.2rem;
    }
    
    /* Better button styling */
    .btn, button, .btn-primary, .btn-secondary {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 16px;
        border-radius: 8px;
        transition: all 0.3s ease;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .btn:hover, button:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .btn:active, button:active {
        transform: translateY(0);
    }
    
    /* Card improvements */
    .card, .service-card, .treatment-card {
        border-radius: 12px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
        margin-bottom: 20px;
    }
    
    .card:hover, .service-card:hover, .treatment-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    }
    
    /* Form improvements */
    input, textarea, select {
        min-height: 44px;
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px 15px;
        border-radius: 8px;
        border: 1px solid #ddd;
        transition: all 0.3s ease;
    }
    
    input:focus, textarea:focus, select:focus {
        outline: none;
        border-color: #ff7e5f;
        box-shadow: 0 0 0 3px rgba(255, 126, 95, 0.1);
    }
    
    /* Container improvements */
    .container, .content-wrapper {
        padding: 0 15px;
        max-width: 100%;
    }
    
    /* Section spacing */
    section {
        padding: 60px 0;
    }
    
    /* Hero improvements */
    .hero-section, .services-hero, .booking-hero, .education-hero {
        min-height: 60vh;
        padding: 80px 0 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    
    .hero-content {
        padding: 0 20px;
    }
    
    /* Service cards grid */
    .services-grid, .treatments-grid, .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 15px;
    }
    
    /* Price tables */
    .price-table, .pricing-table {
        font-size: 14px;
    }
    
    .price-table th, .pricing-table th {
        padding: 12px 8px;
        font-size: 14px;
    }
    
    .price-table td, .pricing-table td {
        padding: 10px 8px;
    }
    
    /* Modal improvements */
    .modal, .gallery-modal, .booking-modal {
        padding: 20px;
    }
    
    .modal-content, .gallery-modal-content {
        border-radius: 12px;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .modal-close, .gallery-modal-close {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Loading states */
    .loading {
        position: relative;
        overflow: hidden;
    }
    
    .loading::after {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
        animation: loading 1.5s infinite;
    }
    
    @keyframes loading {
        0% { left: -100%; }
        100% { left: 100%; }
    }
    
    /* Smooth scrolling */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Better image handling */
    img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
    }
    
    /* Table improvements */
    table {
        font-size: 14px;
        border-radius: 8px;
        overflow: hidden;
    }
    
    table th, table td {
        padding: 12px 8px;
        text-align: left;
    }
    
    /* Responsive tables */
    .responsive-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Alert improvements */
    .alert, .notification, .message {
        padding: 15px;
        border-radius: 8px;
        margin-bottom: 20px;
        font-size: 14px;
    }
    
    /* Breadcrumb improvements */
    .breadcrumb {
        padding: 10px 15px;
        font-size: 14px;
        flex-wrap: wrap;
    }
    
    /* Pagination improvements */
    .pagination {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .pagination a, .pagination button {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    /* Even smaller text for very small screens */
    body {
        font-size: 15px;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.375rem;
    }
    
    h3 {
        font-size: 1.125rem;
    }
    
    /* Tighter spacing */
    section {
        padding: 40px 0;
    }
    
    .hero-section, .services-hero, .booking-hero, .education-hero {
        min-height: 50vh;
        padding: 60px 0 40px;
    }
    
    /* Smaller containers */
    .container, .content-wrapper {
        padding: 0 12px;
    }
    
    /* Smaller buttons */
    .btn, button {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    /* Form adjustments */
    input, textarea, select {
        padding: 10px 12px;
        font-size: 15px;
    }
    
    /* Card adjustments */
    .card, .service-card, .treatment-card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    /* Table adjustments */
    .price-table, .pricing-table {
        font-size: 12px;
    }
    
    .price-table th, .pricing-table th,
    .price-table td, .pricing-table td {
        padding: 8px 6px;
    }
    
    /* Modal adjustments */
    .modal, .gallery-modal {
        padding: 15px;
    }
    
    /* Alert adjustments */
    .alert, .notification, .message {
        padding: 12px;
        font-size: 13px;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section, .services-hero, .booking-hero, .education-hero {
        min-height: 80vh;
        padding: 60px 0 30px;
    }
    
    section {
        padding: 40px 0;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn, button, .card, .service-card, .treatment-card {
        transition: none;
    }
    
    .btn:hover, button:hover,
    .card:hover, .service-card:hover, .treatment-card:hover {
        transform: none;
    }
    
    .btn:active, button:active {
        background-color: #ff6b47;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Crisper text and borders */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* Better image rendering */
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark mode support for mobile */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    body {
        background-color: #121212;
        color: #ffffff;
    }
    
    .card, .service-card, .treatment-card {
        background-color: #1e1e1e;
        color: #ffffff;
    }
    
    input, textarea, select {
        background-color: #2d2d2d;
        color: #ffffff;
        border-color: #444444;
    }
    
    .modal-content, .gallery-modal-content {
        background-color: #1e1e1e;
        color: #ffffff;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) and (max-width: 768px) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}
