/* ============================================================
   CFCloud Demo – Stylesheet
   ============================================================ */

:root {
    --ink: #111;
    --ink-soft: #333;
    --ink-muted: #666;
    --surface: #f7f6f3;
    --surface-warm: #efeee9;
    --surface-card: #fff;
    --accent: #2558d4;
    --accent-dark: #1c47b0;
    --accent-light: #eef3ff;
    --green: #1a7f37;
    --green-light: #ddf4e4;
    --red: #c33;
    --red-light: #fff0f0;
    --yellow: #b45309;
    --yellow-light: #fef3c7;
    --border: #ddd;
    --border-light: #eee;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.07);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.1);
    --transition: all 0.2s ease;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--surface);
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
.container { max-width: 1100px; margin: 0 auto; padding: 0 28px; }


/* ========================
   HEADER
   ======================== */
.site-header {
    background: #0f1729;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 1rem 0;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.25rem; color: #fff; }
.logo-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; background: var(--accent); color: #fff;
    font-size: 0.72rem; font-weight: 800; border-radius: 7px;
}
.logo-demo { font-weight: 400; color: #6b7280; margin-left: 4px; }
.header-links { display: flex; align-items: center; gap: 1.8rem; }
.header-links a { color: #9ca3af; font-size: 0.9rem; font-weight: 500; }
.header-links a:hover { color: #fff; }
.header-links .btn-sm {
    padding: 0.5rem 1.2rem; background: var(--accent); color: #fff;
    border-radius: var(--radius); font-weight: 700; font-size: 0.88rem;
}
.header-links .btn-sm:hover { background: var(--accent-dark); }


/* ========================
   HERO
   ======================== */
.hero {
    background: #0f1729;
    padding: 4rem 0 4.5rem;
    text-align: center;
}
.hero h1 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: #f0f0f0;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}
.hero-subtitle {
    color: #9ca3af;
    font-size: 1.15rem;
    max-width: 620px;
    margin: 0 auto 2.5rem;
    line-height: 1.75;
}
.hero-subtitle strong { color: #ddd; }

.hero-stats {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}
.hero-stat {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 1.2rem 2rem;
    min-width: 150px;
}
.hero-stat-num {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
    color: #7ba4ea;
    line-height: 1;
    margin-bottom: 0.3rem;
}
.hero-stat-label {
    font-size: 0.82rem;
    color: #6b7280;
    font-weight: 500;
}


/* ========================
   HOW TO USE
   ======================== */
.how-to-use {
    background: var(--surface-card);
    border-bottom: 1px solid var(--border);
    padding: 3.5rem 0;
}
.section-heading {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.4rem;
}
.section-sub {
    text-align: center;
    color: var(--ink-muted);
    font-size: 1rem;
    margin-bottom: 2.5rem;
}
.steps-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.step-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    position: relative;
}
.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    background: var(--ink); color: #fff;
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.2rem; font-weight: 700;
    border-radius: 50%;
    margin-bottom: 1rem;
}
.step-card h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.step-card p {
    font-size: 0.9rem;
    color: var(--ink-muted);
    line-height: 1.6;
    margin-bottom: 0;
}

/* Credentials */
.cred-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}
.cred-copy-btn {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.4rem 0.8rem; background: var(--accent); color: #fff;
    border: none; border-radius: 7px;
    font-family: 'DM Sans', monospace; font-size: 0.9rem; font-weight: 700;
    cursor: pointer; transition: var(--transition);
}
.cred-copy-btn:hover { background: var(--accent-dark); transform: scale(1.03); }
.cred-copy-btn.copied { background: var(--green); }
.cred-divider { color: var(--ink-muted); font-size: 0.85rem; font-weight: 600; }

.step-link {
    display: inline-flex; align-items: center; gap: 0.3rem;
    margin-top: 1rem;
    padding: 0.55rem 1.2rem;
    background: var(--accent); color: #fff;
    border-radius: var(--radius);
    font-weight: 700; font-size: 0.9rem;
}
.step-link:hover { background: var(--accent-dark); }


/* ========================
   DASHBOARDS
   ======================== */
.dashboards-section { padding: 3rem 0 1rem; }
.dashboards-section h2 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
}
.dashboards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}
.dash-card {
    display: flex; flex-direction: column; align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: var(--transition);
}
.dash-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.dash-icon {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-light); color: var(--accent);
    border-radius: 12px;
}
.dash-icon svg { width: 22px; height: 22px; }
.dash-name { font-weight: 700; font-size: 0.95rem; color: var(--ink); }
.dash-desc { font-size: 0.82rem; color: var(--ink-muted); }


/* ========================
   AUTO DEMO
   ======================== */
.auto-demo-section { padding: 0 0 2.5rem; }
.auto-demo-bar {
    background: var(--surface-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.8rem 2rem;
    display: flex; align-items: center;
    justify-content: space-between;
    gap: 1.5rem; flex-wrap: wrap;
}
.auto-demo-bar.active { border-color: var(--green); background: #f8fdf9; }
.auto-demo-info h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.05rem; font-weight: 700;
    margin-bottom: 0.2rem;
}
.auto-demo-info p { font-size: 0.9rem; color: var(--ink-muted); margin: 0; }

.auto-demo-progress { margin-top: 0.8rem; display: none; }
.auto-demo-bar.active .auto-demo-progress { display: block; }
.progress-bar-outer {
    width: 100%; height: 6px;
    background: var(--border);
    border-radius: 3px; overflow: hidden;
}
.progress-bar-inner {
    height: 100%;
    background: var(--green);
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}
.auto-demo-status {
    font-size: 0.85rem; color: var(--ink);
    min-height: 20px; margin-top: 0.5rem; font-weight: 500;
}
.auto-demo-status .status-running { color: var(--green); font-weight: 700; }
.auto-demo-status .status-count {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-light); color: var(--accent);
    font-weight: 700; font-size: 0.78rem;
    padding: 0.15rem 0.55rem; border-radius: 100px; margin-left: 0.5rem;
}

