/* ========================================
   RESPONSIVE DESIGN FOR ALL REDESIGNED PAGES
   ======================================== */

/* ========================================
   MOBILE FIRST - SMALL DEVICES (< 576px)
   ======================================== */
@media (max-width: 575.98px) {
    /* Typography */
    .display-4 {
        font-size: 1.75rem !important;
    }

    .display-5 {
        font-size: 1.5rem !important;
    }

    h1 {
        font-size: 1.75rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    h4 {
        font-size: 1.1rem !important;
    }

    h5 {
        font-size: 1rem !important;
    }

    .lead {
        font-size: 1rem !important;
    }

    /* Spacing */
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .mb-4, .my-4 {
        margin-bottom: 1.5rem !important;
    }

    .mb-5, .my-5 {
        margin-bottom: 2rem !important;
    }

    /* Buttons */
    .btn-lg {
        padding: 0.75rem 1.5rem !important;
        font-size: 1rem !important;
    }

    .btn {
        font-size: 0.9rem !important;
    }

    /* Cards */
    .card {
        margin-bottom: 1rem !important;
    }

    .card-body {
        padding: 1.25rem !important;
    }

    /* Hero Sections */
    .contact-hero,
    .admin-hero,
    .digital-hero {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .contact-hero img,
    .admin-hero img,
    .digital-hero img {
        max-height: 200px !important;
        margin-top: 1rem !important;
    }

    /* Statistics Cards */
    .stat-card,
    .stat-icon,
    .contact-icon,
    .category-icon {
        width: 60px !important;
        height: 60px !important;
    }

    .stat-card i,
    .stat-icon i,
    .contact-icon i {
        font-size: 1.5rem !important;
    }

    .stat-card h3 {
        font-size: 1.75rem !important;
    }

    /* Tables */
    .table-responsive {
        font-size: 0.75rem !important;
    }

    .table th,
    .table td {
        padding: 0.5rem !important;
        font-size: 0.75rem !important;
    }

    .btn-group .btn {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.75rem !important;
    }

    .btn-group .btn i {
        font-size: 0.75rem !important;
    }

    /* Forms */
    .form-control,
    .form-select {
        font-size: 0.9rem !important;
    }

    .form-label {
        font-size: 0.9rem !important;
        margin-bottom: 0.25rem !important;
    }

    /* Badges */
    .badge {
        font-size: 0.7rem !important;
        padding: 0.25rem 0.5rem !important;
    }

    /* Modals */
    .modal-dialog {
        margin: 0.5rem !important;
    }

    .modal-body {
        padding: 1rem !important;
    }

    .modal-header {
        padding: 0.75rem 1rem !important;
    }

    .modal-title {
        font-size: 1.1rem !important;
    }

    /* Gallery/Swiper */
    .swiper-slide img {
        height: 250px !important;
    }

    /* Disable hover effects on mobile */
    .hover-lift:hover,
    .hover-scale:hover,
    .hover-grow:hover {
        transform: none !important;
    }

    .card:hover {
        transform: none !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
    }

    /* Contact Form */
    .contact-form .col-md-6 {
        margin-bottom: 1rem !important;
    }

    /* Footer spacing */
    section:last-child {
        margin-bottom: 0 !important;
    }

    /* Flexbox adjustments */
    .d-flex.gap-3 {
        gap: 0.75rem !important;
    }

    /* Image adjustments */
    .rounded-4 {
        border-radius: 0.75rem !important;
    }

    /* Grid adjustments */
    .g-4 {
        --bs-gutter-x: 1rem !important;
        --bs-gutter-y: 1rem !important;
    }
}

/* ========================================
   TABLETS - SMALL (576px - 767.98px)
   ======================================== */
@media (min-width: 576px) and (max-width: 767.98px) {
    .display-4 {
        font-size: 2rem !important;
    }

    .display-5 {
        font-size: 1.75rem !important;
    }

    h1 {
        font-size: 2rem !important;
    }

    h2 {
        font-size: 1.75rem !important;
    }

    .py-5 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }

    .btn-lg {
        padding: 0.875rem 2rem !important;
        font-size: 1.05rem !important;
    }

    .stat-card,
    .stat-icon,
    .contact-icon {
        width: 70px !important;
        height: 70px !important;
    }

    .contact-hero img,
    .admin-hero img,
    .digital-hero img {
        max-height: 250px !important;
    }

    .table th,
    .table td {
        padding: 0.75rem !important;
        font-size: 0.85rem !important;
    }
}

/* ========================================
   TABLETS - MEDIUM (768px - 991.98px)
   ======================================== */
@media (min-width: 768px) and (max-width: 991.98px) {
    .display-4 {
        font-size: 2.25rem !important;
    }

    .display-5 {
        font-size: 2rem !important;
    }

    h1 {
        font-size: 2.25rem !important;
    }

    h2 {
        font-size: 2rem !important;
    }

    .py-5 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    .contact-hero img,
    .admin-hero img,
    .digital-hero img {
        max-height: 300px !important;
    }

    .stat-card h3 {
        font-size: 2rem !important;
    }

    /* Adjust column widths for better tablet layout */
    .col-lg-3 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .col-lg-4 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
}

/* ========================================
   DESKTOP - SMALL (992px - 1199.98px)
   ======================================== */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: 960px !important;
    }

    .display-4 {
        font-size: 2.5rem !important;
    }

    .display-5 {
        font-size: 2.25rem !important;
    }
}

