/* =============================================
   GeoTrace — Design System & Styles
   ============================================= */

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.7);
    --bg-card-hover: rgba(15, 23, 42, 0.9);

    --accent-cyan: #00d4ff;
    --accent-violet: #7c3aed;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;
    --accent-amber: #f59e0b;

    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border-color: rgba(0, 212, 255, 0.12);
    --border-glow: rgba(0, 212, 255, 0.3);

    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-glow: 0 0 30px rgba(0, 212, 255, 0.1);
    --shadow-card: 0 4px 30px rgba(0, 0, 0, 0.3);

    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.15s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
}

input {
    border: none;
    background: none;
    font-family: inherit;
    color: inherit;
    outline: none;
}

img {
    max-width: 100%;
}

/* --- Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Animated Background --- */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    z-index: 0;
    pointer-events: none;
}

.bg-glow--1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.15), transparent 70%);
    top: -200px;
    right: -200px;
    animation: glowFloat1 15s ease-in-out infinite alternate;
}

.bg-glow--2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.12), transparent 70%);
    bottom: -150px;
    left: -150px;
    animation: glowFloat2 18s ease-in-out infinite alternate;
}

@keyframes glowFloat1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-80px, 80px) scale(1.2); }
}

@keyframes glowFloat2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, -60px) scale(1.15); }
}

/* --- Utility Classes --- */
.text-accent {
    color: var(--accent-cyan);
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Glass Card --- */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow), var(--shadow-card);
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    transition: var(--transition);
    background: transparent;
}

.header.scrolled {
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header__logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    display: flex;
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.4)); }
    50% { filter: drop-shadow(0 0 12px rgba(0, 212, 255, 0.7)); }
}

.header__title {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.header__nav {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--accent-cyan);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-cyan);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
    border-radius: 2px;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Nav */
.mobile-nav {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 999;
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    flex-direction: column;
    gap: 12px;
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.mobile-nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.mobile-nav__link {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 8px 0;
    transition: var(--transition);
}

.mobile-nav__link:hover {
    color: var(--accent-cyan);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn--primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
    color: #fff;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.25);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0, 212, 255, 0.4);
}

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

.btn--secondary {
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 212, 255, 0.25);
}

.btn--secondary:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--accent-cyan);
}

.btn--ghost {
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn--ghost:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
}

.btn--full {
    width: 100%;
}

/* --- Hero --- */
.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
}

.hero__inner {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-cyan);
    margin-bottom: 28px;
    animation: fadeUp 0.8s ease forwards;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.5); }
    50% { opacity: 0.7; box-shadow: 0 0 0 8px rgba(0, 212, 255, 0); }
}

.hero__title {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 24px;
    animation: fadeUp 0.8s 0.1s ease both;
}

.hero__subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto 36px;
    line-height: 1.7;
    animation: fadeUp 0.8s 0.2s ease both;
}

.hero__actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 60px;
    animation: fadeUp 0.8s 0.3s ease both;
}

.hero__stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    animation: fadeUp 0.8s 0.4s ease both;
}

.stat {
    text-align: center;
}

.stat__number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
}

.stat__suffix {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
}

.stat__label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

/* --- Section Shared --- */
.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* --- Tracer Section --- */
.tracer {
    position: relative;
    z-index: 1;
    padding: 80px 0;
}

.tracer__card {
    max-width: 640px;
    margin: 0 auto;
    padding: 32px;
}

/* Tabs */
.tabs {
    display: flex;
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 28px;
    gap: 4px;
}

.tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 6px;
    transition: var(--transition);
    z-index: 2;
}

.tab:hover {
    color: var(--text-secondary);
}

.tab.active {
    color: var(--text-primary);
}

.tab-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 6px);
    height: calc(100% - 8px);
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 6px;
    transition: var(--transition);
    z-index: 1;
}

.tab-indicator.phone {
    transform: translateX(calc(100% + 8px));
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeUp 0.3s ease;
}

/* Input */
.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: var(--transition);
    font-family: var(--font-mono);
}

.input::placeholder {
    color: var(--text-muted);
    font-family: var(--font-body);
}

.input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

/* Loader */
.loader {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px;
}

.loader.active {
    display: flex;
    animation: fadeUp 0.3s ease;
}

.loader__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 212, 255, 0.15);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader__text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Error */
.error-msg {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: rgba(244, 63, 94, 0.08);
    border: 1px solid rgba(244, 63, 94, 0.25);
    border-radius: var(--radius-sm);
    color: var(--accent-rose);
    font-size: 0.9rem;
    margin-top: 12px;
}

.error-msg.active {
    display: flex;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* --- Results Section --- */
.results {
    display: none;
    max-width: 1000px;
    margin: 40px auto 0;
}

.results.active {
    display: block;
    animation: fadeUp 0.5s ease;
}

.results__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.results__info {
    padding: 28px;
}

.results__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.results__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.results__title svg {
    color: var(--accent-cyan);
}

.copy-btn {
    padding: 8px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: var(--transition);
}

.copy-btn:hover {
    color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.1);
}

