/* --- Root Variables & Base Styles --- */
:root {
    --primary-color: #0c4da2; /* Tailwind Cyan 600 */
    --primary-color-darker: #0e7490; /* Tailwind Cyan 700 */
    --primary-glow: rgba(8, 145, 178, 0.3);
    --secondary-color: #6c757d;
    --background-light: #ffffff;
    --background-dark: #121826;
    --text-light: #1f2937;
    --text-dark: #f9fafb;
    --card-bg-light: #ffffff;
    --card-bg-dark: #1f2937;
}

html.dark {
    --background-light: var(--background-dark);
    --text-light: var(--text-dark);
    --card-bg-light: var(--card-bg-dark);
    --primary-glow: rgba(34, 211, 238, 0.3);
}

body {
    font-family: 'Manrope', sans-serif;
    background-color: var(--background-light);
    color: var(--text-light);
    font-size: 1.125rem; /* 18px -> Use rem for scalability */
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    line-height: 1.2; /* Add line-height for better heading spacing */
}

/* Base heading sizes for desktop */
h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.75rem; }


.dark h1, .dark h2, .dark h3, .dark h4, .dark h5, .dark h6 {
    color: var(--text-dark);
}

.container {
    max-width: 1440px;
    padding-left: 1.5rem; /* Add padding for mobile */
    padding-right: 1.5rem; /* Add padding for mobile */
    margin-left: auto;
    margin-right: auto;
}

/* --- Navigation --- */
.sticky-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    transition: background-color 0.3s ease-in-out;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
}

html.dark .sticky-nav {
    background-color: rgba(18, 24, 38, 0.8);
}

