/* ==========================================
   RESPONSIVE DESIGN - Mobile First Approach
   ========================================== */

/* ===== MOBILE (Extra Small - 320px to 575px) ===== */
@media (max-width: 575px) {
    /* Hero Section */
    #heroSection {
        min-height: 300px !important;
        padding: 20px !important;
    }

    .hero-section {
        min-height: 300px !important;
    }

    /* Hero Title */
    h1 {
        font-size: 24px !important;
        line-height: 1.3 !important;
        margin-bottom: 15px !important;
        text-shadow: 0 2px 12px rgba(0,0,0,0.4) !important;
    }

    /* Search Bar */
    .input-group {
        flex-direction: column;
    }

    .input-group input {
        border-radius: 4px 4px 0 0 !important;
        margin-bottom: 8px;
        font-size: 13px !important;
    }

    .input-group button {
        border-radius: 0 0 4px 4px !important;
        width: 100%;
        font-size: 13px !important;
    }

    /* Navigation Buttons (Hero Carousel) */
    .hero-nav-btn {
        width: 36px !important;
        height: 36px !important;
        left: 8px !important;
        right: 8px !important;
    }

    #heroCarouselPrev { left: 8px !important; }
    #heroCarouselNext { right: 8px !important; }

    .hero-nav-btn i {
        font-size: 16px !important;
    }

    /* Dot Indicators */
    .carousel-dots {
        bottom: 12px !important;
        gap: 6px !important;
    }

    .carousel-dot {
        width: 8px !important;
        height: 8px !important;
    }

    /* Features Slider */
    #featuresSlider {
        padding: 15px 10px !important;
        gap: 10px !important;
    }

    .flex-shrink-0 {
        width: 100% !important;
        min-width: 100% !important;
    }

    /* Card Padding */
    .card-body {
        padding: 15px !important;
    }

    /* Text Sizing */
    .small { font-size: 12px !important; }
    h2 { font-size: 20px !important; }
    h3 { font-size: 18px !important; }
    h4 { font-size: 16px !important; }
    h5 { font-size: 14px !important; }
    h6 { font-size: 12px !important; }

    /* Container */
    .container-lg,
    .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* Navbar */
    .navbar {
        padding: 0.5rem 0.75rem !important;
    }

    .navbar-brand {
        font-size: 16px !important;
    }

    /* Buttons */
    .btn-lg {
        padding: 8px 16px !important;
        font-size: 14px !important;
    }

    .btn {
        padding: 6px 12px !important;
        font-size: 13px !important;
    }

    /* Forms */
    .form-control,
    .form-select {
        font-size: 14px !important;
        padding: 8px 10px !important;
    }

    /* Membership Section */
    .col-lg-6 {
        margin-bottom: 30px;
    }

    /* Image Heights */
    img {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Grid Columns */
    .row {
        margin-left: -6px !important;
        margin-right: -6px !important;
    }

    [class*="col-"] {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    /* Dashboard Adjustments */
    .sidebar {
        width: 100% !important;
        position: fixed !important;
        z-index: 999 !important;
    }

    .main-content {
        padding: 1rem !important;
    }

    /* Table Responsive */
    .table {
        font-size: 12px !important;
    }

    .table th, .table td {
        padding: 8px 6px !important;
    }

    /* Card Image Heights - Mobile */
    .listing-card [style*="height: 250px"] {
        height: 150px !important;
    }
}

/* ===== TABLET (Small - 576px to 767px) ===== */
@media (min-width: 576px) and (max-width: 767px) {
    h1 { font-size: 32px !important; }
    h2 { font-size: 24px !important; }
    h3 { font-size: 20px !important; }

    #heroSection { min-height: 350px !important; }
    .hero-section { min-height: 350px !important; }

    .input-group-lg input,
    .input-group-lg button {
        font-size: 14px !important;
        padding: 10px 12px !important;
    }

    #featuresSlider {
        gap: 12px !important;
    }

    .flex-shrink-0 {
        width: 50% !important;
        min-width: 50% !important;
    }

    .card {
        margin-bottom: 20px;
    }

    .hero-nav-btn {
        width: 40px !important;
        height: 40px !important;
        left: 12px !important;
        right: 12px !important;
    }

    #heroCarouselPrev { left: 12px !important; }
    #heroCarouselNext { right: 12px !important; }

    /* Table Tablet */
    .table {
        font-size: 13px !important;
    }

    /* Sidebar Tablet */
    .sidebar {
        width: 80px !important;
    }

    .sidebar-text {
        display: none !important;
    }
}