.copy-btn.copied {
    color: var(--accent-emerald);
}

/* Detail Grid */
.detail-grid {
    display: grid;
    gap: 4px;
}

.detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 8px;
    transition: var(--transition);
    animation: fadeUp 0.3s ease both;
}

.detail-row:nth-child(odd) {
    background: rgba(0, 0, 0, 0.15);
}

.detail-row:hover {
    background: rgba(0, 212, 255, 0.05);
}

.detail-row__label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-row__value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    font-family: var(--font-mono);
    text-align: right;
    word-break: break-all;
    max-width: 60%;
}

/* Map */
.results__map {
    padding: 6px;
    overflow: hidden;
}

.map-container {
    width: 100%;
    height: 100%;
    min-height: 380px;
    border-radius: var(--radius-md);
    z-index: 1;
}

/* Leaflet custom styles */
.leaflet-container {
    background: var(--bg-secondary) !important;
}

.custom-marker {
    position: relative;
}

.marker-pin {
    width: 24px;
    height: 24px;
    background: var(--accent-cyan);
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    animation: markerPulse 2s ease-in-out infinite;
}

@keyframes markerPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.5), 0 0 0 0 rgba(0, 212, 255, 0.3); }
    50% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.5), 0 0 0 12px rgba(0, 212, 255, 0); }
}

/* --- History --- */
.history {
    display: none;
    max-width: 1000px;
    margin: 40px auto 0;
}

.history.active {
    display: block;
    animation: fadeUp 0.4s ease;
}

.history__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.history__title svg {
    color: var(--accent-violet);
}

.history__list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.history-item:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.05);
}

.history-item__type {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.history-item__type--ip {
    background: var(--accent-cyan);
}

.history-item__type--phone {
    background: var(--accent-violet);
}

.history-item__query {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-primary);
}

.history-item__location {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* --- How It Works --- */
.how-it-works {
    position: relative;
    z-index: 1;
    padding: 80px 0 100px;
}

.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.step {
    padding: 36px 28px;
    text-align: center;
    flex: 1;
    max-width: 280px;
}

.step__number {
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.step__icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    background: rgba(0, 212, 255, 0.06);
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 16px;
    color: var(--accent-cyan);
    transition: var(--transition);
}

.step:hover .step__icon {
    background: rgba(0, 212, 255, 0.12);
    border-color: var(--accent-cyan);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.15);
}

.step__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.step__desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.step-connector {
    display: flex;
    align-items: center;
    padding: 0 8px;
    opacity: 0.4;
}

/* --- Disclaimer --- */
.disclaimer {
    position: relative;
    z-index: 1;
    padding: 0 0 80px;
}

.disclaimer__card {
    padding: 36px;
    text-align: center;
    max-width: 760px;
    margin: 0 auto;
    border-color: rgba(245, 158, 11, 0.15);
}

.disclaimer__card:hover {
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.05), var(--shadow-card);
}

.disclaimer__icon {
    color: var(--accent-amber);
    margin-bottom: 16px;
}

.disclaimer__title {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 14px;
    color: var(--accent-amber);
}

.disclaimer__text {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.disclaimer__text strong {
    color: var(--text-primary);
}

/* --- Footer --- */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
}

.footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.footer__tagline {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.footer__links {
    display: flex;
    gap: 28px;
}

.footer__links a {
    font-size: 0.88rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.footer__links a:hover {
    color: var(--accent-cyan);
}

.footer__copy {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ================================================
   Responsive Design
   ================================================ */
@media (max-width: 768px) {
    .header__nav { display: none; }
    .mobile-menu-btn { display: flex; }
    .mobile-nav { display: flex; }

    .hero { padding: 100px 0 60px; }
    .hero__title { font-size: 2.5rem; letter-spacing: -1px; }
    .hero__subtitle { font-size: 1rem; }
    .hero__stats { gap: 32px; }
    .stat__number { font-size: 1.8rem; }

    .section-title { font-size: 1.8rem; }

    .tracer__card { padding: 24px; }

    .input-group { flex-direction: column; }

    .results__grid {
        grid-template-columns: 1fr;
    }

    .map-container { min-height: 280px; }

    .steps { flex-direction: column; gap: 16px; }
    .step-connector {
        transform: rotate(90deg);
        padding: 4px 0;
    }
    .step { max-width: 100%; }

    .disclaimer__card { padding: 24px; }
}

@media (max-width: 480px) {
    .hero__title { font-size: 2rem; }
    .hero__actions { flex-direction: column; }
    .hero__stats { flex-direction: column; gap: 20px; }
    .tab svg { display: none; }
    .tab { font-size: 0.85rem; padding: 10px 12px; }
    .detail-row { flex-direction: column; align-items: flex-start; gap: 4px; }
    .detail-row__value { text-align: left; max-width: 100%; }

    .history__list { flex-direction: column; }

    .footer__links { flex-wrap: wrap; justify-content: center; gap: 16px; }
}
