/* Variables & Tech Design Tokens */
:root {
    --bg-dark: #080711;
    --bg-card: rgba(18, 16, 35, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f1fe;
    --text-secondary: #8e8a9f;
    
    /* Neon glow colors */
    --neon-cyan: #00f2fe;
    --neon-cyan-glow: rgba(0, 242, 254, 0.4);
    --neon-magenta: #f857a6;
    --neon-magenta-glow: rgba(248, 87, 166, 0.4);
    --neon-purple: #7f00ff;
    --neon-purple-glow: rgba(127, 0, 255, 0.4);
    --neon-green: #39ff14;
    --neon-green-glow: rgba(57, 255, 20, 0.4);
    
    --font-primary: 'Outfit', sans-serif;
    --font-tech: 'Orbitron', sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.5;
}

/* Background grid effect */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center center;
    z-index: -2;
    pointer-events: none;
}

/* Animated glowing orbs in background */
.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
    animation: float 20s infinite alternate;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--neon-cyan) 0%, transparent 70%);
    top: -10%;
    left: -10%;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--neon-purple) 0%, transparent 70%);
    bottom: -10%;
    right: -10%;
    animation-delay: -5s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--neon-magenta) 0%, transparent 70%);
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* App Container */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    min-height: 100vh;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 1.8rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan-glow);
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.logo-text .highlight {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan-glow);
}

.logo-badge {
    background: linear-gradient(135deg, var(--neon-magenta), var(--neon-purple));
    color: #fff;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 10px var(--neon-magenta-glow);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--neon-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--neon-green);
    animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
    0% { opacity: 0.4; }
    100% { opacity: 1; box-shadow: 0 0 12px var(--neon-green); }
}

/* Glass Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 25px;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 15px;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-icon {
    color: var(--neon-cyan);
}

/* IP Card specifics */
.ip-version-badge {
    background: rgba(0, 242, 254, 0.1);
    color: var(--neon-cyan);
    border: 1px solid rgba(0, 242, 254, 0.2);
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.ip-display-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.ip-display-container h1 {
    font-family: var(--font-tech);
    font-size: 1.8rem;
    color: #fff;
    letter-spacing: 1px;
    word-break: break-all;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition-smooth);
}

.btn-icon:hover {
    color: var(--neon-cyan);
    background: rgba(0, 242, 254, 0.1);
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-label i {
    width: 16px;
}

.info-value {
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
}

/* Radar Animation container */
.radar-container {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.radar {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 2px solid rgba(0, 242, 254, 0.15);
    background: 
        radial-gradient(circle, rgba(0, 242, 254, 0.02) 0%, rgba(0, 0, 0, 0.3) 100%),
        repeating-radial-gradient(circle, transparent, transparent 20px, rgba(0, 242, 254, 0.05) 20px, rgba(0, 242, 254, 0.05) 21px);
    overflow: hidden;
}

.radar::before, .radar::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    background-color: rgba(0, 242, 254, 0.15);
    transform: translate(-50%, -50%);
}

.radar::before {
    width: 100%;
    height: 1px;
}

.radar::after {
    width: 1px;
    height: 100%;
}

.radar-sweep {
    position: absolute;
    width: 100%;
    height: 100%;
    background: conic-gradient(from 0deg at 50% 50%, rgba(0, 242, 254, 0.4) 0deg, transparent 90deg, transparent 360deg);
    border-radius: 50%;
    animation: radar-spin 4s linear infinite;
    transform-origin: center;
}

.radar-ping {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: var(--neon-cyan);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--neon-cyan);
    top: 35%;
    left: 60%;
    animation: ping-grow 1.5s ease-out infinite;
}

@keyframes radar-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes ping-grow {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(3); opacity: 0; }
}

.radar-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Speed Test Card specifics */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.stat-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.stat-value-container {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.stat-value {
    font-family: var(--font-tech);
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
}

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

.stat-icon {
    position: absolute;
    right: 15px;
    bottom: 15px;
    font-size: 1.4rem;
    opacity: 0.25;
}

.ping-color { color: var(--neon-cyan); }
.jitter-color { color: var(--neon-purple); }

/* Gauges styling */
.gauges-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.gauge-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    flex: 1;
}

.gauge-title {
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.gauge {
    position: relative;
    width: 170px;
    height: 170px;
}

.gauge-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.gauge-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.03);
    stroke-width: 12px;
}

.gauge-progress {
    fill: none;
    stroke-width: 12px;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s ease;
}

