@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
}
body, h1, h2, h3, h4, p, ul, ol, li, figure, figcaption, blockquote, dl, dd {
    margin: 0;
}

:root {
    --bg-color: #0a0b0d;
    --text-color: #f5f9fe;
    --text-secondary: #787d87;
    --primary-gradient: linear-gradient(90deg, #3ee1a3 0%, #32f08c 36%, #60f2bd 71.63%, #a0fde7 100%);
    --primary-glow: rgba(50, 240, 140, 0.4);
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover-border: rgba(50, 240, 140, 0.3);
    --font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@font-face {
    font-family: 'BASKVILL';
    src: url("../../konekuto/fonts/BASKVILL.TTF");
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-stack);
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Video Background */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.video-background video {
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    opacity: 0.4;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, #0a0b0d 100%), rgba(10, 11, 13, 0.9);
    backdrop-filter: blur(8px);
}

/* Header */
header {
    padding: 20px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(10, 11, 13, 0.7);
    backdrop-filter: blur(20px);
}

.logo {
    font-family: 'BASKVILL', serif;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    opacity: 0.9;
    letter-spacing: 0.5px;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 140px 20px 80px;
    position: relative;
    z-index: 10;
}

.hero {
    text-align: center;
    max-width: 800px;
    margin-bottom: 40px;
    animation: fadeIn 0.8s ease-out;
}

.hero p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 10px;
    opacity: 0.8;
}

.hero h1 {
    font-size: 72px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 0;
    color: #fff;
}

.hero h1 .highlight {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    position: relative;
}

.hero h1 .highlight::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    background: var(--primary-gradient);
    filter: blur(40px);
    opacity: 0.3;
    transform: translate(-50%, -50%);
    z-index: -1;
}

/* Speedtest Specific Styles */
.speedtest-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(10px);
    animation: slideUp 0.8s ease-out 0.2s backwards;
}

.test-group {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.gauge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 320px;
}

.gauge-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.meter {
    width: 300px;
    height: 300px;
}

.meter-text {
    font-size: 50px;
    font-weight: 700;
    color: var(--text-color);
    position: absolute;
    top: 58%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    z-index: 1;
}

.unit {
    font-size: 14px;
    color: var(--text-secondary);
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
}

.stats-group {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
    width: 100%;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px 30px;
    border-radius: 12px;
    min-width: 120px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.stat-unit {
    font-size: 12px;
    color: var(--text-secondary);
}

#ipArea {
    margin-bottom: 30px;
    color: var(--text-secondary);
    font-size: 14px;
}

#ip {
    color: var(--text-color);
    font-weight: 600;
}

/* Start Button */
#startStopBtn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 160px;
    height: 50px;
    border-radius: 25px;
    background: transparent;
    border: 1px solid var(--primary-glow);
    color: #3ee1a3;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#startStopBtn:hover {
    background: var(--primary-gradient);
    color: #0a0b0d;
    box-shadow: 0 0 20px var(--primary-glow);
    border-color: transparent;
    transform: translateY(-2px);
}

#startStopBtn.running {
    background: rgba(255, 50, 50, 0.1);
    border-color: #ff3030;
    color: #ff3030;
}

#startStopBtn.running:hover {
    background: #ff3030;
    color: #fff;
    box-shadow: 0 0 20px rgba(255, 48, 48, 0.4);
}

/* Footer */
footer {
    padding: 40px;
    text-align: center;
    color: #444;
    font-size: 13px;
    border-top: 1px solid #111;
    position: relative;
    z-index: 10;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .hero h1 {
        font-size: 48px;
    }
    /* Default behavior for tablet/small desktop is still flexible */
}

@media (max-width: 600px) {
    .test-group {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 10px;
        justify-content: center;
        align-items: flex-start;
    }
    
    .gauge-container {
        width: 50%;
        max-width: 170px;
    }
    
    .meter {
        width: 100%;
        height: auto;
        aspect-ratio: 1/1;
    }
    
    .meter-text {
        font-size: 24px;
        top: 55%;
    }
    
    .unit {
        font-size: 12px;
        bottom: 15%;
    }
    
    .gauge-title {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 40px;
    }
    .speedtest-container {
        padding: 20px 10px;
    }
    .stats-group {
        gap: 10px;
    }
    .stat-item {
        padding: 10px 15px;
        min-width: 80px;
    }
}
