/* ============================================
   RESPONSIVE FIX & OPTIMIZATION
   Fix cho feature cards bị che khuất
   ============================================ */

/* Reset z-index hierarchy */
html, body {
    position: relative;
    overflow-x: hidden;
}

/* Main content container */
.main-content {
    position: relative;
    z-index: 5 !important;
    background: var(--color-white);
}

/* Hero section - Lowest z-index */
.hero-section {
    position: relative;
    z-index: 1 !important;
    background: linear-gradient(135deg, #000000 0%, #434343 100%) !important;
    min-height: 600px;
}

.hero-section #particles-js,
#particles-js {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0 !important;
    pointer-events: none;
}

.hero-section .container {
    position: relative;
    z-index: 10 !important;
}

/* All sections after hero */
section:not(.hero-section) {
    position: relative;
    z-index: 10 !important;
}

section.bg-white {
    background: var(--color-white) !important;
}

section.bg-light {
    background: var(--color-gray-100) !important;
}

section.bg-gradient-primary {
    background: var(--gradient-primary) !important;
}

/* Feature cards - Ensure visibility */
.feature-card {
    position: relative;
    z-index: 100 !important;
    background: var(--color-white) !important;
    border: 2px solid var(--color-gray-200);
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.feature-icon {
    position: relative;
    z-index: 101;
}

/* Product cards */
.product-card {
    position: relative;
    z-index: 100 !important;
    background: var(--color-white) !important;
}

/* Testimonial cards */
.testimonial-card {
    position: relative;
    z-index: 100 !important;
    background: var(--color-white) !important;
}

/* Container fixes */
.container {
    position: relative;
    z-index: 50;
}

.row {
    position: relative;
    z-index: 51;
}

/* Mobile specific fixes */
@media (max-width: 768px) {
    .feature-card {
        width: 100%;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 1.5rem;
    }
    
    .col-md-4 {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Ensure no overflow on mobile */
    .row {
        margin-left: -15px;
        margin-right: -15px;
    }
}

/* Tablet specific fixes */
@media (min-width: 768px) and (max-width: 992px) {
    .feature-card {
        min-height: 280px;
    }
}

/* Desktop specific fixes */
@media (min-width: 992px) {
    .feature-card {
        min-height: 300px;
    }
}

/* Clearfix for rows */
.row::after {
    content: "";
    display: table;
    clear: both;
}

/* Prevent content being hidden */
.py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

/* Animation debugging - Remove if animations work fine */
[data-aos] {
    pointer-events: auto !important;
}

[data-aos].aos-animate {
    pointer-events: auto !important;
}

/* Ensure sections are visible */
section {
    display: block !important;
    visibility: visible !important;
}

/* Grid fixes */
.g-4 {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
}

.g-4 > * {
    padding-right: calc(var(--bs-gutter-x) * 0.5);
    padding-left: calc(var(--bs-gutter-x) * 0.5);
    margin-top: var(--bs-gutter-y);
}

/* Prevent Bootstrap conflicts */
.col-md-4,
.col-lg-3,
.col-md-6 {
    position: relative;
    width: 100%;
    min-height: 1px;
}

/* Mobile column fixes */
@media (max-width: 767.98px) {
    .col-md-4,
    .col-lg-3,
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Tablet column fixes */
@media (min-width: 768px) {
    .col-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    
    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Desktop column fixes */
@media (min-width: 992px) {
    .col-lg-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

/* Visibility helpers */
.visible {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Debug mode - Uncomment to see borders */
/*
.feature-card {
    border: 3px solid red !important;
}

section {
    border: 3px solid blue !important;
}

.container {
    border: 2px solid green !important;
}
*/
