/* 
   WHATS MY IP - EXPERT WEB TOOLS
   Theme: 2025 Glassmorphism / Bento Grid
*/

/* --- Fonts --- */
@font-face { font-family: 'Inter'; src: url('/fonts/inter-v20-latin-regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter-v20-latin-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Orbitron'; src: url('/fonts/orbitron-v35-latin-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Roboto Mono'; src: url('/fonts/roboto-mono-v31-latin-regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
    --bg-dark: #0a0a0f;
    --primary-accent: #3b82f6;
    --secondary-accent: #8b5cf6;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --card-bg: rgba(25, 25, 35, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-code: 'Roboto Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.background-glow {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.08) 0%, rgba(10, 10, 15, 0) 50%);
    z-index: -1;
    pointer-events: none;
}

/* --- Header --- */
.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}
.back-btn {
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}
.back-btn:hover { color: var(--primary-accent); }
.logo { font-family: var(--font-heading); font-size: 1.2rem; }
.logo span { color: var(--primary-accent); }

/* --- Main Content --- */
.main-content {
    flex-grow: 1;
    padding: 2rem 5%;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Search Bar */
.search-bar-container {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.lookup-form { flex: 1; display: flex; gap: 10px; }
.input-wrapper {
    flex: 1;
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
}
.input-wrapper i { margin-left: 15px; color: var(--text-muted); }
.input-wrapper input {
    background: transparent;
    border: none;
    color: #fff;
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    outline: none;
}
button { cursor: pointer; border-radius: 8px; font-weight: 600; border: 1px solid var(--card-border); transition: all 0.2s; }

#lookupButton {
    background: var(--primary-accent);
    color: white;
    padding: 0 20px;
    border-color: var(--primary-accent);
}
#lookupButton:hover { background: #2563eb; }

.refresh-btn {
    background: transparent;
    color: var(--text-muted);
    padding: 0 15px;
    white-space: nowrap;
}
.refresh-btn:hover { color: #fff; border-color: #fff; }

/* --- Bento Grid --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}

.card-header {
    font-family: var(--font-heading);
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.card-header i { color: var(--primary-accent); }

/* Hero Card (IP Display) */
.hero-card { grid-column: span 2; }
.ip-display-wrapper { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
.ip-row { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 0.5rem; }
.ip-row .label { color: var(--text-muted); font-size: 0.9rem; width: 60px; }
.ip-row .value-group { display: flex; align-items: center; gap: 10px; flex: 1; justify-content: flex-end; }
.ip-text { font-family: var(--font-code); font-size: 1.5rem; word-break: break-all; text-align: right; }
.ip-text.highlight { color: #fff; text-shadow: 0 0 10px rgba(59, 130, 246, 0.4); }
.ip-text.muted { color: #64748b; font-size: 1rem; }
.icon-btn { background: transparent; border: none; color: var(--text-muted); padding: 5px; }
.icon-btn:hover { color: var(--primary-accent); }

.isp-info {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: auto;
}

/* Map Card */
.map-card { grid-column: span 1; grid-row: span 2; padding: 0; overflow: hidden; position: relative; min-height: 300px; }
#map { width: 100%; height: 100%; }
/* Dark Mode Map Filter */
.leaflet-tile-pane { filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%); }
.map-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    z-index: 500;
}
#mapLink { color: var(--primary-accent); text-decoration: none; }

/* Detail Lists */
.detail-list { list-style: none; padding: 0; }
.detail-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.95rem;
}
.detail-list li:last-child { border-bottom: none; }
.detail-list li span:first-child { color: var(--text-muted); }
.flex-end { display: flex; align-items: center; gap: 8px; }
#countryFlag { height: 15px; border-radius: 2px; }
.truncate { max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Status Dot */
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.status-dot.safe { background: #10b981; box-shadow: 0 0 5px #10b981; }
.status-dot.warning { background: #ef4444; }

.actions-row { text-align: center; margin-top: 2rem; }
.tool-btn { padding: 12px 24px; background: rgba(255,255,255,0.05); color: #fff; font-size: 1rem; }
.tool-btn:hover { background: var(--primary-accent); border-color: var(--primary-accent); }

.error-banner {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: center;
}

.hidden { display: none !important; }

footer { text-align: center; padding: 3rem 0; color: var(--text-muted); font-size: 0.9rem; border-top: 1px solid var(--card-border); margin-top: 3rem; }
footer a { color: #fff; text-decoration: none; }

/* Responsive Grid */
@media (max-width: 992px) {
    .bento-grid { grid-template-columns: 1fr 1fr; }
    .hero-card { grid-column: span 2; }
    .map-card { grid-column: span 2; min-height: 250px; grid-row: auto; }
}

@media (max-width: 600px) {
    .bento-grid { grid-template-columns: 1fr; }
    .hero-card, .map-card { grid-column: span 1; }
    .search-bar-container { flex-direction: column; }
}