/* =========================================================
   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;
}

/* ====================  PHASE DOTS  ==================== */
.phase-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 20px auto 0;
    max-width: 520px;
    flex-wrap: wrap;
}
.phase-dots .dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 60px;
    color: var(--text-3);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s;
}
.phase-dots .dot::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--border-strong);
    transition: all 0.35s cubic-bezier(.2,.8,.2,1);
}
.phase-dots .dot.active::before {
    background: var(--brand-gradient);
    border-color: transparent;
    width: 14px;
    height: 14px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2), 0 0 24px rgba(59, 130, 246, 0.6);
    animation: phase-pulse 1.4s ease-in-out infinite;
}
.phase-dots .dot.done::before {
    background: #22c55e;
    border-color: transparent;
}
.phase-dots .dot.active,
.phase-dots .dot.done { color: var(--text-1); }

.phase-dots .connector {
    flex-grow: 1;
    max-width: 40px;
    height: 2px;
    background: var(--border);
    position: relative;
    overflow: hidden;
}
.phase-dots .connector.filled {
    background: var(--brand-gradient);
}

@keyframes phase-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.15); }
}

/* ====================  BUTTON RIPPLE + PULSE  ==================== */
.btn-hero { position: relative; overflow: hidden; }
.btn-hero .ripple-container { position: absolute; inset: 0; pointer-events: none; }
.btn-hero .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: ripple-expand 0.7s ease-out forwards;
    pointer-events: none;
}
@keyframes ripple-expand {
    to { transform: scale(4); opacity: 0; }
}

/* Test aktifken BAŞLAT butonu gizli ama DURDUR yanıp sönen pulse */
body.test-running .btn-ghost.d-none ~ .btn-hero { display: none; }
body.test-running #btn-abort {
    animation: pulse-border 1.4s ease-in-out infinite;
}
@keyframes pulse-border {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.25); }
    50%      { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* ====================  METRIC CARD ACTIVE SHIMMER  ==================== */
.metric-card.active {
    position: relative;
    overflow: hidden;
}
.metric-card.active::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        110deg,
        transparent 30%,
        rgba(59, 130, 246, 0.15) 50%,
        transparent 70%
    );
    animation: shimmer 2s ease-in-out infinite;
    pointer-events: none;
}
@keyframes shimmer {
    from { left: -100%; }
    to   { left: 100%; }
}

.metric-card.active .metric-value {
    animation: value-glow 2s ease-in-out infinite;
}
@keyframes value-glow {
    0%, 100% { text-shadow: 0 0 0 transparent; }
    50%      { text-shadow: 0 0 20px rgba(59, 130, 246, 0.55); }
}

/* ====================  GAUGE VALUE FLASH (test bitiminde)  ==================== */
body.test-done .gauge-value {
    animation: done-flash 0.9s cubic-bezier(.2,.8,.2,1);
}
@keyframes done-flash {
    0%   { transform: scale(1);    filter: brightness(1); }
    30%  { transform: scale(1.08); filter: brightness(1.5); }
    100% { transform: scale(1);    filter: brightness(1); }
}

/* Gauge card arka plan — test aktifken hafif glow */
body.test-running .gauge-card {
    box-shadow:
        0 0 0 1px rgba(59, 130, 246, 0.25),
        0 0 60px rgba(59, 130, 246, 0.15);
    transition: box-shadow 0.4s;
}

/* ====================  SERVER PICKER  ==================== */
.server-card {
    cursor: pointer;
    transition: all 0.2s;
}
.server-card:hover {
    border-color: var(--brand-2);
    transform: translateY(-2px);
}

.server-change-hint {
    font-size: 10px;
    color: var(--text-3);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.7;
}
.server-card:hover .server-change-hint { opacity: 1; color: var(--brand-2); }

