/**
 * Responsive Optimizations
 * Mobile & Desktop Compatibility
 */

/* Global Container Optimization */
.container {
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* Hero Slider Responsive */
@media (max-width: 768px) {
    .hero-slider-section {
        padding: 3rem 0 5rem !important;
        min-height: auto;
    }
    
    .hero-title {
        font-size: 1.75rem !important;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
        margin-bottom: 2rem;
    }
    
    .featured-hostings {
        grid-template-columns: 1fr !important;
        gap: 1rem;
        margin-top: 2rem;
    }
    
    .featured-hosting-card {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .hero-slider-section {
        padding: 2rem 0 4rem !important;
    }
    
    .hero-title {
        font-size: 1.5rem !important;
    }
    
    .hero-subtitle {
        font-size: 0.9rem !important;
    }
    
    .featured-hosting-card {
        padding: 1.25rem;
    }
}

/* Hosting Types Nav Responsive */
@media (max-width: 991px) {
    .hosting-types-nav {
        margin-top: -2rem;
        padding: 1rem 0;
    }
    
    .hosting-types-list {
        gap: 0.5rem;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .hosting-type-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .advanced-filters-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }
}

@media (max-width: 576px) {
    .hosting-types-nav .container {
        padding: 0.75rem;
    }
    
    .hosting-types-list {
        gap: 0.4rem;
    }
    
    .hosting-type-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .advanced-filters-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        margin-left: 0;
        width: 100%;
        margin-top: 0.5rem;
        justify-content: center;
    }
    
    .hosting-types-nav .d-flex {
        flex-direction: column;
    }
}

/* Provider Cards Responsive */
@media (max-width: 1200px) {
    .providers-container {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .providers-container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
        gap: 0.75rem;
    }
    
    .providers-section h2 {
        font-size: 1.75rem !important;
    }
    
    .providers-section .subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
}

@media (max-width: 576px) {
    .providers-container {
        grid-template-columns: 1fr !important;
    }
}

/* Cards Responsive */
@media (max-width: 992px) {
    .card {
        margin-bottom: 1rem;
    }
}

/* Tables Responsive */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.4rem;
    }
}

@media (max-width: 576px) {
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.4rem 0.3rem;
    }
}

/* Buttons Responsive */
@media (max-width: 768px) {
    .btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-lg {
        padding: 0.7rem 1.25rem;
        font-size: 0.95rem;
    }
}

/* Sections Spacing */
@media (max-width: 768px) {
    section {
        padding: 3rem 0 !important;
    }
    
    .py-5 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
}

@media (max-width: 576px) {
    section {
        padding: 2rem 0 !important;
    }
    
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
}

/* Typography Responsive */
@media (max-width: 768px) {
    h1, .h1 {
        font-size: 2rem;
    }
    
    h2, .h2 {
        font-size: 1.75rem;
    }
    
    h3, .h3 {
        font-size: 1.5rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .display-5 {
        font-size: 1.75rem;
    }
    
    .lead {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    h1, .h1 {
        font-size: 1.75rem;
    }
    
    h2, .h2 {
        font-size: 1.5rem;
    }
    
    h3, .h3 {
        font-size: 1.25rem;
    }
    
    .display-4 {
        font-size: 1.75rem;
    }
    
    .display-5 {
        font-size: 1.5rem;
    }
    
    .lead {
        font-size: 0.95rem;
    }
}

/* Footer Responsive */
@media (max-width: 768px) {
    footer {
        text-align: center;
    }
    
    footer .row > div {
        margin-bottom: 2rem;
    }
}

/* Utility Classes for Responsive */
.d-mobile-none {
    display: none;
}

@media (min-width: 992px) {
    .d-mobile-none {
        display: block;
    }
}

.d-desktop-none {
    display: block;
}

@media (min-width: 992px) {
    .d-desktop-none {
        display: none;
    }
}

/* Image Responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Form Responsive */
@media (max-width: 576px) {
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Text Alignment */
@media (max-width: 768px) {
    .text-md-left {
        text-align: left !important;
    }
    
    .text-md-center {
        text-align: center !important;
    }
    
    .text-md-right {
        text-align: right !important;
    }
}

/* Gap Utilities Responsive */
@media (max-width: 576px) {
    .gap-2 {
        gap: 0.5rem !important;
    }
    
    .gap-3 {
        gap: 0.75rem !important;
    }
    
    .gap-4 {
        gap: 1rem !important;
    }
    
    .gap-5 {
        gap: 1.25rem !important;
    }
}

/* Margin/Padding Responsive */
@media (max-width: 768px) {
    .mb-5 {
        margin-bottom: 2rem !important;
    }
    
    .mt-5 {
        margin-top: 2rem !important;
    }
    
    .py-5 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
}

@media (max-width: 576px) {
    .mb-5 {
        margin-bottom: 1.5rem !important;
    }
    
    .mt-5 {
        margin-top: 1.5rem !important;
    }
    
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
}

/* Scrollbar for Mobile */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
}

/* Touch Target Sizes */
@media (max-width: 768px) {
    a, button, input, select, textarea {
        min-height: 44px;
        min-width: 44px;
    }
    
    .btn {
        min-height: 44px;
    }
    
    .nav-link {
        min-height: 44px;
    }
}

/* Performance: Reduce animations on mobile */
@media (max-width: 768px) {
    * {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-slider-section {
        padding: 2rem 0 3rem !important;
        min-height: auto;
    }
}

