/* 
  FGC Lag Tester - Big Tech Aesthetic 
  Dark Mode: #121212
  Font: 'Inter'
*/

:root {
    --bg-color: #121212;
    --surface-color: #1E1E1E;
    --surface-hover: #2C2C2C;
    --text-primary: #FFFFFF;
    --text-secondary: #AAAAAA;
    --accent-color: #0A84FF;
    /* Apple Blue-ish */
    --success-color: #30D158;
    /* Apple Green */
    --warning-color: #FFD60A;
    --danger-color: #FF453A;
    /* Apple Red */

    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.25);

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* -- Typography -- */
h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
}

p {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 1rem;
}

/* -- Layout Containers -- */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* -- Views (Hidden by default) -- */
.view {
    display: none;
    width: 100%;
    animation: fadeIn 0.4s ease-out;
}

.view.active {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* -- Landing Page -- */
.landing-hero {
    text-align: center;
    max-width: 800px;
    position: relative;
    z-index: 2;
    margin: 0 auto;
}

.landing-hero h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #FFFFFF 0%, #AAAAAA 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.landing-hero .badge-pill {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.landing-hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

/* Feature Grid for Landing */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 4rem;
    text-align: left;
}

.feature-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.2s;
}

.feature-item:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.05);
}

.feature-icon {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: block;
}

.feature-title {
    font-weight: 600;
    color: #FFF;
    margin-bottom: 0.5rem;
    display: block;
}

.feature-desc {
    font-size: 0.9rem;
    color: #888;
    line-height: 1.4;
}

/* Background Glow Effect */
.bg-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(10, 132, 255, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
    z-index: 1;
}

.btn-cta {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.1s, filter 0.2s;
    margin-top: 0;
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.4);
}

.btn-cta:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.btn-cta:active {
    transform: scale(0.98);
}

/* -- Role Selection Cards -- */
.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.role-card {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.role-card:hover {
    background: var(--surface-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-soft);
}

.role-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.role-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.role-badge.host {
    background: rgba(10, 132, 255, 0.2);
    color: var(--accent-color);
}

.role-badge.player {
    background: rgba(48, 209, 88, 0.2);
    color: var(--success-color);
}


/* -- Dashboard (Host) -- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
    width: 100%;
    height: 100%;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.status-panel {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.player-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #444;
    margin-right: 0.75rem;
    transition: background 0.3s;
}

.dot.online {
    background: var(--success-color);
    box-shadow: 0 0 8px var(--success-color);
}

.net-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 600;
    text-transform: uppercase;
    background: #333;
    color: #888;
}

.net-badge.wifi {
    background: rgba(10, 132, 255, 0.2);
    color: var(--accent-color);
}

.net-badge.cellular {
    background: rgba(255, 69, 58, 0.2);
    color: var(--danger-color);
}

.net-badge.ethernet {
    background: rgba(48, 209, 88, 0.2);
    color: var(--success-color);
}

/* -- Dashboard Layout -- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    /* Main content + Sidebar */
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* -- Panels -- */
.panel {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1.5rem;
}

/* Verdict Panel */
.verdict-panel {
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, var(--surface-color) 0%, #1a1a1a 100%);
    padding: 2rem;
}

.verdict-status {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.verdict-status.stable {
    color: var(--success-color);
}

.verdict-status.warning {
    color: var(--warning-color);
}

.verdict-status.danger {
    color: var(--danger-color);
}

/* Info Guide */
.info-guide {
    background: rgba(10, 132, 255, 0.1);
    border-left: 4px solid var(--accent-color);
    padding: 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.6;
}

/* -- Log Panel -- */
.log-panel {
    padding: 1rem;
}

.log-container {
    height: 300px;
    overflow-y: auto;
    background: #000;
    /* Terminal look */
    border-radius: 8px;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.log-entry {
    margin-bottom: 6px;
    border-bottom: 1px solid #1a1a1a;
    padding-bottom: 4px;
}

.log-entry .time {
    color: #555;
    margin-right: 6px;
}

.log-entry.spike {
    color: var(--warning-color);
}

.log-entry.loss {
    color: var(--danger-color);
    font-weight: bold;
}

.log-entry.jitter {
    color: #FFD700;
}

.log-entry.system {
    color: #888;
    font-style: italic;
}

/* Scrollbar for Log */
.log-container::-webkit-scrollbar {
    width: 6px;
}

.log-container::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

/* Status Cards Vertical Stack in Sidebar */
.status-cards-vertical {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Chart Panel override */
.chart-panel {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    height: 400px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-container {
    flex: 1;
    position: relative;
    width: 100%;
}

.chart-legend {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.dot-legend {
    width: 10px;
    height: 10px;
    display: inline-block;
    border-radius: 50%;
    margin-right: 5px;
}

.dot-legend.player-a {
    background: #30D158;
}

.dot-legend.player-b {
    background: #0A84FF;
}

.pro-tip {
    background: linear-gradient(90deg, #FF9500 0%, #FFD60A 100%);
    color: black;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* -- Player View (Console Mode) -- */
.console-mode-container {
    text-align: center;
    max-width: 400px;
    margin: auto;
}

.console-icon {
    font-size: 4rem;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.ping-display {
    font-size: 3rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin: 1rem 0;
}

.ping-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* -- Utility -- */
.copy-field {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: background 0.2s;
}

.copy-field:hover {
    background: rgba(0, 0, 0, 0.5);
}

.copy-field input {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 0.85rem;
    flex-grow: 1;
    padding: 4px 8px;
    outline: none;
    width: 100%;
    text-overflow: ellipsis;
}

.copy-field button {
    background: transparent;
    border: none;
    cursor: pointer;
    filter: grayscale(1);
    opacity: 0.7;
}

.glass {
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.hidden {
    display: none !important;
}