.server-picker {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.server-picker-panel {
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-1) !important;
    border: 1px solid var(--border-strong) !important;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.server-picker-head {
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
}
.btn-close-picker {
    width: 32px; height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-close-picker:hover { background: var(--surface-hover); color: var(--text-1); }

.server-picker-list {
    overflow-y: auto;
    padding: 8px;
}

.server-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
}
.server-row:hover {
    background: var(--surface-hover);
}
.server-row.selected {
    background: rgba(59, 130, 246, 0.12);
    border-color: var(--brand-2);
}
.server-row.inactive {
    opacity: 0.45;
    cursor: not-allowed;
}

.server-row-flag {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.5px;
    color: var(--text-2);
    flex-shrink: 0;
}
.server-row-info {
    flex-grow: 1;
    min-width: 0;
}
.server-row-name {
    font-weight: 600;
    color: var(--text-1);
    font-size: 14px;
}
.server-row-sub {
    font-size: 12px;
    color: var(--text-3);
}
.server-row-dist {
    font-size: 12px;
    color: var(--brand-2);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.server-row.inactive .server-row-dist {
    color: var(--text-3);
}

.server-group-head {
    padding: 10px 14px 4px;
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

/* ====================  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); }

/* ------- İmza bloğu ------- */
.footer-copy {
    font-size: 13px;
    color: var(--text-3);
}

.footer-signature {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 12.5px;
    color: var(--text-3);
    flex-wrap: wrap;
    max-width: 100%;
}

.fs-brand {
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--text-2);
}
.fs-suffix {
    font-weight: 500;
    color: var(--text-3);
    font-size: 0.85em;
    margin-left: 2px;
    letter-spacing: 0.3px;
}

.fs-sep {
    color: var(--text-3);
    opacity: 0.6;
}

.fs-code {
    color: var(--text-3);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}
.fs-code .bi {
    font-size: 13px;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Yazar linki: gradient metin, hover'da altçizgi + glow */
.fs-author {
    position: relative;
    margin: 0;
    padding: 2px 0;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-decoration: none;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: filter 0.2s ease, transform 0.2s ease;
}
.fs-author::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: var(--brand-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(.2,.8,.2,1);
    border-radius: 2px;
}
.fs-author:hover {
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
    transform: translateY(-1px);
}
.fs-author:hover::after { transform: scaleX(1); }

/* Light mode: brand ismi biraz daha koyu olsun */
[data-theme="light"] .fs-brand { color: var(--text-1); }
[data-theme="light"] .footer-signature { border-top-color: rgba(15, 23, 42, 0.1); }

/* Mobilde daha kompakt imza */
@media (max-width: 640px) {
    .footer-signature {
        font-size: 11.5px;
        gap: 6px;
        padding-top: 14px;
        margin-top: 14px;
    }
    .fs-sep { display: none; }
}

/* ====================  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;
}

/* ==========================================================
   MOBİL & RESPONSIVE
   ========================================================== */

/* Tablet (≤992 px) */
@media (max-width: 992px) {
    .gauge-card { padding: 24px 16px 20px; }
    #gauge { height: 280px; }
    .nav-link-custom span { display: inline; }
}

/* Mobil (≤640 px) */
@media (max-width: 640px) {
    .hero { padding: 18px 0 8px; }
    .hero h1 { font-size: 1.55rem; line-height: 1.2; }
    .hero p.lead { font-size: 0.9rem; }

    .gauge-card { padding: 18px 10px 16px; border-radius: 16px; }
    #gauge { height: 230px; }
    .gauge-value { font-size: 2.6rem; letter-spacing: -0.02em; }
    .gauge-center { top: 62%; }
    .gauge-phase { font-size: 10px; letter-spacing: 2px; }
    .gauge-unit { font-size: 0.82rem; }

    /* Phase dots kompakt */
    .phase-dots { gap: 4px; margin-top: 14px; }
    .phase-dots .dot { min-width: 52px; font-size: 9px; letter-spacing: 0.3px; }
    .phase-dots .dot::before { width: 8px; height: 8px; }
    .phase-dots .dot.active::before {
        width: 11px; height: 11px;
        box-shadow: 0 0 0 3px rgba(59,130,246,0.2), 0 0 16px rgba(59,130,246,0.5);
    }
    .phase-dots .connector { max-width: 20px; }

    /* Start button */
    .btn-hero { padding: 12px 28px; font-size: 13px; letter-spacing: 0.5px; }

    /* Metrik kartları */
    .metric-grid { gap: 10px; margin-top: 18px; }
    .metric-card { padding: 14px 8px; }
    .metric-icon { width: 34px; height: 34px; font-size: 17px; margin-bottom: 6px; border-radius: 10px; }
    .metric-label { font-size: 10px; }
    .metric-value { font-size: 1.35rem; }
    .metric-unit { font-size: 11px; }

    /* Info kartları */
    .info-card { padding: 12px 12px; gap: 10px; }
    .info-card .icon { width: 36px; height: 36px; font-size: 15px; border-radius: 10px; }
    .info-card .label { font-size: 10px; }
    .info-card .value { font-size: 13px; }
    .info-card .sub { font-size: 11px; }

    /* İçerik & SSS */
    .content-section { padding: 32px 0; margin-top: 32px; }
    .content-section h2 { font-size: 1.3rem; }
    .content-section h3 { font-size: 1rem; }
    .feature-item { padding: 18px; }
    .faq-item summary { padding: 14px 16px; font-size: 13.5px; }
    .faq-item p { padding: 12px 16px 14px; font-size: 13px; }

    /* Server picker */
    .server-picker-panel { max-width: 100%; max-height: 90vh; border-radius: 16px; }
    .server-picker-head { padding: 14px 16px; }

    /* Navbar */
    .navbar-custom { padding: 10px 0; }
    .logo-wrapper svg { height: 34px; }
    .nav-links { gap: 2px; }
    .nav-link-custom { padding: 6px 10px; font-size: 12px; }
    .nav-link-custom i { margin-right: 2px; }
    .theme-switch { width: 34px; height: 34px; }

    /* Tablo */
    .data-table thead th { padding: 10px 8px; font-size: 10px; }
    .data-table tbody td { padding: 10px 8px; font-size: 12px; }

    /* Uyarı kutuları */
    .alert-local { padding: 12px 14px; font-size: 13px; }
}

/* Çok küçük mobil (≤400 px) */
@media (max-width: 400px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .gauge-value { font-size: 2.2rem; }
    #gauge { height: 210px; }
    .btn-hero { width: 100%; justify-content: center; }
    .phase-dots .connector { display: none; }
    .phase-dots { gap: 12px; flex-wrap: wrap; }
    .logo-wrapper svg { height: 30px; }
}

/* ==========================================================
   LIGHT MODE — Gauge & kartlar için ek kontrast
   ========================================================== */

[data-theme="light"] .gauge-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .gauge-card::before {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.10), transparent 55%);
}

/* Light mode'da gauge phase/unit daha okunaklı */
[data-theme="light"] .gauge-phase { color: rgba(15, 23, 42, 0.55); }
[data-theme="light"] .gauge-unit  { color: rgba(15, 23, 42, 0.50); }

/* Test aktifken light mode'da daha güçlü glow */
[data-theme="light"] body.test-running .gauge-card {
    box-shadow:
        0 0 0 1px rgba(59, 130, 246, 0.3),
        0 8px 50px rgba(59, 130, 246, 0.18);
}

/* Light mode phase dots */
[data-theme="light"] .phase-dots .dot::before {
    background: rgba(15, 23, 42, 0.06);
    border-color: rgba(15, 23, 42, 0.18);
}

/* Light mode kartlar — hafif gölge ile derinlik */
[data-theme="light"] .metric-card,
[data-theme="light"] .info-card,
[data-theme="light"] .card-glass {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
[data-theme="light"] .metric-card:hover,
[data-theme="light"] .info-card:hover {
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

/* Light mode info card icon arka planı daha soft */
[data-theme="light"] .info-card .icon {
    background: linear-gradient(135deg, rgba(6,182,212,0.12), rgba(139,92,246,0.12));
}

/* Light mode metric card ikonları */
[data-theme="light"] .metric-icon.ping   { background: rgba(251, 191, 36, 0.12); }
[data-theme="light"] .metric-icon.jitter { background: rgba(251, 146, 60, 0.12); }
[data-theme="light"] .metric-icon.down   { background: rgba(34, 197, 94, 0.12); }
[data-theme="light"] .metric-icon.up     { background: rgba(6, 182, 212, 0.12); }

/* Light mode gauge value shadow */
[data-theme="light"] .gauge-value {
    text-shadow: 0 2px 20px rgba(59, 130, 246, 0.15);
}

/* Light mode tablo satır hover */
[data-theme="light"] .data-table tbody tr:hover td {
    background: rgba(59, 130, 246, 0.04);
}

/* Light mode SSS açık panel */
[data-theme="light"] .faq-item {
    background: #ffffff;
}