/* ===== MEDIUM (Medium - 768px to 991px) ===== */
@media (min-width: 768px) and (max-width: 991px) {
    h1 { font-size: 42px !important; }
    h2 { font-size: 32px !important; }
    h3 { font-size: 26px !important; }

    #featuresSlider {
        gap: 15px !important;
    }

    .flex-shrink-0 {
        width: 33.333% !important;
        min-width: 33.333% !important;
    }

    /* Hero Section */
    .hero-section {
        min-height: 450px !important;
    }

    .container-lg {
        max-width: 960px !important;
    }

    /* Dashboard */
    .sidebar {
        width: 200px !important;
    }

    .main-content {
        padding: 1.5rem !important;
    }
}

/* ===== LARGE (Large - 992px to 1199px) ===== */
@media (min-width: 992px) and (max-width: 1199px) {
    h1 { font-size: 48px !important; }
    h2 { font-size: 36px !important; }

    #featuresSlider {
        gap: 18px !important;
    }

    .flex-shrink-0 {
        width: 25% !important;
        min-width: 25% !important;
    }

    .container-lg {
        max-width: 1215px !important;
    }
}

/* ===== EXTRA LARGE (Extra Large - 1200px+) ===== */
@media (min-width: 1200px) {
    h1 { font-size: 52px !important; }
    h2 { font-size: 40px !important; }

    #featuresSlider {
        gap: 20px !important;
    }

    .flex-shrink-0 {
        width: 22% !important;
        min-width: 22% !important;
    }

    .container-lg {
        max-width: 1320px !important;
    }
}

/* ==========================================
   UNIVERSAL RESPONSIVE RULES (All Sizes)
   ========================================== */

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Responsive Tables */
table {
    width: 100%;
    overflow-x: auto;
    display: block;
}

@media (max-width: 767px) {
    table {
        font-size: 12px;
    }

    table thead {
        display: none;
    }

    table tbody {
        display: block;
    }

    table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
    }

    table td {
        display: block;
        text-align: right;
        padding-left: 50%;
        position: relative;
    }

    table td:before {
        content: attr(data-label);
        position: absolute;
        left: 6px;
        font-weight: bold;
        text-align: left;
    }
}

/* Responsive Iframes (YouTube, etc) */
iframe {
    max-width: 100%;
    height: auto;
}