.nav-link {
    position: relative;
    padding-bottom: 8px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease-in-out;
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

/* --- Text & Gradients --- */
.text-gradient {
    background: linear-gradient(to right, var(--primary-color), var(--primary-color-darker));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text; /* Add standard property */
    text-fill-color: transparent; /* Add standard property */
}

.dark .text-gradient {
    background: linear-gradient(to right, #22d3ee, #0891b2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

/* --- Cards --- */
.card {
    background-color: var(--card-bg-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease-in-out;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    border-radius: 0.75rem; /* Add border-radius for consistency */
}

html.dark .card {
    border-color: #374151;
    box-shadow: none;
}

/* Hover effect for devices that support it */
@media (hover: hover) {
    .card:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 0 15px var(--primary-glow);
    }
}

.brand-logo-card {
    transition: all 0.3s ease;
}

@media (hover: hover) {
    .brand-logo-card:hover {
        transform: translateY(-10px) scale(1.05);
    }
}

.brand-logo-container {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    padding: 1rem;
    position: relative;
}

html.dark .brand-logo-container {
    background-color: #374151;
}

.brand-logo-container img {
    max-height: 80px;
    width: auto;
    object-fit: contain;
}

.brand-card.hidden {
    display: none;
}


/* --- Filter & Flags --- */
.filter-button {
    color: #9ca3af;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    background: none;
    padding: 8px 16px;
    font-size: 1.125rem;
    font-weight: 600;
}

html.dark .filter-button {
    color: #9ca3af;
}

.filter-button:hover {
    color: var(--primary-color);
}

html.dark .filter-button:hover {
    color: #22d3ee;
}

.filter-button.active {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

html.dark .filter-button.active {
    color: #22d3ee;
    border-color: #22d3ee;
}

.flag-container {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}


/* --- Animations & Effects --- */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.about-image-container {
    overflow: hidden;
    border-radius: 0.75rem;
}

.about-image-container img {
    transition: transform 0.5s ease;
    width: 100%; /* Ensure image is responsive */
    height: auto;
}

@media (hover: hover) {
    .about-image-container:hover img {
        transform: scale(1.05);
    }
}


/* --- Hero & Swiper --- */
.hero-slider {
    overflow: hidden;
}

.hero-section {
    position: relative;
    height: 90vh; /* Use viewport height */
    min-height: 600px;
}

.swiper-container, .swiper-wrapper, .swiper-slide {
    height: 100%;
}

.swiper-slide {
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}

.slide-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Changed from 120% to avoid overflow issues */
    background-size: cover;
    background-position: center;
    will-change: transform;
}

.swiper-button-next, .swiper-button-prev {
    color: #fff;
    background-color: rgba(0,0,0,0.2);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.swiper-button-next:hover, .swiper-button-prev:hover {
    background-color: rgba(0,0,0,0.4);
}

.swiper-button-next::after, .swiper-button-prev::after {
    font-size: 1.25rem; /* Use rem */
    font-weight: 900;
}

.swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background-color: rgba(255,255,255,0.5);
    opacity: 1;
}

.swiper-pagination-bullet-active {
    background-color: var(--primary-color);
}

.swiper-slide .reveal-content {
    margin-top: 0; /* Let flexbox handle alignment */
    text-align: left;
    max-width: 90%; /* Constrain width on smaller screens */
}

.swiper-slide .reveal-content h1,
.swiper-slide .reveal-content p,
.swiper-slide .reveal-content a {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.swiper-slide-active .reveal-content h1 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

.swiper-slide-active .reveal-content p {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.5s;
}

.swiper-slide-active .reveal-content a {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.7s;
}


/* --- Gemini Chat --- */
#gemini-fab {
    position: fixed;
    bottom: 1.5rem; /* Adjust for mobile */
    right: 1.5rem; /* Adjust for mobile */
    z-index: 1000;
}

#gemini-modal {
    position: fixed;
    bottom: 5.5rem; /* Adjust for mobile */
    right: 1.5rem; /* Adjust for mobile */
    width: calc(100% - 3rem); /* Make it responsive */
    max-width: 400px; /* Set a max-width */
    z-index: 1000;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

#gemini-chat-window {
    height: 400px;
    max-height: 60vh; /* Use viewport height */
    overflow-y: auto;
}

.user-message { text-align: right; }
.user-message .message-bubble { background-color: var(--primary-color); color: white; }
.bot-message .message-bubble { background-color: #e5e7eb; color: #1f2937; }
html.dark .bot-message .message-bubble { background-color: #374151; color: #f9fafb; }

.typing-indicator span {
    height: 8px; width: 8px; background-color: #9ca3af; border-radius: 50%;
    display: inline-block; animation: bounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1.0); } }


/* --- Page Content Wrapper & Backgrounds --- */
#page-content {
    position: relative;
    z-index: 2;
    background-color: var(--background-light);
}

.brands-section-bg {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%230c4da2' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
html.dark .brands-section-bg {
    background-color: #1a2233;
}


/* --- New Modal Styles (Brand Modal & Product Slider) --- */
#brand-modal.show #brand-modal-overlay { animation: modal-fade-in 0.3s ease-out forwards; }
#brand-modal.show #brand-modal-content { animation: modal-slide-up 0.4s ease-out forwards; }
@keyframes modal-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-slide-up {
    from { transform: translateY(30px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

#brand-modal-content .modal-logo {
    width: 128px; height: 128px; border-radius: 9999px; border: 4px solid var(--primary-color);
    box-shadow: 0 0 20px var(--primary-glow); object-fit: contain; background-color: white; padding: 0.5rem;
}

/* Staggered animation for modal content */
#brand-modal.show .modal-animate {
    opacity: 0; transform: translateY(20px);
    animation: modal-content-fade-in 0.5s ease-out forwards;
}
#brand-modal.show h2.modal-animate { animation-delay: 0.2s; }
#brand-modal.show p.modal-animate { animation-delay: 0.3s; }
#brand-modal.show .modal-details { animation-delay: 0.4s; }
#brand-modal.show a.modal-animate { animation-delay: 0.5s; }
@keyframes modal-content-fade-in { to { opacity: 1; transform: translateY(0); } }

/* Product Slider inside Modal */
.modal-inner {
    width: 90vw; /* Use viewport width for responsiveness */
    max-width: 650px;
    min-width: unset; /* Remove min-width */
    background: #fff; border-radius: 20px;
    box-shadow: 0 10px 32px rgba(0,0,0,0.15);
    padding: 30px 24px; position: relative;
}

.brand-slider-logo {
    max-width: 120px; margin: 0 16px 0 0;
    vertical-align: middle; display: inline-block;
}

.brand-slider-flag {
    width: 38px; height: 38px; border-radius: 50%;
    border: 2px solid #eee; box-shadow: 0 2px 12px rgba(0,0,0,0.11);
    vertical-align: middle;
}

.brand-slider-details h3 {
    font-size: 1.4rem; font-weight: 800;
    margin:24px 0 8px 0; color: #253250;
}
.brand-slider-details p {
    color: #555; font-size: 1.07rem; margin-bottom:2px;
}

.swiper-modal {
    width: 100%; min-height: 280px;
}

.swiper-slide img.product-image {
    width: 100%; /* Make image responsive */
    max-width: 200px; /* Adjust max-width */
    height: auto;
    max-height: 170px;
    border-radius: 14px; box-shadow: 0 4px 18px rgba(0,0,0,0.09);
    margin: 0 auto 16px auto;
}

/* Ensure swiper nav buttons are consistent */
.swiper-modal .swiper-button-next, .swiper-modal .swiper-button-prev {
    color: #09c; background: rgba(250,250,250,0.85);
    width: 46px; height: 46px; border-radius: 50%;
    box-shadow: 0 2px 9px rgba(0,0,0,0.12);
}
.swiper-modal .swiper-pagination-bullet { background: #09c; opacity: 0.5; }
.swiper-modal .swiper-pagination-bullet-active { background: #016589; opacity: 1; }

/*
==============================================
--- RESPONSIVE ADJUSTMENTS (Mobile First) ---
==============================================
*/

/* --- Tablet and smaller devices --- */
@media (max-width: 992px) {
    .hero-section {
        min-height: 500px;
        height: 80vh;
    }
}

/* --- Mobile devices --- */
@media (max-width: 768px) {
    /* Adjust base font size, which scales all rem units */
    body {
        font-size: 1rem; /* 16px */
    }

    /* Scale down headings for mobile */
    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }

    /* --- Hero Slider Mobile --- */
    .hero-section {
        height: 70vh;
        min-height: 450px;
    }

    .swiper-slide .reveal-content {
        max-width: 100%;
        text-align: center; /* Center text on mobile */
    }

    .swiper-button-next, .swiper-button-prev {
        width: 40px;
        height: 40px;
    }
    .swiper-button-next::after, .swiper-button-prev::after {
        font-size: 1rem;
    }

    /* --- Filter Buttons Mobile --- */
    .filter-button {
        padding: 6px 10px;
        font-size: 1rem;
    }

    /* --- Modal Mobile Adjustments --- */
    .modal-inner {
        padding: 24px 16px;
    }

    .brand-slider-details {
        text-align: center;
    }
    
    .brand-slider-logo, .brand-slider-flag {
        display: block;
        margin-left: auto;
        margin-right: auto;
    }
    
    .brand-slider-flag {
        margin-top: 0.5rem;
    }

    .brand-slider-details h3 {
        font-size: 1.25rem;
    }
}