:root {
    --primary-dark: #0a2342;
    --primary-blue: #0066cc;
    --accent-cyan: #00b4d8;
    --bg-light: #f4f7f9;
    --white: #ffffff;
    --weak: #ff4757; 
    --medium: #ffa502; 
    --strong: #2ed573; 
    --excellent: #1e90ff;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; 
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-light);
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto; 
}

/* ==========================================================================
   NOWE MENU (STICKY TOP-BAR)
   ========================================================================== */
.sticky-nav {
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 1000;
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    margin-bottom: 20px;
    border-radius: 6px;
    border: 1px solid #eee;
}

.sticky-nav a {
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    padding: 10px 20px;
    border-radius: 4px;
    transition: 0.2s;
    background: var(--bg-light);
    letter-spacing: 0.5px;
}

.sticky-nav a:hover, .sticky-nav a.active {
    background: var(--primary-blue);
    color: var(--white);
}

/* ==========================================================================
   LAYOUT GŁÓWNY
   ========================================================================== */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 10px 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.module-title {
    text-align: center;
    color: var(--primary-dark);
    text-transform: uppercase;
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0 0 15px 0;
    letter-spacing: 1px;
    padding-bottom: 8px;
    border-bottom: 2px solid #dce4ec;
}

.module-section {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin-bottom: 5px;
    padding-top: 5px;
    flex: 1;
}

.main-content {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    flex: 1;
    min-height: 0;
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    padding: 20px;
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
}

.results-panel {
    justify-content: center;
}

/* ==========================================================================
   PAS REKLAMOWY
   ========================================================================== */