.download-progress {
    stroke: url(#download-gradient); /* Will style via CSS gradient/colors directly instead for simpler code */
    stroke: var(--neon-cyan);
    filter: drop-shadow(0 0 6px var(--neon-cyan-glow));
}

.upload-progress {
    stroke: var(--neon-magenta);
    filter: drop-shadow(0 0 6px var(--neon-magenta-glow));
}

.gauge-data {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    display: flex;
    flex-direction: column;
}

.gauge-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
}

.gauge-unit {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.speed-type-icon {
    font-size: 1.1rem;
}
.dl-color { color: var(--neon-cyan); }
.ul-color { color: var(--neon-magenta); }

/* Controls & Buttons */
.speed-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.btn-primary {
    position: relative;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    border: none;
    color: #fff;
    padding: 14px 45px;
    font-family: var(--font-primary);
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 20px rgba(0, 242, 254, 0.3);
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0, 242, 254, 0.5);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: skewX(-20deg);
    transition: 0.75s;
    pointer-events: none;
}

.btn-primary:hover .btn-glow {
    left: 120%;
}

.test-progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    display: none;
}

.test-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
    transition: width 0.1s ease;
    box-shadow: 0 0 8px var(--neon-cyan-glow);
}

.test-status {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
}

.test-status.active {
    color: #fff;
    font-weight: 600;
    animation: status-blink 1s infinite alternate;
}

@keyframes status-blink {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

/* Sidebar Columns */
.sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.mini-card h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.mini-info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mini-info-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.mini-info-item span {
    color: var(--text-secondary);
}

.mini-info-item strong {
    color: #fff;
    font-weight: 600;
}

/* Grid Layouts */
.main-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.6fr 1fr;
    gap: 25px;
}

/* Ads Container System */
.ads-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.ads-placeholder {
    width: 100%;
    min-height: 90px;
    background: rgba(10, 8, 22, 0.5);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 10px;
    overflow: hidden;
}

.ads-label {
    position: absolute;
    top: 5px;
    left: 10px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.2);
}

.ads-fallback {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.ads-fallback i {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.15);
}

/* Hide fallback and outline if AdSense loads successfully */
.ads-placeholder:has(ins[data-ad-status="filled"]) {
    border: none;
    background: transparent;
    padding: 0;
}
.ads-placeholder:has(ins[data-ad-status="filled"]) .ads-fallback,
.ads-placeholder:has(ins[data-ad-status="filled"]) .ads-label {
    display: none !important;
}

.ads-top .ads-placeholder {
    max-width: 970px;
    min-height: 90px;
}

.ads-sidebar .ads-placeholder {
    min-height: 350px;
    height: 100%;
}

.ads-middle .ads-placeholder {
    max-width: 970px;
    min-height: 90px;
}

/* SEO Section */
.seo-section {
    padding: 30px;
    margin-top: 10px;
}

.seo-section h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    background: linear-gradient(135deg, #fff 40%, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.seo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.seo-text-box h3 {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.seo-text-box h3 i {
    color: var(--neon-cyan);
}

.seo-text-box p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Footer */
.main-footer {
    border-top: 1px solid var(--border-color);
    padding: 25px 0 15px;
    margin-top: 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.footer-links a:hover {
    color: var(--neon-cyan);
}

/* Orbitron Font Class */
.orbitron {
    font-family: var(--font-tech);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .sidebar-column {
        grid-column: span 2;
        flex-direction: row;
    }
    
    .sidebar-column > * {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar-column {
        grid-column: span 1;
        flex-direction: column;
    }
    
    .gauges-container {
        flex-direction: column;
        gap: 30px;
    }
    
    .main-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 3, 10, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    width: 100%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(0, 242, 254, 0.2);
    box-shadow: 0 0 40px rgba(0, 242, 254, 0.1);
    position: relative;
    padding: 30px;
    animation: slideUp 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Custom scrollbar for modal content */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(0, 242, 254, 0.3);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 242, 254, 0.5);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
    transition: var(--transition-smooth);
}

.modal-close:hover {
    color: var(--neon-magenta);
    text-shadow: 0 0 8px var(--neon-magenta-glow);
}

.modal-body {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.modal-body h3 {
    color: #fff;
    font-size: 1.1rem;
    margin-top: 10px;
    border-left: 3px solid var(--neon-cyan);
    padding-left: 10px;
}

.modal-body strong {
    color: var(--neon-cyan);
}

.modal-body ul {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legal-date {
    font-size: 0.8rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.3);
}

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

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