/* Responsive Grid */
.grid {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

@media (max-width: 575px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive Flexbox */
.flex-wrap {
    flex-wrap: wrap !important;
}

/* Hide Elements on Mobile */
.hide-mobile {
    display: none !important;
}

@media (min-width: 992px) {
    .hide-mobile {
        display: block !important;
    }
}

/* Hide Elements on Desktop */
.hide-desktop {
    display: block !important;
}

@media (min-width: 992px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Responsive Spacing */
@media (max-width: 575px) {
    .py-5 { padding-top: 20px !important; padding-bottom: 20px !important; }
    .py-4 { padding-top: 15px !important; padding-bottom: 15px !important; }
    .px-5 { padding-left: 15px !important; padding-right: 15px !important; }
    .m-5 { margin: 15px !important; }
}

/* Responsive Text Alignment */
@media (max-width: 767px) {
    .text-md-left { text-align: center !important; }
    .text-md-right { text-align: center !important; }
    .text-md-center { text-align: center !important; }
}

/* Touch-friendly Buttons */
@media (max-width: 767px) {
    button, a.btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Responsive Navbar */
.navbar-collapse {
    overflow: auto;
    max-height: calc(100vh - 60px);
}

/* Responsive Modal */
.modal-dialog {
    margin: 10px !important;
}

@media (max-width: 575px) {
    .modal-dialog {
        width: 100%;
        max-width: 100%;
    }
}

/* Responsive Cards */
.card {
    transition: all 0.3s ease;
}

@media (max-width: 767px) {
    .card {
        margin-bottom: 15px;
    }

    .card-header {
        padding: 12px 15px !important;
    }

    .card-body {
        padding: 15px !important;
    }
}

/* Responsive Listings Grid */
.listings-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

@media (max-width: 575px) {
    .listings-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .listing-card {
        margin-bottom: 15px;
    }

    .row.g-4 {
        gap: 15px !important;
    }
}

@media (min-width: 576px) and (max-width: 991px) {
    .listings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .listings-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .listings-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Responsive Hero Section */
@media (max-width: 575px) {
    .hero-section {
        min-height: 300px !important;
        justify-content: flex-end;
        padding-bottom: 40px;
    }
}

@media (min-width: 576px) and (max-width: 991px) {
    .hero-section {
        min-height: 400px !important;
    }
}

@media (min-width: 992px) {
    .hero-section {
        min-height: 500px !important;
    }
}

/* Responsive Carousel */
.carousel-controls {
    gap: 10px;
}

@media (max-width: 767px) {
    .carousel-controls button {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}

/* Responsive Typography - Maintain Readability */
body {
    font-size: 14px;
}

@media (min-width: 768px) {
    body {
        font-size: 15px;
    }
}

@media (min-width: 992px) {
    body {
        font-size: 16px;
    }
}

/* Responsive Padding/Margin - Consistent Spacing */
.section-padding {
    padding: 20px;
}

@media (min-width: 768px) {
    .section-padding {
        padding: 40px;
    }
}

@media (min-width: 1200px) {
    .section-padding {
        padding: 60px;
    }
}

/* Responsive Overflow */
.text-truncate-mobile {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .text-truncate-mobile {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }
}

/* Responsive Z-index Management */
@media (max-width: 767px) {
    .navbar {
        z-index: 1000 !important;
    }

    .modal {
        z-index: 1050 !important;
    }

    .dropdown-menu {
        max-width: calc(100vw - 20px) !important;
    }
}

/* Filter Section Responsive */
@media (max-width: 575px) {
    .card-body form {
        flex-direction: column !important;
    }

    .card-body form [class*="col-"] {
        margin-bottom: 12px;
    }

    .input-group {
        flex-direction: column;
    }

    .input-group > * {
        width: 100% !important;
        border-radius: 4px !important;
        margin-bottom: 8px;
    }

    .input-group > *:last-child {
        margin-bottom: 0;
    }
}

/* Breadcrumb Responsive */
.breadcrumb {
    font-size: 12px;
}

@media (min-width: 768px) {
    .breadcrumb {
        font-size: 14px;
    }
}

/* Alert Responsive */
.alert {
    padding: 12px 15px;
    margin-bottom: 15px;
    font-size: 13px;
}

@media (min-width: 768px) {
    .alert {
        padding: 15px 20px;
        font-size: 14px;
    }
}

/* Pagination Responsive */
.pagination {
    flex-wrap: wrap;
}

.pagination .page-link {
    padding: 6px 10px;
    font-size: 12px;
}

@media (min-width: 768px) {
    .pagination .page-link {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* Badge Responsive */
.badge {
    padding: 4px 8px;
    font-size: 11px;
}

@media (min-width: 768px) {
    .badge {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Form Responsive */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    font-size: 13px;
    margin-bottom: 6px;
}

@media (min-width: 768px) {
    .form-label {
        font-size: 14px;
        margin-bottom: 8px;
    }
}

/* ===== MEDIUM (Medium - 768px to 991px) ===== */
@media (min-width: 768px) and (max-width: 991px) {
    h1 { font-size: 42px !important; }
    h2 { font-size: 32px !important; }
    h3 { font-size: 26px !important; }

    #featuresSlider {
        gap: 15px !important;
    }

    .flex-shrink-0 {
        width: 33.333% !important;
        min-width: 33.333% !important;
    }

    /* Hero Section */
    .hero-section {
        min-height: 450px !important;
    }

    .container-lg {
        max-width: 960px !important;
    }
}

/* ===== LARGE (Large - 992px to 1199px) ===== */
@media (min-width: 992px) and (max-width: 1199px) {
    h1 { font-size: 48px !important; }
    h2 { font-size: 36px !important; }

    #featuresSlider {
        gap: 18px !important;
    }

    .flex-shrink-0 {
        width: 25% !important;
        min-width: 25% !important;
    }

    .container-lg {
        max-width: 1215px !important;
    }
}

/* ===== EXTRA LARGE (Extra Large - 1200px+) ===== */
@media (min-width: 1200px) {
    h1 { font-size: 52px !important; }
    h2 { font-size: 40px !important; }

    #featuresSlider {
        gap: 20px !important;
    }

    .flex-shrink-0 {
        width: 22% !important;
        min-width: 22% !important;
    }

    .container-lg {
        max-width: 1320px !important;
    }
}

/* ==========================================
   UNIVERSAL RESPONSIVE RULES (All Sizes)
   ========================================== */

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Responsive Tables */
table {
    width: 100%;
    overflow-x: auto;
    display: block;
}

/* Responsive Iframes (YouTube, etc) */
iframe {
    max-width: 100%;
    height: auto;
}

/* Responsive Grid */
.grid {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

@media (max-width: 575px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive Flexbox */
.flex-wrap {
    flex-wrap: wrap !important;
}

/* Hide Elements on Mobile */
.hide-mobile {
    display: none !important;
}

@media (min-width: 992px) {
    .hide-mobile {
        display: block !important;
    }
}

/* Hide Elements on Desktop */
.hide-desktop {
    display: block !important;
}

@media (min-width: 992px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Responsive Spacing */
@media (max-width: 575px) {
    .py-5 { padding-top: 20px !important; padding-bottom: 20px !important; }
    .py-4 { padding-top: 15px !important; padding-bottom: 15px !important; }
    .px-5 { padding-left: 15px !important; padding-right: 15px !important; }
    .m-5 { margin: 15px !important; }
}

/* Responsive Text Alignment */
@media (max-width: 767px) {
    .text-md-left { text-align: center !important; }
    .text-md-right { text-align: center !important; }
    .text-md-center { text-align: center !important; }
}

/* Touch-friendly Buttons */
@media (max-width: 767px) {
    button, a.btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Responsive Navbar */
.navbar-collapse {
    overflow: auto;
    max-height: calc(100vh - 60px);
}

/* Responsive Modal */
.modal-dialog {
    margin: 10px !important;
}

@media (max-width: 575px) {
    .modal-dialog {
        width: 100%;
        max-width: 100%;
    }
}

/* Responsive Cards */
.card {
    transition: all 0.3s ease;
}

@media (max-width: 767px) {
    .card {
        margin-bottom: 15px;
    }

    .card-header {
        padding: 12px 15px !important;
    }

    .card-body {
        padding: 15px !important;
    }
}

/* Responsive Listings Grid */
.listings-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

@media (max-width: 575px) {
    .listings-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .listing-card {
        margin-bottom: 15px;
    }

    .row.g-4 {
        gap: 15px !important;
    }
}

@media (min-width: 576px) and (max-width: 991px) {
    .listings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .listings-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .listings-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Responsive Hero Section */
@media (max-width: 575px) {
    .hero-section {
        min-height: 300px !important;
        justify-content: flex-end;
        padding-bottom: 40px;
    }
}

@media (min-width: 576px) and (max-width: 991px) {
    .hero-section {
        min-height: 400px !important;
    }
}

@media (min-width: 992px) {
    .hero-section {
        min-height: 500px !important;
    }
}

/* Responsive Carousel */
.carousel-controls {
    gap: 10px;
}

@media (max-width: 767px) {
    .carousel-controls button {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}

/* Responsive Typography - Maintain Readability */
body {
    font-size: 14px;
}

@media (min-width: 768px) {
    body {
        font-size: 15px;
    }
}

@media (min-width: 992px) {
    body {
        font-size: 16px;
    }
}

/* Responsive Padding/Margin - Consistent Spacing */
.section-padding {
    padding: 20px;
}

@media (min-width: 768px) {
    .section-padding {
        padding: 40px;
    }
}

@media (min-width: 1200px) {
    .section-padding {
        padding: 60px;
    }
}

/* Responsive Overflow */
.text-truncate-mobile {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .text-truncate-mobile {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }
}

/* Responsive Z-index Management */
@media (max-width: 767px) {
    .navbar {
        z-index: 1000 !important;
    }

    .modal {
        z-index: 1050 !important;
    }

    .dropdown-menu {
        max-width: calc(100vw - 20px) !important;
    }
}
