/* EnvHub Website - Custom Styles */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ═══════════════════════════════════════════════
 *  PAGE TRANSITION OVERLAY
 * ═══════════════════════════════════════════════ */
.page-transition {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    display: none;           /* hidden when idle — prevents hover interference */
}

.page-transition.is-opening,
.page-transition.is-closing {
    display: flex;           /* only visible during animations */
}

.page-transition .panel {
    flex: 1;
    background: #1E293B;
    transform: scaleY(0);
    transform-origin: bottom;
}

/* Closing animation (runs on page load — panels retract upward) */
.page-transition.is-closing .panel {
    transform: scaleY(1);
    transform-origin: top;
    animation: panelUp 0.6s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

.page-transition.is-closing .panel:nth-child(2) { animation-delay: 0.06s; }
.page-transition.is-closing .panel:nth-child(3) { animation-delay: 0.12s; }
.page-transition.is-closing .panel:nth-child(4) { animation-delay: 0.18s; }
.page-transition.is-closing .panel:nth-child(5) { animation-delay: 0.24s; }

@keyframes panelUp {
    0%   { transform: scaleY(1); }
    100% { transform: scaleY(0); }
}

/* Opening animation (runs on link click — panels grow from bottom) */
.page-transition.is-opening .panel {
    transform: scaleY(0);
    transform-origin: bottom;
    animation: panelDown 0.5s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

.page-transition.is-opening .panel:nth-child(2) { animation-delay: 0.06s; }
.page-transition.is-opening .panel:nth-child(3) { animation-delay: 0.12s; }
.page-transition.is-opening .panel:nth-child(4) { animation-delay: 0.18s; }
.page-transition.is-opening .panel:nth-child(5) { animation-delay: 0.24s; }

@keyframes panelDown {
    0%   { transform: scaleY(0); }
    100% { transform: scaleY(1); }
}

/* ═══════════════════════════════════════════════
 *  ENTRANCE ANIMATIONS (scroll-triggered)
 * ═══════════════════════════════════════════════ */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children inside a reveal group */
[data-stagger] > .animate-on-scroll:nth-child(1)  { transition-delay: 0s; }
[data-stagger] > .animate-on-scroll:nth-child(2)  { transition-delay: 0.08s; }
[data-stagger] > .animate-on-scroll:nth-child(3)  { transition-delay: 0.16s; }
[data-stagger] > .animate-on-scroll:nth-child(4)  { transition-delay: 0.24s; }
[data-stagger] > .animate-on-scroll:nth-child(5)  { transition-delay: 0.32s; }
[data-stagger] > .animate-on-scroll:nth-child(6)  { transition-delay: 0.40s; }
[data-stagger] > .animate-on-scroll:nth-child(7)  { transition-delay: 0.48s; }
[data-stagger] > .animate-on-scroll:nth-child(8)  { transition-delay: 0.56s; }

/* Slide-in variants */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-up.visible,
.reveal-left.visible,
.reveal-right.visible,
.reveal-scale.visible {
    opacity: 1;
    transform: none;
}

/* ═══════════════════════════════════════════════
 *  GRADIENT TEXT
 * ═══════════════════════════════════════════════ */
.gradient-text {
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animated flowing gradient */
.gradient-text-animated {
    background: linear-gradient(90deg, #3B82F6, #8B5CF6, #EC4899, #8B5CF6, #3B82F6);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-flow 6s ease infinite;
}

@keyframes gradient-flow {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Shimmer highlight effect on gradient text */
.gradient-text-shimmer {
    background: linear-gradient(
        110deg,
        #3B82F6 0%,
        #8B5CF6 30%,
        #f0f0f0 50%,
        #8B5CF6 70%,
        #3B82F6 100%
    );
    background-size: 250% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* Striped pattern for environment bars */
.env-stripes {
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.1) 10px,
        rgba(255, 255, 255, 0.1) 20px
    );
}

/* Neon glow effect */
.neon-glow {
    box-shadow: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 30px currentColor;
}

/* Hover card effect */
.hover-card {
    transition: all 0.3s ease;
}

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

/* Button hover effects */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:hover::after {
    width: 300px;
    height: 300px;
}

/* Ribbon corner effect */
.ribbon {
    position: absolute;
    top: 0;
    right: 0;
    width: 75px;
    height: 75px;
    overflow: hidden;
}

.ribbon-text {
    position: absolute;
    top: 18px;
    right: -25px;
    width: 100px;
    padding: 4px 0;
    text-align: center;
    transform: rotate(45deg);
    font-size: 10px;
    font-weight: bold;
    color: white;
}

/* Feature card icons */
.feature-icon {
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

/* Navigation scroll effect */
.nav-scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Mobile menu animation */
.mobile-menu-enter {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Comparison table styles */
.comparison-table th,
.comparison-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.comparison-table tr:hover {
    background: #f8fafc;
}

/* FAQ accordion */
.faq-item {
    border-bottom: 1px solid #e2e8f0;
}

.faq-question {
    cursor: pointer;
    transition: color 0.2s ease;
}

.faq-question:hover {
    color: #3B82F6;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Pulse animation for production warning dot */
.pulse-dot {
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Environment color utilities */
.env-local { background-color: #22C55E; }
.env-dev { background-color: #3B82F6; }
.env-staging { background-color: #8B5CF6; }
.env-qa { background-color: #14B8A6; }
.env-uat { background-color: #F97316; }
.env-prod { background-color: #EF4444; }

/* Browser mockup styling */
.browser-mockup {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.browser-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
}

.browser-dots {
    display: flex;
    gap: 6px;
}

.browser-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.browser-dot.red { background: #ef4444; }
.browser-dot.yellow { background: #fbbf24; }
.browser-dot.green { background: #22c55e; }

/* Responsive utilities */
@media (max-width: 768px) {
    .hero-headline {
        font-size: 2.5rem;
    }
    
    .section-padding {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
}

/* Print styles */
@media print {
    nav, footer, .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        color: black;
        background: white;
    }
}

/* Focus styles for accessibility */
a:focus,
button:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* ═══════════════════════════════════════════════
 *  APPLE-STYLE: SCROLL TEXT COLOR REVEAL
 *  Words start gray, fill to dark as you scroll
 * ═══════════════════════════════════════════════ */
.text-reveal-scroll .word {
    color: #d1d5db;
    transition: color 0.35s ease;
}
.text-reveal-scroll .word.revealed {
    color: #1e293b;
}
/* On dark backgrounds use white reveal */
.dark .text-reveal-scroll .word,
[class*="from-slate-900"] .text-reveal-scroll .word,
.bg-dark-section .text-reveal-scroll .word {
    color: #475569;
}
.dark .text-reveal-scroll .word.revealed,
[class*="from-slate-900"] .text-reveal-scroll .word.revealed,
.bg-dark-section .text-reveal-scroll .word.revealed {
    color: #ffffff;
}

/* ═══════════════════════════════════════════════
 *  APPLE-STYLE: BIG STAT CALLOUTS
 * ═══════════════════════════════════════════════ */
.stat-number {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-label {
    font-size: 1.125rem;
    color: #6b7280;
    margin-top: 0.5rem;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════
 *  APPLE-STYLE: BENTO GRID
 * ═══════════════════════════════════════════════ */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(200px, auto);
    gap: 1rem;
}
.bento-grid .bento-wide {
    grid-column: span 2;
}
.bento-grid .bento-tall {
    grid-row: span 2;
}
@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .bento-grid .bento-wide {
        grid-column: span 1;
    }
    .bento-grid .bento-tall {
        grid-row: span 1;
    }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ─── Extension Showcase (3-up Apple-style) ─── */
.showcase-trio {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2rem;
    perspective: 1200px;
}
.showcase-card {
    flex-shrink: 0;
}
.showcase-card-center {
    z-index: 2;
    transform: translateY(-1rem);
}
.showcase-card-side {
    z-index: 1;
}
.showcase-card-left {
    transform: rotateY(8deg) scale(0.92);
    transform-origin: right center;
}
.showcase-card-right {
    transform: rotateY(-8deg) scale(0.92);
    transform-origin: left center;
}
/* Hover lift */
.showcase-card:hover {
    transform: translateY(-0.5rem) scale(1);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.showcase-card-center:hover {
    transform: translateY(-1.5rem) scale(1.02);
}
/* Responsive: stack on mobile */
@media (max-width: 768px) {
    .showcase-trio {
        flex-direction: column;
        align-items: center;
        gap: 2.5rem;
        perspective: none;
    }
    .showcase-card-left,
    .showcase-card-right {
        transform: none;
    }
    .showcase-card-center {
        transform: none;
        order: -1;
    }
}

/* ═══════════════════════════════════════════════
 *  APPLE-STYLE: HORIZONTAL SCROLL MARQUEE
 * ═══════════════════════════════════════════════ */
.marquee-track {
    display: flex;
    gap: 1.5rem;
    animation: marquee-scroll 40s linear infinite;
    width: max-content;
}
.marquee-track:hover {
    animation-play-state: paused;
}
@keyframes marquee-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ═══════════════════════════════════════════════
 *  APPLE-STYLE: SECTION DOT NAV (side progress)
 * ═══════════════════════════════════════════════ */
.section-dots {
    position: fixed;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.section-dots.visible {
    opacity: 1;
}
.section-dots a {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    transition: all 0.3s ease;
    position: relative;
}
.section-dots a.active {
    background: #3B82F6;
    transform: scale(1.4);
}
.section-dots a .dot-label {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    background: white;
    padding: 2px 8px;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.section-dots a:hover .dot-label {
    opacity: 1;
}
@media (max-width: 1024px) {
    .section-dots { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
