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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #0c0f16;
    color: #ffffff;
    min-height: 100vh;
    padding: 40px 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

/* HEADER */
.header {
    text-align: center;
    margin-bottom: 32px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
}

.header p {
    font-size: 1rem;
    color: #566681;
    margin-top: 8px;
}

/* SERVER INFO */
.server-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.info-card {
    background-color: #111622;
    border: 1px solid #1e2a3a;
    border-radius: 8px;
    padding: 14px 16px;
    text-align: center;
}

.info-label {
    font-size: 0.75rem;
    color: #566681;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.info-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
    word-break: break-all;
}

/* MAIN */
.main {
    background: transparent;
    margin-bottom: 40px;
}

.controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 35px;
}

.btn {
    padding: 12px 30px;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #0066ff;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #0052cc;
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: #161b26;
    color: #a0aec0;
    border: 1px solid #222b3a;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #222b3a;
}

/* STATUS */
.status {
    text-align: center;
    padding: 16px;
    background-color: #111622;
    border-radius: 6px;
    border-left: 4px solid #0066ff;
    margin-bottom: 24px;
}

.status p {
    font-size: 1rem;
    color: #0066ff;
}

/* RESULTS GRID */
.results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.result-card {
    background-color: #161b26;
    border: 1px solid #222b3a;
    color: white;
    padding: 25px 20px;
    border-radius: 8px;
    text-align: center;
}

.result-icon {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.result-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
}

.result-value span:first-child {
    font-size: 2.2rem;
    font-weight: 700;
    font-family: monospace, sans-serif;
}

.result-card:nth-child(1) .result-value span:first-child { color: #38bdf8; }
.result-card:nth-child(2) .result-value span:first-child { color: #34d399; }
.result-card:nth-child(3) .result-value span:first-child { color: #fbbf24; }
.result-card:nth-child(4) .result-value span:first-child { color: #c084fc; }

.result-unit {
    font-size: 0.9rem;
    color: #64748b;
}

.result-label {
    font-size: 0.85rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================== WAVE PROGRESS BAR ==================== */
.wave-container {
    width: 100%;
    margin-bottom: 8px;
}

.wave-bar {
    width: 100%;
    height: 10px;
    background-color: #161b26;
    border-radius: 99px;
    overflow: hidden;
    position: relative;
}

.wave-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0052cc, #0099ff, #00d4ff);
    border-radius: 99px;
    position: relative;
    transition: width 0.4s ease;
    overflow: hidden;
}

/* Hiệu ứng sóng chạy trên thanh fill */
.wave-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255,255,255,0.35) 40%,
        rgba(255,255,255,0.6) 50%,
        rgba(255,255,255,0.35) 60%,
        transparent 100%
    );
    animation: wave-shimmer 1.4s linear infinite;
}

@keyframes wave-shimmer {
    0%   { transform: translateX(-60%); }
    100% { transform: translateX(60%); }
}

/* Đốm sáng ở đầu thanh (hiệu ứng đầu sóng) */
.wave-top {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: radial-gradient(circle, #ffffff 0%, #00d4ff 60%, transparent 100%);
    border-radius: 50%;
    box-shadow: 0 0 8px 3px #00aaff88;
    animation: pulse-dot 1s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
    50%       { opacity: 0.7; transform: translateY(-50%) scale(1.3); }
}

.progress-label {
    text-align: center;
    margin-top: 10px;
    color: #0099ff;
    font-weight: 600;
    font-size: 0.9rem;
}
/* ==================== END WAVE ==================== */

/* HISTORY */
.history {
    background: transparent;
}

.history h2 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    color: #ffffff;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background-color: #161b26;
    border: 1px solid #222b3a;
    border-radius: 8px;
}

.history-item-info {
    flex: 1;
}

.history-item-time {
    color: #64748b;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.history-item-values {
    color: #e2e8f0;
    font-weight: 600;
    font-size: 0.95rem;
}

.history-item-delete {
    background-color: transparent;
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    margin-left: 12px;
    flex-shrink: 0;
}

.history-item-delete:hover {
    background-color: #ef4444;
    color: white;
}

.empty-history {
    text-align: center;
    color: #64748b;
    padding: 20px;
}

/* RESPONSIVE */
@media (max-width: 600px) {
    .results {
        grid-template-columns: repeat(2, 1fr);
    }
    .server-info {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 400px) {
    .results {
        grid-template-columns: 1fr;
    }
    .server-info {
        grid-template-columns: 1fr;
    }
}
