/* ===== GLOBAL RESPONSIVE STYLES ===== */

/* Base responsive adjustments */
* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

/* Container adjustments */
@media (max-width: 575px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .mb-5 {
        margin-bottom: 2rem !important;
    }
    
    .mt-5 {
        margin-top: 2rem !important;
    }
}

/* Typography responsive */
@media (max-width: 767px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.9rem; }
    
    .display-1 { font-size: 2.5rem; }
    .display-2 { font-size: 2.25rem; }
    .display-3 { font-size: 2rem; }
    .display-4 { font-size: 1.75rem; }
    
    .lead { font-size: 1rem; }
}

@media (max-width: 575px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.35rem; }
    h3 { font-size: 1.15rem; }
    
    .display-4 { font-size: 1.5rem; }
}

/* Card responsive */
@media (max-width: 767px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .card-text {
        font-size: 0.9rem;
    }
}

/* Button responsive */
@media (max-width: 575px) {
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn-lg {
        padding: 0.6rem 1.25rem;
        font-size: 1rem;
    }
    
    .btn-sm {
        padding: 0.35rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Grid responsive fixes */
@media (max-width: 575px) {
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .row > * {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .g-4, .gx-4 {
        --bs-gutter-x: 1rem;
    }
    
    .g-4, .gy-4 {
        --bs-gutter-y: 1rem;
    }
}

/* Page headers responsive */
.page-header {
    padding: 4rem 0 2rem;
}

@media (max-width: 991px) {
    .page-header {
        padding: 3rem 0 1.5rem;
    }
}

@media (max-width: 767px) {
    .page-header {
        padding: 2.5rem 0 1.25rem;
    }
}

@media (max-width: 575px) {
    .page-header {
        padding: 2rem 0 1rem;
    }
}

/* Hero sections responsive */
@media (max-width: 767px) {
    .hero-title {
        font-size: 2rem !important;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
    }
}

@media (max-width: 575px) {
    .hero-title {
        font-size: 1.5rem !important;
    }
    
    .hero-subtitle {
        font-size: 0.9rem !important;
    }
}

/* Sidebar responsive */
@media (max-width: 991px) {
    .sidebar-card {
        margin-bottom: 1.5rem;
    }
}

/* Modal responsive */
@media (max-width: 575px) {
    .modal-dialog {
        margin: 0;
        max-width: 100%;
    }
    
    .modal-content {
        border-radius: 0;
        min-height: 100vh;
    }
    
    .modal-header {
        padding: 0.75rem 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 0.75rem 1rem;
    }
    
    .modal-title {
        font-size: 1rem;
    }
}

/* Form responsive */
@media (max-width: 575px) {
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .form-floating > .form-control {
        padding: 1rem 0.75rem;
    }
    
    .form-floating > label {
        padding: 1rem 0.75rem;
    }
}

/* Table responsive */
@media (max-width: 767px) {
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .table td, .table th {
        padding: 0.5rem;
    }
}

/* Alert responsive */
@media (max-width: 575px) {
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* Badge responsive */
@media (max-width: 575px) {
    .badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }
}

/* Flex utilities responsive */
@media (max-width: 575px) {
    .d-flex.justify-content-between {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .d-flex.gap-4 {
        gap: 1rem !important;
    }
    
    .d-flex.gap-3 {
        gap: 0.75rem !important;
    }
}

/* Hide/show utilities */
@media (max-width: 575px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 576px) {
    .show-mobile-only {
        display: none !important;
    }
}

/* Touch-friendly spacing */
@media (max-width: 767px) {
    .btn, 
    .nav-link,
    .dropdown-item,
    .list-group-item {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden;
}

.container-fluid {
    overflow-x: hidden;
}

/* Image gallery responsive */
@media (max-width: 575px) {
    .gallery-item img {
        height: 200px;
        object-fit: cover;
    }
}

/* News/Blog cards responsive */
@media (max-width: 575px) {
    .news-card .row {
        flex-direction: column;
    }
    
    .news-card .col-md-4,
    .news-card .col-md-8 {
        width: 100%;
    }
    
    .news-image-container {
        height: 200px;
        min-height: 200px;
    }
}

/* Event cards responsive */
@media (max-width: 575px) {
    .event-date-box {
        min-width: 50px;
        padding: 0.4rem;
    }
    
    .event-day {
        font-size: 1.25rem;
    }
    
    .event-month {
        font-size: 0.65rem;
    }
}

/* Focus area cards responsive */
@media (max-width: 575px) {
    .focus-card {
        height: 250px;
    }
    
    .focus-title h3 {
        font-size: 1.1rem;
    }
}

/* Impact stats responsive */
@media (max-width: 575px) {
    .impact-stat-box {
        padding: 1.5rem 1rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }
    
    .stat-icon-bg {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

/* Footer responsive */
@media (max-width: 767px) {
    footer {
        text-align: center;
    }
    
    footer .row > div {
        margin-bottom: 2rem;
    }
}
