/* Main CSS - Imports all modular stylesheets */

/* Base styles */
@import url('base/variables.css');
@import url('base/reset.css');
@import url('base/typography.css');
@import url('base/utilities.css');

/* Layout styles */
@import url('layout/container.css');
@import url('layout/navbar.css');
@import url('layout/spacing.css');

/* Component styles */
@import url('components/buttons.css');
@import url('components/cards.css');
@import url('components/footer.css');
@import url('components/quote-drawer.css');
@import url('pages/content-listing.css');
@import url('pages/detail-pages.css');
@import url('pages/errors.css');

/* Section styles */
/* To be added as they are created */

/* Page-specific styles */
/* To be added as they are created */

/* Ensure proper font loading */
html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-white);
    color: var(--color-dark);
    font-family: var(--font-family-body);
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111111;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.loading-pages {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #111111;
}

.loading-face {
    position: absolute;
    width: clamp(130px, 20vw, 260px);
    height: clamp(180px, 34vw, 360px);
    overflow: hidden;
    border: 5px solid #d4a574;
    border-radius: 50%;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.38);
    animation: loading-face-open 0.9s cubic-bezier(0.22, 0.75, 0.2, 1) both;
}

.loading-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.9) contrast(1.05);
}

.loading-face-elephant { top: 8%; left: 4%; transform-origin: bottom right; animation-delay: 0.05s; }
.loading-face-rhino { top: 4%; right: 4%; transform-origin: bottom left; animation-delay: 0.12s; }
.loading-face-hippo { bottom: 4%; left: 23%; transform-origin: top right; animation-delay: 0.19s; }
.loading-face-buffalo { bottom: 4%; right: 23%; transform-origin: top left; animation-delay: 0.26s; }
.loading-face-lion { top: 50%; left: 50%; width: clamp(150px, 24vw, 300px); height: clamp(150px, 24vw, 300px); transform: translate(-50%, -50%); animation-delay: 0.33s; }

@keyframes loading-face-open {
    from { opacity: 0; transform: translate(0, 110%) scale(0.35); }
    to { opacity: 1; transform: translate(0, 0) scale(1); }
}

.loading-face-rhino,
.loading-face-buffalo { animation-name: loading-face-open-right; }

@keyframes loading-face-open-right {
    from { opacity: 0; transform: translateX(110%) scale(0.35); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

.loading-face-lion { animation-name: loading-face-open-circle; }

@keyframes loading-face-open-circle {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.partners-carousel {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 220px;
}

.partners-track {
    display: flex;
    align-items: stretch;
    gap: 24px;
    min-width: max-content;
    width: max-content;
    animation: partners-roll 28s linear infinite;
    will-change: transform;
}

.partners-track.is-paused,
.partners-carousel:hover .partners-track,
.partners-carousel:focus-within .partners-track {
    animation-play-state: paused;
}

.partners-track .partner-card {
    flex: 0 0 min(260px, 78vw);
    display: block;
}

@keyframes partners-roll {
    from { transform: translateX(0); }
    to { transform: translateX(calc(-50% - 12px)); }
}

@media (prefers-reduced-motion: reduce) {
    .partners-track {
        animation: none;
    }
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.loading-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.loading-circle {
    width: 42px;
    height: 42px;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: loading-spin 0.8s linear infinite;
}

.loading-text {
    margin: 0;
    color: #333333;
    font-weight: 600;
}

@keyframes loading-spin {
    to { transform: rotate(360deg); }
}

.floating-whatsapp,
.back-to-top {
    position: fixed;
    bottom: 24px;
    z-index: 1500;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    cursor: pointer;
}

.floating-whatsapp {
    left: max(24px, env(safe-area-inset-left));
    background: #25d366;
    color: #ffffff;
    font-size: 1.55rem;
    line-height: 1;
    touch-action: manipulation;
}

.back-to-top {
    right: 24px;
    background: #111111;
    color: #ffffff;
    font-size: 1.5rem;
}

@media (max-width: 480px) {
    .floating-whatsapp,
    .back-to-top {
        bottom: 16px;
        width: 46px;
        height: 46px;
    }

    .floating-whatsapp {
        left: max(16px, env(safe-area-inset-left));
        bottom: max(16px, env(safe-area-inset-bottom));
        width: 52px;
        height: 52px;
        font-size: 1.45rem;
    }
    .back-to-top { right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .loading-face,
    .loading-circle {
        animation: none;
    }
}

/* Global transitions for better performance */
* {
    transition-property: background-color, border-color, color, fill, stroke, opacity;
}

/* Hide elements with hidden attribute */
[hidden] {
    display: none !important;
}

/* Print styles */
@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    button,
    input,
    select,
    textarea {
        background-color: #ffffff;
        border: 1px solid #999999;
    }
}
