/* ==========================================================================
   QCS Website - Apple-Inspired Theme
   ========================================================================== */

/* ---- Base ---- */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #ffffff;
    color: #1d1d1f;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

/* ---- Apple Blur Nav ---- */
.apple-blur {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

/* ---- Hero Gradient ---- */
.hero-gradient { background: radial-gradient(circle at center, #fbfbfb 0%, #ffffff 100%); }

/* ---- Card Shadows ---- */
.card-shadow {
    box-shadow: 0 4px 24px rgba(0,0,0,0.04);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-shadow:hover {
    box-shadow: 0 12px 48px rgba(0,0,0,0.08);
    transform: translateY(-4px);
}

/* ---- Reveal Animation ---- */
@keyframes reveal {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.reveal { animation: reveal 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.reveal-ready { opacity: 0; }

/* ---- Stat Cards (Variance/Cycle Time) ---- */
.stat-card {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid #e5e7eb;
    border-radius: 2rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.stat-card:hover { box-shadow: 0 12px 48px rgba(0,0,0,0.06); transform: translateY(-2px); }
.stat-value { font-size: 3rem; font-weight: 700; letter-spacing: -0.02em; color: #1d1d1f; }
.stat-unit { font-size: 1rem; font-weight: 400; color: #6b7280; }
.stat-pulse {
    display: inline-block; width: 8px; height: 8px;
    background-color: #22c55e; border-radius: 50%;
    animation: pulse 2s infinite; margin-right: 6px; vertical-align: middle;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ---- Mobile Nav ---- */
.mobile-nav-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 40;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.mobile-nav-overlay.active { opacity: 1; pointer-events: auto; }
.mobile-nav-panel {
    position: fixed; top: 0; right: -100%; width: 300px; height: 100%;
    background: white; z-index: 50; transition: right 0.3s ease;
    overflow-y: auto; padding: 2rem 1.5rem;
}
.mobile-nav-panel.active { right: 0; }

/* ---- Nav Dropdown ---- */
.nav-dropdown { position: relative; }
.nav-dropdown::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 10px;
}
.nav-dropdown-menu {
    position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(6px);
    background: white; border: 1px solid #f3f4f6; border-radius: 1rem;
    box-shadow: 0 12px 48px rgba(0,0,0,0.08); padding: 0.75rem 0;
    min-width: 240px; z-index: 60; margin-top: 0.25rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
    transition-delay: 0s;
}
.nav-dropdown-menu a {
    display: block; padding: 0.5rem 1.25rem; font-size: 0.8rem;
    color: #6b7280; transition: all 0.2s; text-decoration: none;
}
.nav-dropdown-menu a:hover { color: #2563eb; background: #f9fafb; }
.nav-dropdown-divider { height: 1px; background: #f3f4f6; margin: 0.25rem 0; }

/* ---- Feature Grid ---- */
.feature-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem;
}
.feature-item-row { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.5rem 0; }

/* ---- Scroll to top ---- */
.scroll-top-btn {
    position: fixed; bottom: 2rem; right: 2rem; width: 40px; height: 40px;
    border-radius: 50%; background: rgba(0,0,0,0.6); color: white;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    opacity: 0; transform: translateY(10px); transition: all 0.3s ease;
    z-index: 30; border: none;
}
.scroll-top-btn.visible { opacity: 1; transform: translateY(0); }
.scroll-top-btn:hover { background: rgba(0,0,0,0.8); }

/* ---- Expand Sections ---- */
.expand-section {
    overflow: hidden; max-height: 0;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.expand-section.open { max-height: 5000px; }

/* ---- Blazor Error UI ---- */
#blazor-error-ui { display: none; }

@media print { nav, .scroll-top-btn { display: none !important; } }
@media (max-width: 768px) {
    .stat-value { font-size: 2rem; }
    .mobile-nav-panel { width: 280px; }
}