.ad-strip { 
    height: 50px; 
    background: #eef1f5; 
    border: 1px solid #dce4ec; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 0.7rem; 
    color: #999; 
    margin: 10px 0; 
    border-radius: 6px; 
    flex-shrink: 0; 
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

/* ==========================================================================
   STOPKA CENTRALNA
   ========================================================================== */
.footer-mini { 
    display: flex; 
    justify-content: space-between; 
    border-top: 1px solid #eee; 
    padding-top: 15px; 
    margin-top: 20px; 
    color: #999; 
    font-size: 0.7rem; 
    padding-bottom: 15px;
    flex-shrink: 0;
}

.footer-mini a { 
    color: var(--primary-blue); 
    text-decoration: none; 
    font-weight: 600; 
    margin-left: 5px; 
}

.footer-mini a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   ELEMENTY WSPÓLNE I NARZĘDZIA
   ========================================================================== */
.top-bar { display: flex; justify-content: space-between; align-items: center; height: 30px; font-size: 0.85rem; flex-shrink: 0; margin-bottom: 15px; }
.ip-badge { background: #e1ecf4; padding: 4px 12px; border-radius: 12px; color: var(--primary-blue); font-weight: bold; letter-spacing: 0.5px;}

h3 { margin: 0 0 10px 0; font-size: 0.95rem; color: var(--primary-dark); text-transform: uppercase; border-bottom: 2px solid #f0f0f0; padding-bottom: 5px; font-weight: 700; }
.separator { border: 0; border-top: 1px solid #eee; margin: 15px 0; }

.description-text {
    font-size: 0.85rem; 
    color: #555; 
    line-height: 1.5; 
    margin-bottom: 15px;
}

/* ==========================================================================
   SEKCJA DIAGNOSTYCZNA (IP i SERWER)
   ========================================================================== */
.diagnostics-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.ip-display-box {
    background: #f8f9fa;
    border: 1px dashed #dce4ec;
    border-radius: 6px;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ip-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ip-value {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    font-weight: bold;
    color: var(--primary-blue);
    background: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #eee;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.server-value {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--primary-dark);
    background: #eef1f5;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #dce4ec;
}

.btn-primary { background: var(--primary-blue); color: white; border: none; padding: 14px; border-radius: 6px; font-weight: bold; cursor: pointer; width: 100%; font-size: 1.05rem; margin-top: 5px; transition: 0.2s; text-transform: uppercase; letter-spacing: 1px;}
.btn-primary:hover:not(:disabled) { background: #0056b3; box-shadow: 0 4px 10px rgba(0, 102, 204, 0.3); transform: translateY(-1px); }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }
.btn-primary:disabled { background: #dce4ec; color: #999; cursor: not-allowed; }

/* ==========================================================================
   PASEK POSTĘPU
   ========================================================================== */
.progress-wrapper {
    margin-top: 15px;
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, height 0.3s ease;
}

.progress-wrapper.active {
    opacity: 1;
    height: 45px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #eef1f5;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-cyan);
    border-radius: 4px;
    transition: width 0.1s linear, background-color 0.4s ease;
    position: relative;
    overflow: hidden;
}

/* ==========================================================================
   PROMOCJA GENERATORÓW IT
   ========================================================================== */
.promo-card {
    background: linear-gradient(145deg, var(--primary-dark) 0%, #17375e 100%);
    color: var(--white);
    border: none;
    position: relative;
    overflow: hidden;
}

.promo-card::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 150px; height: 150px;
    background: rgba(0, 180, 216, 0.1);
    border-radius: 50%;
    filter: blur(40px);
}

.promo-card h4 {
    margin: 0 0 12px 0;
    color: var(--accent-cyan);
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 8px;
}

.promo-card p {
    font-size: 0.8rem;
    line-height: 1.5;
    color: #e1ecf4;
    margin-bottom: 15px;
}

.promo-list {
    list-style: none;
    padding: 0; margin: 0 0 20px 0;
    font-size: 0.8rem;
    color: #dce4ec;
}

.promo-list li {
    margin-bottom: 8px;
    padding-left: 18px;
    position: relative;
}

.promo-list li strong { color: var(--white); }
.promo-list li::before {
    content: '\25B6';
    font-family: Arial, Helvetica, sans-serif;
    position: absolute; left: 0; top: 3px;
    color: var(--accent-cyan);
    font-size: 0.65rem;
}

.btn-promo {
    display: inline-block;
    width: 100%;
    text-align: center;
    background: var(--accent-cyan);
    color: var(--primary-dark);
    text-decoration: none;
    padding: 12px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: 0.3s;
    border: 2px solid var(--accent-cyan);
}

.btn-promo:hover {
    background: transparent;
    color: var(--accent-cyan);
}

/* ==========================================================================
   WYNIKI SPEEDTESTU & WYKRESY KOŁOWE
   ========================================================================== */
.results-grid {
    display: flex;
    gap: 20px;
    justify-content: space-between;
    align-items: stretch;
    height: 100%;
    padding: 20px 0;
}

.metric-box {
    flex: 1;
    background: var(--bg-light);
    border: 2px solid #dce4ec;
    border-radius: 8px;
    padding: 25px 15px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.metric-box.active {
    border-color: var(--accent-cyan);
    box-shadow: 0 10px 25px rgba(0, 180, 216, 0.15);
    background: var(--white);
    transform: translateY(-5px);
}

.metric-box.completed {
    border-color: var(--strong);
    background: var(--white);
}

.metric-box.completed .metric-value { color: var(--strong); }

.metric-label {
    font-size: 0.85rem;
    color: var(--primary-dark);
    text-transform: uppercase;
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.gauge-container {
    position: relative;
    width: 100%;
    max-width: 200px;
    aspect-ratio: 1 / 1;
    margin: auto;
}

.gauge-center {
    position: absolute;
    top: 55%; 
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
}

.metric-value {
    font-family: 'Courier New', Courier, monospace;
    font-variant-numeric: tabular-nums;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-blue);
    line-height: 1;
    margin-bottom: 2px;
    transition: color 0.3s ease;
}

.metric-unit {
    font-size: 0.85rem;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-dark);
    text-align: center;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef1f5;
    border-radius: 4px;
    padding: 10px;
    border: 1px dashed #ccc;
    transition: color 0.2s ease, border-color 0.2s ease;
}

/* ==========================================================================
   RWD
   ========================================================================== */
@media (max-width: 900px) {
    .app-container { padding: 10px; }
    .sticky-nav { flex-wrap: wrap; gap: 5px; padding: 8px; }
    .sticky-nav a { font-size: 0.75rem; padding: 6px 10px; flex: 1; text-align: center; }
    .module-section { min-height: auto; display: block; margin-bottom: 20px; }
    .main-content { display: block; }
    .left-column { margin-bottom: 20px; }
    .panel { overflow: visible; }
    .top-bar { margin-bottom: 10px; flex-wrap: wrap; height: auto; gap: 10px; }
    .ip-display-box { flex-direction: column; gap: 8px; }
    .results-grid { flex-direction: column; gap: 15px; }
    .gauge-container { max-width: 180px; }
    .metric-box { padding: 25px 15px; }
    .metric-value { font-size: 2rem; }
    .footer-mini { flex-direction: column; gap: 10px; text-align: center; }
}