:root {
    --primary: #4f46e5;      /* Indigo */
    --primary-dark: #3730a3;
    --dark-bg: #0f172a;      /* Slate 900 */
    --light-bg: #f8fafc;     /* Slate 50 */
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-sub: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --font: 'Plus Jakarta Sans', sans-serif;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; outline: none; }
body {
    font-family: var(--font); background: var(--light-bg); color: var(--text-main);
    line-height: 1.6; overflow-x: hidden;
}

/* ANIMATIONS */
.fade-in-up { animation: fadeInUp 0.6s ease-out forwards; opacity: 0; transform: translateY(20px); }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }

/* 1. HEADER SECTION */
.app-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white; padding-bottom: 100px; /* Space for floating search */
    position: relative; overflow: hidden;
}
.app-header::before {
    content: ''; position: absolute; top: -50%; right: -20%; width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(79,70,229,0.15) 0%, transparent 70%);
    border-radius: 50%; pointer-events: none;
}

.navbar {
    max-width: 1100px; margin: 0 auto; padding: 20px;
    display: flex; justify-content: space-between; align-items: center;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; }
.logo-sq {
    width: 36px; height: 36px; background: rgba(255,255,255,0.1); border-radius: 8px;
    display: flex; align-items: center; justify-content: center; color: #818cf8;
}
.live-badge {
    background: rgba(16, 185, 129, 0.2); color: #34d399; font-size: 0.8rem;
    padding: 5px 12px; border-radius: 20px; font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.pulse { width: 8px; height: 8px; background: #34d399; border-radius: 50%; box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); } 70% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }

.back-link { color: #94a3b8; text-decoration: none; font-size: 0.9rem; font-weight: 600; transition: 0.2s; }
.back-link:hover { color: white; }

.hero-content { text-align: center; padding: 40px 20px 20px; }
.ip-label { font-size: 0.8rem; font-weight: 700; letter-spacing: 1px; color: #94a3b8; margin-bottom: 10px; }
.main-ip { font-size: clamp(3rem, 6vw, 5rem); font-weight: 800; line-height: 1; letter-spacing: -2px; margin-bottom: 20px; }
.hero-meta { display: flex; justify-content: center; gap: 10px; margin-bottom: 30px; }
.meta-pill { background: rgba(255,255,255,0.1); padding: 5px 15px; border-radius: 30px; font-size: 0.8rem; font-weight: 600; }
.success { color: #34d399; background: rgba(16, 185, 129, 0.15); }
.danger { color: #f87171; background: rgba(239, 68, 68, 0.15); }

.copy-fab {
    background: white; color: var(--primary); border: none; padding: 12px 24px;
    border-radius: 50px; font-weight: 600; font-size: 0.95rem; cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); transition: 0.2s; display: inline-flex; align-items: center; gap: 8px;
}
.copy-fab:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.3); }

/* 2. FLOATING SEARCH */
.search-container {
    max-width: 600px; margin: -30px auto 40px; padding: 0 20px; position: relative; z-index: 10;
}
.search-box {
    background: white; padding: 8px; border-radius: 60px; display: flex; align-items: center;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 5px 10px -5px rgba(0,0,0,0.05);
}
.search-icon { padding-left: 20px; color: var(--text-sub); }
.search-box input {
    flex: 1; border: none; padding: 15px; font-size: 1rem; font-family: var(--font); color: var(--text-main);
}
.search-box button {
    background: var(--dark-bg); color: white; border: none; padding: 12px 30px;
    border-radius: 40px; font-weight: 600; cursor: pointer; transition: 0.2s;
}
.search-box button:hover { background: var(--primary); }

/* 3. DASHBOARD */
.dashboard-container { max-width: 1100px; margin: 0 auto; padding: 0 20px 50px; }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-box {
    background: white; padding: 20px; border-radius: 16px; border: 1px solid var(--border);
    display: flex; align-items: center; gap: 15px; box-shadow: var(--shadow);
}
.icon-circle { width: 45px; height: 45px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.blue { background: #eff6ff; color: #3b82f6; }
.purple { background: #f5f3ff; color: #8b5cf6; }
.orange { background: #fff7ed; color: #f97316; }
.stat-data small { display: block; font-size: 0.75rem; color: var(--text-sub); font-weight: 700; text-transform: uppercase; margin-bottom: 2px; }
.stat-data span { font-weight: 700; font-size: 1.1rem; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; display: block;}

.grid-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 25px; }

.panel {
    background: white; border-radius: 20px; border: 1px solid var(--border);
    box-shadow: var(--shadow-lg); overflow: hidden;
}
.panel-head { padding: 20px 25px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.panel-head h3 { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; display: flex; align-items: center; gap: 10px; }
.panel-body { padding: 25px; }
.p-0 { padding: 0; }

#map { width: 100%; height: 300px; z-index: 1; }
.geo-details { padding: 20px 25px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; }
.geo-row span { display: block; font-size: 0.8rem; color: var(--text-sub); margin-bottom: 5px; }
.geo-row b { display: block; font-size: 1rem; color: var(--text-main); }
.mono { font-family: monospace; }

.notice { background: #f0f9ff; color: #0369a1; padding: 12px; border-radius: 8px; font-size: 0.85rem; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }

.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-bottom: 25px; }
.info-card { background: #f8fafc; padding: 15px; border-radius: 12px; border: 1px solid var(--border); }
.info-card small { display: block; font-size: 0.7rem; color: var(--text-sub); font-weight: 700; text-transform: uppercase; margin-bottom: 5px; }
.info-card strong { display: block; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.security-check {
    background: #fff1f2; border: 1px solid #fecdd3; padding: 15px; border-radius: 12px;
    display: flex; align-items: center; gap: 15px;
}
.sec-icon { font-size: 1.5rem; color: #e11d48; }
.sec-text strong { display: block; color: #9f1239; font-size: 0.9rem; }
.sec-text span { font-family: monospace; color: #be123c; font-size: 0.9rem; }

/* 4. FOOTER */
.main-footer {
    background: white; border-top: 1px solid var(--border); padding: 40px 20px;
    text-align: center; margin-top: auto;
}
.footer-logo { font-weight: 800; font-size: 1.5rem; color: var(--text-main); margin-bottom: 15px; }
.footer-credits {
    display: flex; justify-content: center; align-items: center; gap: 15px;
    margin-bottom: 20px; color: var(--text-sub); font-size: 0.9rem;
}
.credit-tag strong { color: var(--primary); }
.divider { color: var(--border); }
.copyright { font-size: 0.8rem; color: var(--text-sub); }

@media (max-width: 850px) { .grid-layout { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
    .app-header { padding-bottom: 120px; }
    .main-ip { font-size: 3rem; }
    .info-grid { grid-template-columns: 1fr; }
}