/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --bg: #0a0e1a;
    --bg-elevated: #111827;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-hover: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --primary: #00d4ff;
    --primary-glow: rgba(0, 212, 255, 0.4);
    --secondary: #a855f7;
    --secondary-glow: rgba(168, 85, 247, 0.4);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --radius: 16px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--secondary); }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
code { font-family: var(--font-mono); background: rgba(0, 212, 255, 0.1); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; color: var(--primary); }

/* ===== Animated Background ===== */
.bg-animation { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}
.bg-glow {
    position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}
.bg-glow-1 { width: 500px; height: 500px; background: var(--primary); top: -100px; left: -100px; }
.bg-glow-2 { width: 400px; height: 400px; background: var(--secondary); bottom: -100px; right: -100px; animation-delay: -5s; }
.bg-glow-3 { width: 300px; height: 300px; background: #ec4899; top: 50%; left: 50%; animation-delay: -10s; }
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(100px, -50px) scale(1.1); }
    66% { transform: translate(-50px, 100px) scale(0.9); }
}

/* ===== Glass Effect ===== */
.glass {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ===== Header ===== */
.header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; backdrop-filter: blur(20px); background: rgba(10, 14, 26, 0.7); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 1.4rem; font-weight: 800; color: var(--text); }
.logo-text { letter-spacing: -0.5px; }
.logo-text .accent { background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.logo-icon { display: flex; }
.nav { display: flex; gap: 28px; }
.nav a { color: var(--text-muted); font-weight: 500; font-size: 0.95rem; padding: 8px 0; position: relative; }
.nav a:hover { color: var(--text); }
.nav a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background: var(--primary); transition: width var(--transition); }
.nav a:hover::after { width: 100%; }
@media (max-width: 640px) { .nav { display: none; } }

/* ===== Hero ===== */
.hero { padding: 140px 0 60px; text-align: center; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3); border-radius: 50px; color: var(--success); font-size: 0.85rem; font-weight: 500; margin-bottom: 24px; }
.pulse-dot { width: 8px; height: 8px; background: var(--success); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.3); } }
.hero-title { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 900; letter-spacing: -2px; line-height: 1.1; margin-bottom: 16px; background: linear-gradient(135deg, #fff 0%, var(--primary) 50%, var(--secondary) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-subtitle { font-size: clamp(1rem, 2vw, 1.25rem); color: var(--text-muted); max-width: 600px; margin: 0 auto 40px; }

/* ===== IP Card ===== */
.ip-card { max-width: 800px; margin: 0 auto; padding: 32px; animation: slideUp 0.6s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.ip-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; gap: 16px; }
.ip-label-group { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ip-label { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 600; }
.ip-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { padding: 4px 10px; border-radius: 50px; font-size: 0.75rem; font-weight: 600; }
.badge-version { background: rgba(0, 212, 255, 0.15); color: var(--primary); border: 1px solid rgba(0, 212, 255, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-info { background: rgba(59, 130, 246, 0.15); color: var(--info); border: 1px solid rgba(59, 130, 246, 0.3); }
.ip-value { font-family: var(--font-mono); font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 700; color: var(--text); word-break: break-all; line-height: 1.2; background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.copy-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; background: var(--surface-hover); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--text); font-size: 0.85rem; font-weight: 500; transition: all var(--transition); flex-shrink: 0; }
.copy-btn:hover { background: var(--primary); color: var(--bg); border-color: var(--primary); }
.copy-btn.copied { background: var(--success); color: var(--bg); border-color: var(--success); }
.ip-meta { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.meta-item { display: flex; align-items: center; gap: 10px; }
.meta-icon { color: var(--primary); display: flex; }
.meta-label { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); font-weight: 600; }
.meta-value { display: block; font-size: 0.95rem; color: var(--text); font-weight: 500; }

/* ===== Flag (CSS-only) ===== */
.flag { display: inline-block; width: 20px; height: 14px; border-radius: 2px; background: var(--text-dim); vertical-align: middle; margin-right: 4px; box-shadow: 0 0 0 1px var(--border); }

/* ===== Stats Grid ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 32px; max-width: 1000px; margin-left: auto; margin-right: auto; }
.stat-card { padding: 20px; display: flex; align-items: center; gap: 14px; transition: transform var(--transition), border-color var(--transition); }
.stat-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon-blue { background: rgba(0, 212, 255, 0.15); color: var(--primary); }
.stat-icon-purple { background: rgba(168, 85, 247, 0.15); color: var(--secondary); }
.stat-icon-green { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.stat-icon-orange { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.stat-label { display: block; font-size: 0.75rem; text-transform: uppercase; color: var(--text-dim); letter-spacing: 0.5px; font-weight: 600; }
.stat-value { display: block; font-size: 1.1rem; font-weight: 700; color: var(--text); margin-top: 2px; }

/* ===== Sections ===== */
.section { padding: 80px 0; }
.section-alt { background: rgba(255, 255, 255, 0.015); }
.section-header { text-align: center; margin-bottom: 48px; }
.section-title { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: -1px; margin-bottom: 12px; }
.section-subtitle { color: var(--text-muted); font-size: 1.1rem; }

/* ===== Details Grid ===== */
.details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.detail-panel { padding: 28px; transition: transform var(--transition); }
.detail-panel:hover { transform: translateY(-2px); }
.panel-title { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 700; margin-bottom: 20px; color: var(--primary); }
.detail-list { display: flex; flex-direction: column; }
.detail-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); gap: 16px; }
.detail-row:last-child { border-bottom: none; }
.detail-key { font-size: 0.9rem; color: var(--text-muted); font-weight: 500; }
.detail-val { font-size: 0.9rem; color: var(--text); font-weight: 600; text-align: right; }
.detail-val.mono { font-family: var(--font-mono); font-size: 0.85rem; }
.val-ok { color: var(--success); }
.val-warn { color: var(--warning); }
.val-info { color: var(--info); }

/* ===== Map ===== */
.map-container { padding: 28px; margin-top: 24px; }
.map-wrapper { margin-top: 16px; }
.map-note { font-size: 0.85rem; color: var(--text-muted); margin-top: 12px; text-align: center; }

/* ===== Lookup Form ===== */
.lookup-container { max-width: 700px; margin: 0 auto; padding: 32px; }
.lookup-form { width: 100%; }
.input-group { display: flex; gap: 10px; position: relative; }
.input-group .input-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; }
.input-group input { flex: 1; padding: 14px 16px 14px 46px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--text); font-size: 1rem; font-family: inherit; transition: all var(--transition); }
.input-group input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); background: rgba(0, 0, 0, 0.5); }
.input-group input::placeholder { color: var(--text-dim); }
.btn { padding: 14px 24px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.95rem; transition: all var(--transition); display: inline-flex; align-items: center; gap: 8px; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: var(--bg); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--primary-glow); }
.btn-lg { padding: 16px 32px; font-size: 1.05rem; }
.lookup-result { margin-top: 24px; }
.lookup-result-card { padding: 20px; }
.lookup-result-card .ip-value { font-size: 1.5rem; margin-bottom: 16px; }