/* ========================================
   DESKTOP - LARGE (1200px and above)
   ======================================== */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px !important;
    }
}

/* ========================================
   LANDSCAPE ORIENTATION FIXES
   ======================================== */
@media (max-width: 991.98px) and (orientation: landscape) {
    .contact-hero,
    .admin-hero,
    .digital-hero {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }

    .contact-hero img,
    .admin-hero img,
    .digital-hero img {
        max-height: 150px !important;
    }

    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
}

/* ========================================
   RTL ADJUSTMENTS FOR MOBILE
   ======================================== */
@media (max-width: 767.98px) {
    [dir="rtl"] .me-2,
    [dir="rtl"] .ms-2 {
        margin-left: 0.25rem !important;
        margin-right: 0.25rem !important;
    }

    [dir="rtl"] .text-lg-end {
        text-align: center !important;
    }

    [dir="rtl"] .d-flex {
        justify-content: center !important;
    }
}

/* ========================================
   ADMIN TABLE RESPONSIVE
   ======================================== */
@media (max-width: 991.98px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 800px;
    }

    .table thead {
        font-size: 0.8rem;
    }

    .table tbody {
        font-size: 0.75rem;
    }

    /* Stack search filters vertically on mobile */
    .row.g-3 > div[class*="col-md"] {
        margin-bottom: 1rem !important;
    }
}

/* ========================================
   GALLERY/SWIPER RESPONSIVE
   ======================================== */
@media (max-width: 575.98px) {
    .swiper-slide {
        padding: 0 0.5rem;
    }

    .gallery-item img {
        height: 200px !important;
    }

    .nav-sw {
        display: none !important;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .gallery-item img {
        height: 300px !important;
    }
}

/* ========================================
   CONTACT FORM RESPONSIVE
   ======================================== */
@media (max-width: 767.98px) {
    #contact-form .col-md-6 {
        width: 100% !important;
        margin-bottom: 1rem;
    }

    .contact-form .row.g-4 {
        row-gap: 1rem !important;
    }
}

/* ========================================
   BREADCRUMB RESPONSIVE
   ======================================== */
@media (max-width: 575.98px) {
    .breadcrumb {
        font-size: 0.75rem !important;
        padding: 0.5rem !important;
    }

    .breadcrumb-item + .breadcrumb-item::before {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }
}

/* ========================================
   VIDEO/IFRAME RESPONSIVE
   ======================================== */
@media (max-width: 767.98px) {
    .ratio-16x9,
    .ratio-21x9 {
        --bs-aspect-ratio: 56.25% !important;
    }

    iframe {
        min-height: 250px !important;
    }
}

/* ========================================
   SOCIAL MEDIA BUTTONS RESPONSIVE
   ======================================== */
@media (max-width: 575.98px) {
    .btn.rounded-circle {
        width: 45px !important;
        height: 45px !important;
    }

    .btn.rounded-circle i {
        font-size: 1rem !important;
    }
}

/* ========================================
   DETAIL VIEW (MODALS) RESPONSIVE
   ======================================== */
@media (max-width: 575.98px) {
    .detail-row {
        flex-direction: column !important;
        padding: 0.75rem 0 !important;
    }

    .detail-label {
        margin-bottom: 0.25rem !important;
        min-width: auto !important;
    }

    .detail-value {
        word-break: break-word;
    }
}

/* ========================================
   UTILITY CLASSES FOR MOBILE
   ======================================== */
@media (max-width: 767.98px) {
    .mobile-center {
        text-align: center !important;
    }

    .mobile-stack {
        display: block !important;
        width: 100% !important;
    }

    .mobile-hide {
        display: none !important;
    }

    .mobile-full-width {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS FOR MOBILE
   ======================================== */
@media (max-width: 767.98px) {
    /* Reduce animations on mobile for better performance */
    [data-aos] {
        animation-duration: 0.4s !important;
    }

    /* Simplify shadows on mobile */
    .shadow-lg,
    .shadow-green {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    }

    /* Disable complex transforms */
    .card,
    .btn {
        will-change: auto !important;
    }
}

/* ========================================
   TOUCH DEVICE OPTIMIZATIONS
   ======================================== */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .btn,
    a,
    button {
        min-height: 44px !important;
        min-width: 44px !important;
    }

    /* Remove hover effects on touch devices */
    .hover-lift:hover,
    .hover-scale:hover,
    .card:hover {
        transform: none !important;
    }

    /* Improve tap highlighting */
    * {
        -webkit-tap-highlight-color: rgba(93, 189, 126, 0.2);
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    /* Hide navigation and interactive elements */
    header,
    footer,
    .btn,
    .nav,
    .modal,
    .hover-lift,
    [data-aos] {
        display: none !important;
    }

    /* Optimize for print */
    body {
        font-size: 12pt !important;
        line-height: 1.5 !important;
    }

    .container {
        max-width: 100% !important;
    }

    /* Prevent page breaks inside cards */
    .card {
        page-break-inside: avoid;
    }
}
