/**
 * Complete Mobile Responsive CSS
 * For Website - All pages optimized for mobile
 */

/* ========== Base Mobile Styles ========== */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

/* ========== Container Responsive ========== */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== Typography ========== */
@media (max-width: 768px) {
    h1 { font-size: 28px; }
    h2 { font-size: 24px; }
    h3 { font-size: 20px; }
    h4 { font-size: 18px; }
    h5 { font-size: 16px; }
    h6 { font-size: 14px; }
    
    body, p { font-size: 14px; }
}

@media (max-width: 480px) {
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    h3 { font-size: 18px; }
    h4 { font-size: 16px; }
    
    .container { padding: 0 15px; }
}

/* ========== Grid System ========== */
.grid-2, .grid-3, .grid-4 {
    display: grid;
    gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ========== Cards Responsive ========== */
.card, .service-card, .blog-card {
    width: 100%;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .card-body {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .card-body {
        padding: 12px;
    }
}

/* ========== Buttons Responsive ========== */
.btn {
    padding: 12px 24px;
    font-size: 15px;
}

@media (max-width: 768px) {
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .btn-large {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* ========== Forms Responsive ========== */
.form-group {
    margin-bottom: 20px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
}

@media (max-width: 768px) {
    input, textarea, select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 10px;
    }
}

/* ========== Tables Responsive ========== */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ========== Hero Section ========== */
.hero-section {
    padding: 60px 0;
}

@media (max-width: 768px) {
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 30px 0;
    }
    
    .hero-title {
        font-size: 26px;
    }
}

/* ========== Services Section ========== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== Gallery Responsive ========== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

/* ========== Contact Form ========== */
.contact-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .contact-form-wrapper {
        padding: 20px;
    }
}

/* ========== Pricing Tables ========== */
.pricing-table {
    display: flex;
    gap: 24px;
    justify-content: center;
}

@media (max-width: 768px) {
    .pricing-table {
        flex-direction: column;
        align-items: center;
    }
    
    .pricing-card {
        width: 100%;
        max-width: 400px;
    }
}

/* ========== Testimonials/Reviews ========== */
.reviews-slider {
    overflow: hidden;
}

@media (max-width: 768px) {
    .review-card {
        padding: 16px;
    }
}

/* ========== Blog Posts ========== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ========== Sidebar ========== */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: 2;
    }
    
    .content-area {
        order: 1;
    }
}

/* ========== Modal Responsive ========== */
.modal {
    padding: 20px;
}

.modal-content {
    max-width: 600px;
    width: 100%;
}

@media (max-width: 768px) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        max-width: 100%;
        margin: 0;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-body {
        padding: 16px;
    }
}

/* ========== Spacing Utilities ========== */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

@media (max-width: 768px) {
    .mt-5, .mb-5 { margin: 2rem; }
    .mt-4, .mb-4 { margin: 1.5rem; }
}

/* ========== Visibility Utilities ========== */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none;
    }
    
    .show-mobile {
        display: block;
    }
}

/* ========== Text Alignment ========== */
@media (max-width: 768px) {
    .text-center-mobile {
        text-align: center;
    }
}

/* ========== Flexbox Utilities ========== */
.flex-row {
    display: flex;
    gap: 16px;
}

@media (max-width: 768px) {
    .flex-row {
        flex-direction: column;
    }
}

/* ========== Page Content ========== */
.page-content {
    padding: 40px 0;
}

@media (max-width: 768px) {
    .page-content {
        padding: 30px 0;
    }
}

@media (max-width: 480px) {
    .page-content {
        padding: 20px 0;
    }
}

/* ========== Iframe Responsive ========== */
iframe {
    max-width: 100%;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ========== Touch Optimizations ========== */
@media (hover: none) and (pointer: coarse) {
    /* Mobile touch devices */
    button, a, .clickable {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ========== Loading States ========== */
.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3B82F6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* ========== Safe Areas (iOS Notch) ========== */
@supports (padding: max(0px)) {
    .safe-area-padding {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
}

/* ========== Landscape Mode ========== */
@media (max-width: 896px) and (orientation: landscape) {
    .hero-section {
        padding: 30px 0;
    }
    
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ========== Print Styles ========== */
@media print {
    .no-print, header, footer, nav, .floating-actions, .scroll-to-top {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
    }
}
