/**
 * Terranz International - Main Styles
 * Consolidated from inline styles across all pages
 * Optimized for performance on mobile and desktop
 */

/* ============================================
   FONTS & BASE SETUP
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #21333e;
    --secondary-color: #f97316;
    --accent-color: #eef4ed;
    --transition-speed: 0.3s;
}

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================
   HERO VIDEO SECTION
   ============================================ */
.hero-video {
    object-fit: cover;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}

.gradient-overlay {
    background: linear-gradient(45deg, rgba(33, 51, 62, 0.8), rgba(33, 51, 62, 0.6));
    z-index: 1;
}

/* ============================================
   CARD STYLES - OPTIMIZED
   ============================================ */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.modern-card {
    background: linear-gradient(135deg, #1a2730 0%, #21333e 100%);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: white;
}

.modern-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* ============================================
   FILTER BUTTONS
   ============================================ */
.filter-btn {
    transition: all 0.3s ease;
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
}

/* ============================================
   COUNTER STYLES - SIMPLIFIED
   ============================================ */
.counter-circle {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(var(--secondary-color) 0deg, var(--secondary-color) calc(var(--percent) * 3.6deg), #e5e7eb calc(var(--percent) * 3.6deg));
    display: flex;
    align-items: center;
    justify-content: center;
}

.counter-circle::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
}

.counter-number {
    position: relative;
    z-index: 1;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* ============================================
   DROPDOWN MENU
   ============================================ */
.dropdown:hover .dropdown-menu {
    display: block;
}

/* ============================================
   SCROLLBAR UTILITIES
   ============================================ */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none; 
    scrollbar-width: none; 
}

/* ============================================
   MODAL STYLES
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid #f97316;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #21333e 0%, #2d4654 100%);
    border-radius: 1rem 1rem 0 0;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.modal-close {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: rgba(249, 115, 22, 0.2);
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #f97316;
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
}

.modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 0.5rem;
}

/* ============================================
   LIGHTBOX STYLES
   ============================================ */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    animation: lightboxZoom 0.3s ease-out;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

.lightbox-close {
    position: absolute;
    top: -3rem;
    right: 0;
    width: 2.5rem;
    height: 2.5rem;
    background: #f97316;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: #ea580c;
    transform: rotate(90deg) scale(1.1);
}

/* ============================================
   GALLERY STYLES
   ============================================ */
.gallery-card {
    background: linear-gradient(135deg, #1a2730 0%, #21333e 100%);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.gallery-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-card:hover .gallery-image {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 1rem;
}

.gallery-card:hover .gallery-overlay {
    opacity: 1;
}

.gallery-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 3rem;
    height: 3rem;
    background: rgba(249, 115, 22, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    pointer-events: none;
}

.gallery-card:hover .gallery-icon {
    transform: translate(-50%, -50%) scale(1);
}

/* ============================================
   KEYFRAME ANIMATIONS - ESSENTIAL ONLY
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes lightboxZoom {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Simple fade-in-up animation class */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ============================================
   SWIPER/CAROUSEL ANIMATIONS - OPTIMIZED
   ============================================ */
.swiper-container {
    overflow: hidden;
}

.swiper-wrapper {
    display: flex;
    animation: scroll 20s linear infinite;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Pause animation on hover for better UX */
.swiper-wrapper:hover {
    animation-play-state: paused;
}

/* ============================================
   RESPONSIVE OPTIMIZATIONS
   ============================================ */
@media (max-width: 768px) {
    /* Reduce animations on mobile for performance */
    .product-card:hover,
    .modern-card:hover,
    .gallery-card:hover {
        transform: translateY(-5px);
    }
    
    .gallery-image {
        height: 150px;
    }
    
    .counter-circle {
        width: 100px;
        height: 100px;
    }
    
    .counter-circle::before {
        width: 70px;
        height: 70px;
    }
    
    .counter-number {
        font-size: 1.25rem;
    }
    
    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .modal-body {
        padding: 1rem;
    }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */
/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .scroll-animate {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Optimize hardware acceleration for smooth animations */
.product-card,
.modern-card,
.gallery-card,
.modal-content,
.lightbox-content {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Remove will-change after animation completes */
.product-card:not(:hover),
.modern-card:not(:hover),
.gallery-card:not(:hover) {
    will-change: auto;
}