.auto-demo-toggle {
    padding: 0.75rem 2rem;
    background: var(--accent); color: #fff;
    border: none; border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif;
    font-weight: 700; font-size: 1rem;
    cursor: pointer; transition: var(--transition);
    display: flex; align-items: center; gap: 0.5rem;
    white-space: nowrap;
}
.auto-demo-toggle:hover { background: var(--accent-dark); }
.auto-demo-toggle.running { background: var(--red); }
.auto-demo-toggle.running:hover { background: #a22; }


/* ========================
   TEST SCENARIOS
   ======================== */
.tests-section { padding: 0 0 3rem; }
.tests-section h2 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.5rem; font-weight: 600;
    margin-bottom: 0.3rem;
}
.tests-section > .container > p {
    font-size: 0.95rem; color: var(--ink-muted);
    margin-bottom: 2rem;
}

.test-group-label {
    font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--ink-muted);
    margin-bottom: 0.8rem;
    padding-left: 0.2rem;
}
.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2.5rem;
}

.test-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.8rem;
    transition: var(--transition);
    display: flex; flex-direction: column;
}
.test-card:hover { box-shadow: var(--shadow-md); border-color: #ccc; }
.test-card-header { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.8rem; }

.test-icon {
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px; flex-shrink: 0;
}
.test-icon svg { width: 20px; height: 20px; }
.test-icon.fire { background: #fef2f2; color: #dc2626; }
.test-icon.mem { background: #fef3c7; color: #b45309; }
.test-icon.slow { background: #f0fdf4; color: var(--green); }
.test-icon.thread { background: #eef3ff; color: var(--accent); }
.test-icon.err { background: #fef2f2; color: #dc2626; }
.test-icon.log { background: #f3f1ed; color: #555; }
.test-icon.load { background: #fef3c7; color: #b45309; }

.test-card h3 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700; font-size: 1.05rem;
}
.test-desc {
    font-size: 0.92rem; color: var(--ink-soft);
    margin-bottom: 1rem; line-height: 1.6;
    flex-grow: 1;
}
.test-impact {
    background: var(--surface);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem; color: var(--ink); line-height: 1.55;
}
.test-impact strong {
    display: block;
    font-size: 0.72rem; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--ink-muted);
    margin-bottom: 0.25rem;
}
.test-dashboard-link {
    display: inline-block;
    font-size: 0.85rem; color: var(--accent); font-weight: 600;
    margin-bottom: 1rem;
}
.test-dashboard-link:hover { text-decoration: underline; }

.test-btn {
    display: block; width: 100%;
    padding: 0.75rem;
    background: var(--ink); color: #fff;
    border: none; border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif;
    font-weight: 700; font-size: 0.92rem;
    cursor: pointer; transition: var(--transition);
    text-align: center;
}
.test-btn:hover { background: #333; }
.test-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.test-btn.executing { background: var(--yellow); color: #fff; cursor: wait; }
.test-btn.success { background: var(--green); }
.test-btn.error { background: var(--red); }

.test-metric { margin-top: 0.6rem; font-size: 0.78rem; color: var(--ink-muted); }
.test-metric code {
    font-family: 'DM Sans', monospace; font-size: 0.76rem;
    background: var(--surface); padding: 0.15rem 0.4rem; border-radius: 4px;
}


/* ========================
   FOOTER
   ======================== */
.site-footer {
    background: #0f1729;
    padding: 3rem 0;
    text-align: center;
}
.site-footer p { color: #6b7280; font-size: 0.9rem; margin: 0.4rem 0; }
.site-footer a { color: #7ba4ea; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer strong { color: #ddd; }


/* ========================
   TOAST NOTIFICATIONS
   ======================== */
.toast {
    position: fixed; top: 24px; right: 24px;
    padding: 1rem 1.4rem;
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transform: translateX(450px);
    transition: transform 0.3s ease;
    z-index: 1000;
    max-width: 360px;
    font-size: 0.9rem; line-height: 1.5;
}
.toast.show { transform: translateX(0); }
.toast.success { border-left: 4px solid var(--green); }
.toast.error { border-left: 4px solid var(--red); }
.toast.info { border-left: 4px solid var(--accent); }
.toast.warning { border-left: 4px solid var(--yellow); }


/* ========================
   SPINNER
   ======================== */
.spinner {
    display: inline-block; width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%; border-top-color: #fff;
    animation: spin 0.6s linear infinite;
    margin-left: 6px; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ========================
   RESPONSIVE
   ======================== */
@media (max-width: 768px) {
    .header-links { display: none; }
    .steps-row { grid-template-columns: 1fr; }
    .dashboards-grid { grid-template-columns: 1fr 1fr; }
    .test-grid { grid-template-columns: 1fr; }
    .auto-demo-bar { flex-direction: column; align-items: flex-start; }
    .hero { padding: 3rem 0; }
    .hero h1 { font-size: 1.8rem; }
    .hero-stats { gap: 0.75rem; }
    .hero-stat { padding: 1rem 1.2rem; min-width: 120px; }
}

@media (max-width: 480px) {
    .dashboards-grid { grid-template-columns: 1fr; }
    .container { padding: 0 18px; }
}
