/* ===== Custom Styles for Ecometrix Landing Page ===== */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0a0a12;
}
::-webkit-scrollbar-thumb {
    background: #1a1a2e;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #2a2a4e;
}

/* Hero grid background */
.hero-grid {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* Navbar scroll state */
.navbar-scrolled {
    background: rgba(10, 10, 18, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Chart bar animation */
.chart-bar {
    animation: growBar 1.5s ease-out forwards;
    transform-origin: bottom;
}

@keyframes growBar {
    0% {
        transform: scaleY(0);
        opacity: 0;
    }
    100% {
        transform: scaleY(1);
        opacity: 1;
    }
}

/* Stagger chart bars */
.chart-bar:nth-child(1)  { animation-delay: 0.1s; }
.chart-bar:nth-child(2)  { animation-delay: 0.15s; }
.chart-bar:nth-child(3)  { animation-delay: 0.2s; }
.chart-bar:nth-child(4)  { animation-delay: 0.25s; }
.chart-bar:nth-child(5)  { animation-delay: 0.3s; }
.chart-bar:nth-child(6)  { animation-delay: 0.35s; }
.chart-bar:nth-child(7)  { animation-delay: 0.4s; }
.chart-bar:nth-child(8)  { animation-delay: 0.45s; }
.chart-bar:nth-child(9)  { animation-delay: 0.5s; }
.chart-bar:nth-child(10) { animation-delay: 0.55s; }
.chart-bar:nth-child(11) { animation-delay: 0.6s; }
.chart-bar:nth-child(12) { animation-delay: 0.65s; }

/* Feature card hover effect */
.feature-card {
    position: relative;
    overflow: hidden;
}
.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(51, 141, 255, 0.5), transparent);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}
.feature-card:hover::before {
    transform: scaleX(1);
}

/* Scroll animation defaults — hidden before intersection */
.scroll-animate {
    opacity: 0;
}
.scroll-animate.visible {
    animation-fill-mode: both;
}
.scroll-animate.visible[data-animation="fade-up"] {
    animation-name: fadeUp;
    animation-duration: 0.8s;
    animation-timing-function: ease-out;
}

/* === NEW: Glassmorphism & Modern Effects === */

/* Gradient animation for hero title */
@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animate-gradient {
    animation: gradient 8s ease-in-out infinite;
}

/* Slow pulse for background blobs */
@keyframes pulse-slow {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.animate-pulse-slow {
    animation: pulse-slow 8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* === Select Dropdown Styling === */

/* Custom select styling for dark theme */
select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(156,163,175)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

/* Remove default select arrow in Firefox */
select {
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
}

/* Remove default select arrow in IE */
select::-ms-expand {
    display: none;
}

/* Option styling (limited browser support) */
select option {
    padding: 12px;
}

/* Placeholder text color for select */
select option[value=""][disabled] {
    color: rgb(156, 163, 175);
}
.scroll-animate.visible[data-animation="fade-in"] {
    animation-name: fadeIn;
    animation-duration: 0.6s;
    animation-timing-function: ease-out;
}
.scroll-animate.visible[data-animation="slide-in-left"] {
    animation-name: slideInLeft;
    animation-duration: 0.8s;
    animation-timing-function: ease-out;
}
.scroll-animate.visible[data-animation="slide-in-right"] {
    animation-name: slideInRight;
    animation-duration: 0.8s;
    animation-timing-function: ease-out;
}

@keyframes fadeUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
@keyframes slideInLeft {
    0% { opacity: 0; transform: translateX(-40px); }
    100% { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
    0% { opacity: 0; transform: translateX(40px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* FAQ animation */
.faq-item {
    transition: border-color 0.3s ease;
}
.faq-item:hover {
    border-color: rgba(255, 255, 255, 0.1);
}
.faq-icon.rotated {
    transform: rotate(180deg);
}
.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}
.faq-content.open {
    max-height: 200px;
}

/* Selection color */
::selection {
    background: rgba(51, 141, 255, 0.3);
    color: white;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid rgba(51, 141, 255, 0.5);
    outline-offset: 2px;
}

/* Gradient text fallback */
@supports not (background-clip: text) {
    .bg-clip-text {
        color: #338dff;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-grid {
        background-size: 40px 40px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
    .scroll-animate {
        opacity: 1;
    }
    .tagline {
        transition: none !important;
    }
}

/* ===== ROTATING TAGLINES ===== */
.tagline {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.tagline.active {
    position: relative;
    opacity: 1;
    transform: translateY(0);
}
