/* ============================================
   ENVIROCYCLE INC. - Custom Styles
   Modern, Animated, Responsive Design
   ============================================ */

/* Import if needed (already loaded via CDN, this is backup) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Montserrat:wght@400;500;600;700;800;900&display=swap');

/* Root Variables */
:root {
    --primary-50: #f0fdf4;
    --primary-100: #dcfce7;
    --primary-200: #bbf7d0;
    --primary-300: #86efac;
    --primary-400: #4ade80;
    --primary-500: #22c55e;
    --primary-600: #16a34a;
    --primary-700: #15803d;
    --primary-800: #166534;
    --primary-900: #14532d;
    --primary-950: #052e16;
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-500), var(--primary-700));
    border-radius: 5px;
    border: 2px solid #f1f5f9;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-600), var(--primary-800));
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-500) #f1f5f9;
}

/* Selection */
::selection {
    background: var(--primary-300);
    color: var(--primary-950);
}

/* Preloader */
#preloader {
    transition: opacity 0.7s ease, visibility 0.7s ease;
}
#preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Header Scroll Effects */
#header.scrolled #topBar {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    overflow: hidden;
}
#header.scrolled #mainNav {
    background: rgba(5, 46, 22, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Nav Link Hover Effect */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 20px;
    height: 2px;
    background: var(--primary-400);
    border-radius: 2px;
    transition: transform var(--transition-base);
}
.nav-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* Counter Animation */
.counter {
    font-variant-numeric: tabular-nums;
}

/* Card Hover Glow */
.group:hover .group-hover\:shadow-primary-500\/25 {
    box-shadow: 0 10px 40px rgba(34, 197, 94, 0.25);
}

/* Gradient Animation Support */
.animate-gradient {
    background-size: 200% auto;
}

/* Mobile Menu */
#mobileMenu {
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}
#mobileMenu.active {
    max-height: 500px;
}
#mobileMenu:not(.active) {
    opacity: 0;
}

/* Chat Widget */
#chat-widget {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
#chat-widget.hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
}
#chat-messages {
    scroll-behavior: smooth;
}
#chat-messages::-webkit-scrollbar {
    width: 4px;
}
#chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
#chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

/* Chat Toggle Button Pulse */
#chat-toggle {
    animation: pulse-ring 2s infinite;
}
@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(22, 163, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* Back to Top */
#backToTop.visible {
    opacity: 1;
    visibility: visible;
}

/* Form Focus Effects */
input:focus, textarea:focus, select:focus {
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

/* Swiper Custom Styles */
.swiper-pagination-bullet-active {
    background: var(--primary-500) !important;
}
.swiper-button-next,
.swiper-button-prev {
    color: var(--primary-600) !important;
    background: white;
    width: 50px !important;
    height: 50px !important;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 20px !important;
    font-weight: bold;
}

/* --------------------------
   RESPONSIVE BREAKPOINTS
   -------------------------- */

/* Tablet: 768px - 1024px */
@media (max-width: 1024px) {
    html {
        scroll-padding-top: 80px;
    }
    
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    section {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
}

/* Mobile: 640px - 767px */
@media (max-width: 767px) {
    html {
        scroll-padding-top: 70px;
        font-size: 15px;
    }
    
    section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    /* Smaller headings on mobile */
    h1 {
        font-size: 2.5rem !important;
        line-height: 1.2 !important;
    }
    h2 {
        font-size: 2rem !important;
        line-height: 1.3 !important;
    }
    
    /* Full-width cards on mobile */
    .grid {
        gap: 1rem;
    }
    
    /* Adjust hero section */
    .min-h-\[90vh\] {
        min-height: 80vh;
    }
    
    /* Chat widget full width on mobile */
    #chat-widget {
        width: calc(100vw - 2rem) !important;
        right: 1rem !important;
        left: 1rem !important;
        bottom: 1rem !important;
    }
    #chat-widget .h-80 {
        height: 50vh;
    }
}

/* Small Mobile: below 480px */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    h1 {
        font-size: 2rem !important;
    }
    h2 {
        font-size: 1.75rem !important;
    }
    
    /* Stack buttons */
    .flex-wrap.gap-4 {
        flex-direction: column;
    }
    .flex-wrap.gap-4 a,
    .flex-wrap.gap-4 button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    /* Stats smaller */
    .grid.grid-cols-3 {
        gap: 0.5rem;
    }
    .grid.grid-cols-3 .text-3xl,
    .grid.grid-cols-3 .text-4xl {
        font-size: 1.5rem !important;
    }
    .grid.grid-cols-3 .text-sm {
        font-size: 0.7rem;
    }
    
    /* Footer adjustments */
    footer .grid {
        gap: 2rem;
    }
    
    /* Back to top button smaller */
    #backToTop {
        width: 40px;
        height: 40px;
        bottom: 5rem;
        right: 1rem;
    }
    
    /* Chat toggle smaller */
    #chat-toggle {
        width: 48px;
        height: 48px;
        bottom: 1rem;
        right: 1rem;
        font-size: 1.25rem;
    }
}

/* Large Desktop: above 1440px */
@media (min-width: 1440px) {
    .container {
        max-width: 1280px;
    }
    
    h1 {
        font-size: 5rem !important;
    }
    
    section {
        padding-top: 7rem;
        padding-bottom: 7rem;
    }
}

/* Print Styles */
@media print {
    #header,
    #chat-widget,
    #chat-toggle,
    #backToTop,
    #preloader {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }
    
    a {
        text-decoration: underline;
    }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    #preloader {
        display: none;
    }
}