/* Responsive Improvements for Landing Pages */

/* General Mobile Improvements */
@media (max-width: 768px) {
    /* Typography adjustments */
    .display-2 {
        font-size: 2.5rem !important;
        line-height: 1.2 !important;
    }

    .display-4 {
        font-size: 2rem !important;
        line-height: 1.3 !important;
    }

    .display-6 {
        font-size: 1.75rem !important;
        line-height: 1.4 !important;
    }

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

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

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

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

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

    /* Spacing adjustments */
    .py-6 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    .my-6 {
        margin-top: 3rem !important;
        margin-bottom: 3rem !important;
    }

    .container-xxl {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* Button improvements */
    .btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
    }

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

    /* Form improvements */
    .form-floating {
        margin-bottom: 1rem !important;
    }

    .form-control {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }

    /* Carousel improvements */
    .carousel-caption {
        padding: 1rem !important;
    }

    .carousel-caption h1 {
        font-size: 1.5rem !important;
        margin-bottom: 1rem !important;
    }

    .carousel-caption .btn {
        margin: 0.25rem !important;
        display: block !important;
        width: 100% !important;
    }

    /* Modal improvements */
    .modal-dialog {
        margin: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
    }

    .modal-body {
        padding: 1rem !important;
        max-height: 70vh !important;
        overflow-y: auto !important;
    }

    /* Portfolio improvements */
    .portfolio-menu ul {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .portfolio-menu .btn {
        font-size: 0.8rem !important;
        padding: 0.4rem 0.8rem !important;
    }

    .portfolio-item .item {
        margin-bottom: 1rem !important;
    }

    /* Service cards improvements */
    .courses-item {
        margin-bottom: 1.5rem !important;
    }

    .courses-item img {
        height: 200px !important;
        object-fit: cover !important;
    }

    /* Contact form improvements */
    .contact-form {
        padding: 1rem !important;
    }

    /* Map improvements */
    iframe {
        height: 300px !important;
    }
}

/* Tablet Improvements */
@media (min-width: 769px) and (max-width: 1024px) {
    .display-2 {
        font-size: 3rem !important;
    }

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

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

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

    .carousel-caption .btn {
        margin: 0.5rem !important;
    }

    .portfolio-menu .btn {
        font-size: 0.9rem !important;
        padding: 0.5rem 1rem !important;
    }
}

/* Extra Small Devices */
@media (max-width: 576px) {
    /* Header improvements */
    .page-header {
        padding: 2rem 0 !important;
    }

    .page-header h1 {
        font-size: 1.5rem !important;
    }

    /* Navigation improvements */
    .navbar-brand img {
        max-width: 150px !important;
    }

    /* Content spacing */
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* Grid improvements */
    .col-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .col-sm {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    /* Service cards */
    .courses-item {
        margin-bottom: 1rem !important;
    }

    .courses-item img {
        height: 180px !important;
    }

    /* Project gallery */
    .portfolio-item .item {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    /* Contact form */
    .form-floating {
        margin-bottom: 0.75rem !important;
    }

    /* Buttons */
    .btn {
        width: 100% !important;
        margin-bottom: 0.5rem !important;
    }

    .btn + .btn {
        margin-left: 0 !important;
    }

    /* Modal */
    .modal-dialog {
        margin: 0.25rem !important;
    }

    .modal-body {
        padding: 0.75rem !important;
        font-size: 0.9rem !important;
    }

    /* Breadcrumbs */
    .breadcrumb {
        font-size: 0.8rem !important;
    }

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

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .page-header {
        padding: 1rem 0 !important;
    }

    .carousel-caption {
        padding: 0.5rem !important;
    }

    .carousel-caption h1 {
        font-size: 1.2rem !important;
        margin-bottom: 0.5rem !important;
    }

    .modal-body {
        max-height: 60vh !important;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .courses-item img,
    .portfolio-item img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Touch Device Improvements */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn {
        min-height: 44px !important;
        padding: 0.75rem 1.5rem !important;
    }

    .form-control {
        min-height: 44px !important;
    }

    /* Better spacing for touch */
    .courses-item,
    .portfolio-item .item {
        margin-bottom: 1.5rem !important;
    }

    /* Modal improvements for touch */
    .modal-header .btn-close {
        padding: 1rem !important;
        margin: -1rem -1rem -1rem auto !important;
    }

    /* Carousel controls */
    .carousel-control-prev,
    .carousel-control-next {
        width: 15% !important;
        min-width: 50px !important;
    }
}

/* Print Styles */
@media print {
    .page-header,
    .navbar,
    .footer,
    .btn,
    .modal,
    .carousel-control-prev,
    .carousel-control-next {
        display: none !important;
    }

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

    .courses-item,
    .portfolio-item .item {
        break-inside: avoid;
        margin-bottom: 1rem !important;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .wow,
    .animated,
    .carousel,
    .fadeIn,
    .slideInDown {
        animation: none !important;
        transition: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .btn-outline-primary {
        border-width: 2px !important;
    }

    .form-control {
        border-width: 2px !important;
    }

    .badge {
        border: 1px solid currentColor !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    /* This can be customized based on your design */
    .bg-light {
        background-color: #2d3748 !important;
        color: #e2e8f0 !important;
    }

    .text-muted {
        color: #a0aec0 !important;
    }
}

/* Specific Page Improvements */

/* Home Page */
@media (max-width: 768px) {
    .aboutsec .col-lg-8 {
        order: 2 !important;
    }

    .aboutsec .col-lg-4 {
        order: 1 !important;
        margin-bottom: 2rem !important;
    }

    .aboutsec .col-lg-4 img {
        height: 250px !important;
    }
}

/* Services Page */
@media (max-width: 768px) {
    .courses-item {
        height: auto !important;
    }

    .courses-overlay {
        position: relative !important;
        background: rgba(0, 0, 0, 0.7) !important;
        padding: 1rem !important;
    }

    .courses-overlay .btn {
        width: 100% !important;
    }
}

/* Projects Page */
@media (max-width: 768px) {
    .portfolio-menu {
        text-align: center !important;
    }

    .portfolio-menu ul {
        justify-content: center !important;
    }

    .portfolio-item .item {
        margin-bottom: 1rem !important;
    }

    .portfolio-item .item img {
        height: 200px !important;
        object-fit: cover !important;
    }
}

/* Contact Page */
@media (max-width: 768px) {
    .contact-form {
        margin-top: 2rem !important;
    }

    .contact-info .col-lg-4 {
        margin-bottom: 2rem !important;
        text-align: center !important;
    }

    .contact-info .d-flex {
        justify-content: center !important;
    }
}

/* Service/Project Detail Pages */
@media (max-width: 768px) {
    .service-detail .col-lg-8,
    .project-detail .col-lg-8 {
        order: 2 !important;
    }

    .service-detail .col-lg-4,
    .project-detail .col-lg-4 {
        order: 1 !important;
        margin-bottom: 2rem !important;
    }

    .carousel-item img {
        height: 250px !important;
        object-fit: cover !important;
    }

    .related-services .d-flex,
    .related-projects .d-flex {
        margin-bottom: 1rem !important;
    }

    .related-services img,
    .related-projects img {
        width: 50px !important;
        height: 50px !important;
    }
}

/* Loading States */
@media (max-width: 768px) {
    .spinner-border-sm {
        width: 1rem !important;
        height: 1rem !important;
    }

    .btn:disabled {
        opacity: 0.6 !important;
    }
}

/* Toastr Notifications */
@media (max-width: 768px) {
    .toast-container {
        top: 1rem !important;
        right: 1rem !important;
        left: 1rem !important;
    }

    .toast {
        margin-bottom: 0.5rem !important;
        font-size: 0.9rem !important;
    }
}