/* ===== Content Grid (What is IP) ===== */
.content-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.content-block { padding: 32px; transition: transform var(--transition), border-color var(--transition); }
.content-block:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.content-icon { width: 56px; height: 56px; border-radius: 14px; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: var(--bg); display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.content-block h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 12px; }
.content-block p { color: var(--text-muted); line-height: 1.7; }

/* ===== FAQ ===== */
.faq-list { max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item { padding: 0; overflow: hidden; transition: border-color var(--transition); }
.faq-item summary { padding: 20px 24px; cursor: pointer; font-weight: 600; font-size: 1.05rem; display: flex; justify-content: space-between; align-items: center; list-style: none; user-select: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--primary); }
.faq-icon { position: relative; width: 20px; height: 20px; flex-shrink: 0; }
.faq-icon::before, .faq-icon::after { content: ''; position: absolute; background: var(--primary); transition: transform var(--transition); }
.faq-icon::before { top: 50%; left: 0; width: 100%; height: 2px; transform: translateY(-50%); }
.faq-icon::after { left: 50%; top: 0; width: 2px; height: 100%; transform: translateX(-50%); }
.faq-item[open] .faq-icon::after { transform: translateX(-50%) rotate(90deg); opacity: 0; }
.faq-content { padding: 0 24px 20px; color: var(--text-muted); line-height: 1.7; }
.faq-content code { font-family: var(--font-mono); }

/* ===== CTA ===== */
.cta-section { padding: 60px 0; }
.cta-box { padding: 48px; text-align: center; background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(168, 85, 247, 0.1)); border-color: var(--border-strong); }
.cta-box h2 { font-size: 2rem; font-weight: 800; margin-bottom: 12px; }
.cta-box p { color: var(--text-muted); margin-bottom: 24px; font-size: 1.1rem; }

/* ===== Footer ===== */
.footer { background: rgba(0, 0, 0, 0.3); border-top: 1px solid var(--border); padding: 60px 0 30px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .logo { margin-bottom: 16px; }
.footer-desc { color: var(--text-muted); font-size: 0.9rem; line-height: 1.7; }
.footer-col h4 { font-size: 1rem; font-weight: 700; margin-bottom: 16px; color: var(--text); }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: var(--text-muted); font-size: 0.9rem; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { padding-top: 24px; border-top: 1px solid var(--border); text-align: center; }
.footer-bottom p { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 6px; }
.footer-tech { font-size: 0.8rem !important; color: var(--text-dim); }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--success); color: var(--bg); padding: 12px 24px; border-radius: 50px; font-weight: 600; font-size: 0.95rem; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); opacity: 0; transition: all var(--transition); z-index: 1000; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); color: white; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero { padding: 120px 0 40px; }
    .section { padding: 60px 0; }
    .ip-card { padding: 24px; }
    .ip-meta { flex-direction: column; gap: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .input-group { flex-direction: column; }
    .input-group .input-icon { left: 16px; top: 16px; transform: none; }
    .input-group input { padding-left: 46px; }
    .cta-box { padding: 32px 20px; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .container { padding: 0 16px; }
}

/* ===== Print ===== */
@media print {
    .bg-animation, .header, .footer, .copy-btn, .nav, .cta-section { display: none; }
    body { background: white; color: black; }
    .glass { background: white; border: 1px solid #ccc; box-shadow: none; }
}