/* =========================================================
   SpeedtestLab — Modern Glassmorphism Theme (Dark + Light)
   Renk paleti: turkuaz → mavi → mor gradient
   ========================================================= */

:root {
    /* Marka renkleri (her iki modda sabit) */
    --brand-1: #06b6d4;
    --brand-2: #3b82f6;
    --brand-3: #8b5cf6;
    --brand-gradient: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 55%, var(--brand-3) 100%);
    --brand-glow: 0 0 40px rgba(59, 130, 246, 0.35);

    /* Dark mode (default) */
    --bg-0: #0a0f1c;
    --bg-1: #111827;
    --bg-2: #1a2234;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-hover: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.15);
    --text-1: #f8fafc;
    --text-2: #cbd5e1;
    --text-3: #64748b;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --glass-blur: 12px;
}

[data-theme="light"] {
    --bg-0: #f1f5f9;
    --bg-1: #ffffff;
    --bg-2: #f8fafc;
    --surface: rgba(15, 23, 42, 0.03);
    --surface-hover: rgba(15, 23, 42, 0.05);
    --border: rgba(15, 23, 42, 0.08);
    --border-strong: rgba(15, 23, 42, 0.15);
    --text-1: #0f172a;
    --text-2: #334155;
    --text-3: #64748b;
    --shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background:
        radial-gradient(ellipse 80% 60% at 20% 0%, rgba(6, 182, 212, 0.12), transparent 60%),
        radial-gradient(ellipse 80% 60% at 80% 100%, rgba(139, 92, 246, 0.10), transparent 60%),
        var(--bg-0);
    color: var(--text-1);
    min-height: 100vh;
    transition: background 0.4s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

[data-theme="light"] body {
    background:
        radial-gradient(ellipse 80% 60% at 20% 0%, rgba(6, 182, 212, 0.08), transparent 60%),
        radial-gradient(ellipse 80% 60% at 80% 100%, rgba(139, 92, 246, 0.06), transparent 60%),
        var(--bg-0);
}

/* ====================  NAVBAR  ==================== */
.navbar-custom {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    background: color-mix(in srgb, var(--bg-1) 80%, transparent);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}

.logo-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-1);
    transition: opacity 0.2s;
}
.logo-wrapper:hover { opacity: 0.85; color: var(--text-1); }
.logo-wrapper svg { height: 42px; width: auto; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link-custom {
    padding: 8px 14px;
    border-radius: 10px;
    color: var(--text-2);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}
.nav-link-custom:hover {
    background: var(--surface-hover);
    color: var(--text-1);
}
.nav-link-custom.active {
    background: var(--surface);
    color: var(--text-1);
}

/* Theme switcher */
.theme-switch {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.theme-switch:hover {
    background: var(--surface-hover);
    color: var(--text-1);
    border-color: var(--border-strong);
}
.theme-switch .bi { font-size: 18px; }

/* ====================  HERO  ==================== */
.hero {
    padding: 28px 0 16px;
    text-align: center;
}

.hero h1 {
    font-size: clamp(1.75rem, 3.2vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 10px;
    line-height: 1.15;
}
.hero h1 .grad {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero p.lead {
    color: var(--text-2);
    max-width: 620px;
    margin: 0 auto;
    font-size: clamp(0.95rem, 1.5vw, 1.1rem);
}

/* ====================  CARDS  ==================== */
.card-glass {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.card-glass:hover {
    border-color: var(--border-strong);
}

.info-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
}
.info-card .icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(6,182,212,0.15), rgba(139,92,246,0.15));
    color: var(--brand-2);
    font-size: 20px;
    flex-shrink: 0;
}
.info-card .label {
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}
.info-card .value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
    line-height: 1.2;
}
.info-card .sub {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
}

/* ====================  GAUGE BLOCK  ==================== */
.gauge-card {
    padding: 32px 24px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.gauge-card::before {
    content: '';
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08), transparent 50%);
    pointer-events: none;
    z-index: 0;
}
.gauge-card > * { position: relative; z-index: 1; }

.gauge-wrapper {
    position: relative;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}

#gauge {
    display: block;
    width: 100%;
    height: 320px;
}

.gauge-center {
    position: absolute;
    left: 50%;
    top: 62%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    user-select: none;
}

.gauge-phase {
    font-weight: 700;
    letter-spacing: 3px;
    font-size: 11px;
    color: var(--text-3);
    margin-bottom: 6px;
}

.gauge-value {
    font-size: clamp(2.8rem, 7vw, 4.5rem);
    font-weight: 800;
    line-height: 1;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}

.gauge-unit {
    font-size: 0.95rem;
    color: var(--text-3);
    font-weight: 500;
    margin-top: 4px;
}

/* ====================  BUTTONS  ==================== */
.btn-hero {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 42px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
    background: var(--brand-gradient);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(59, 130, 246, 0.5);
    color: #fff;
}
.btn-hero:active { transform: translateY(0); }
.btn-hero:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-ghost {
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-ghost:hover {
    background: var(--surface-hover);
    color: var(--text-1);
    border-color: var(--border-strong);
}

/* ====================  METRIC CARDS  ==================== */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 24px;
}
@media (max-width: 768px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
}

.metric-card {
    padding: 18px 16px;
    text-align: center;
    transition: all 0.3s;
}
.metric-card.active {
    border-color: var(--brand-2);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18), var(--shadow);
    transform: translateY(-3px);
}

.metric-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.metric-icon.ping    { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.metric-icon.jitter  { background: rgba(251, 146, 60, 0.15); color: #fb923c; }
.metric-icon.down    { background: rgba(34, 197, 94, 0.15);  color: #22c55e; }
.metric-icon.up      { background: rgba(6, 182, 212, 0.15);  color: #06b6d4; }

.metric-label {
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.metric-value {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 700;
    color: var(--text-1);
    line-height: 1.1;
    margin: 4px 0 0;
    font-variant-numeric: tabular-nums;
}
.metric-unit {
    font-size: 12px;
    color: var(--text-3);
}

/* ====================  TABLE  ==================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table thead th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-3);
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table tbody td {
    padding: 14px 16px;
    color: var(--text-2);
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.data-table tbody tr:hover td {
    background: var(--surface-hover);
}
.data-table .num {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--text-1);
}
.text-success-soft { color: #22c55e; }
.text-info-soft    { color: #06b6d4; }
.text-warn-soft    { color: #fbbf24; }

/* ====================  CONTENT SECTIONS (SEO)  ==================== */
.content-section {
    padding: 48px 0;
    border-top: 1px solid var(--border);
    margin-top: 48px;
}

.content-section h2 {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
}
.content-section h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 24px 0 8px;
}
.content-section p,
.content-section li {
    color: var(--text-2);
    line-height: 1.7;
    font-size: 15px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 32px;
}
@media (max-width: 768px) {
    .feature-grid { grid-template-columns: 1fr; }
}
.feature-item {
    padding: 24px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
}
.feature-item .bi {
    font-size: 28px;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 10px;
    display: inline-block;
}
.feature-item h3 {
    margin: 4px 0 6px;
    font-size: 1.05rem;
}
.feature-item p {
    font-size: 14px;
    margin: 0;
}

/* Accordion (SSS) */
.faq-item {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    margin-bottom: 10px;
    overflow: hidden;
}
.faq-item summary {
    cursor: pointer;
    padding: 16px 20px;
    font-weight: 600;
    color: var(--text-1);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    font-size: 22px;
    color: var(--text-3);
    transition: transform 0.2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item[open] summary { border-bottom: 1px solid var(--border); }
.faq-item p {
    padding: 14px 20px 18px;
    margin: 0;
    color: var(--text-2);
    font-size: 14px;
    line-height: 1.7;
}

/* ====================  ALERT  ==================== */
.alert-local {
    padding: 14px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(251, 146, 60, 0.08));
    border: 1px solid rgba(251, 191, 36, 0.25);
    color: var(--text-2);
    font-size: 14px;
    margin-bottom: 24px;
}
.alert-local .bi {
    color: #fbbf24;
    margin-right: 6px;
}
.alert-local strong { color: var(--text-1); }

/* ====================  FOOTER  ==================== */
.footer {
    padding: 40px 0 24px;
    margin-top: 60px;
    border-top: 1px solid var(--border);
    color: var(--text-3);
    font-size: 13px;
    text-align: center;
}
.footer a {
    color: var(--text-2);
    text-decoration: none;
    margin: 0 10px;
}
.footer a:hover { color: var(--text-1); }

/* ====================  HELPERS  ==================== */
.text-muted-soft { color: var(--text-3); }
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

/* Bootstrap override: data-theme uyumu */
[data-theme="light"] .alert-local strong,
[data-theme="light"] .alert-local {
    color: #78350f;
}
