/* ===================================
   IP Location - Premium Dark Theme
   =================================== */

/* CSS Variables */
:root {
    /* Colors - Dark mysterious palette */
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2234;
    --bg-card: rgba(26, 34, 52, 0.8);
    --bg-card-hover: rgba(30, 41, 59, 0.9);

    /* Accent colors */
    --accent-primary: #00d4ff;
    --accent-secondary: #0ea5e9;
    --accent-gold: #fbbf24;
    --accent-green: #10b981;
    --accent-purple: #8b5cf6;

    /* Text colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Borders */
    --border-color: rgba(148, 163, 184, 0.1);
    --border-glow: rgba(0, 212, 255, 0.3);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(0, 212, 255, 0.15);

    /* Spacing */
    --container-width: 1200px;
    --border-radius: 12px;
    --border-radius-lg: 16px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Effects */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(0, 212, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(14, 165, 233, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.25rem;
}

.logo-icon {
    font-size: 1.5rem;
    color: var(--accent-primary);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.logo-accent {
    color: var(--accent-primary);
}

.nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.1);
}

/* Language Switcher */
.lang-switcher {
    position: relative;
    margin-left: 8px;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: var(--border-glow);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 6px;
    min-width: 130px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-lg);
}

.lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lang-option:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.lang-option.active {
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent-primary);
}

/* Main Content */
.main {
    min-height: calc(100vh - 64px - 120px);
    padding: 40px 0 60px;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 48px;
}

.hero-content {
    margin-bottom: 32px;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* Search Box */
.search-box {
    max-width: 680px;
    margin: 0 auto;
}

.search-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 8px 8px 8px 20px;
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-glow);
}

.search-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), var(--shadow-glow);
}

.search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1rem;
    padding: 12px 16px;
    min-width: 0;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border: none;
    border-radius: 10px;
    color: var(--bg-primary);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

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

/* Results Section */
.results {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* IP Header Card */
.ip-header-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.ip-display {
    display: flex;
    align-items: center;
    gap: 20px;
}

.ip-flag {
    font-size: 3rem;
    line-height: 1;
}

.ip-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ip-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ip-value-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ip-value {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: 'SF Mono', Monaco, 'Consolas', monospace;
    color: var(--accent-primary);
}

.copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.copy-btn.copied {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.ip-location {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* IP Tags */
.ip-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ip-tag {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-residential {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.tag-idc {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.tag-unknown {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.tag-native {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.tag-broadcast {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Risk Score Card */
.risk-card {
    margin-bottom: 20px;
}

.risk-score-container {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.risk-score-bar {
    flex: 1;
    height: 12px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    overflow: hidden;
}

.risk-score-fill {
    height: 100%;
    width: 0%;
    background: #10b981;
    border-radius: 6px;
    transition: width 0.5s ease, background 0.3s ease;
}

.risk-score-value {
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 50px;
    text-align: right;
    color: var(--text-primary);
}

.risk-details {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.info-grid-2col {
    grid-template-columns: 1fr 2fr;
}

/* Result Cards */
.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.result-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(0, 212, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-icon {
    font-size: 1.25rem;
}

.card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-content {
    padding: 16px 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.05);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.info-value {
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    text-align: right;
    word-break: break-all;
    max-width: 60%;
}

/* Map */
.map-card {
    display: flex;
    flex-direction: column;
}

.map-card .card-header {
    flex-shrink: 0;
}

.map-container {
    flex: 1;
    min-height: 280px;
    background: var(--bg-tertiary);
}

#map {
    height: 100%;
    width: 100%;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

/* Loading State */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    margin-top: 16px;
    color: var(--text-secondary);
}

/* Error State */
.error {
    text-align: center;
    padding: 60px 20px;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.error-text {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.retry-btn {
    padding: 12px 28px;
    background: transparent;
    border: 1px solid var(--accent-primary);
    border-radius: 10px;
    color: var(--accent-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.retry-btn:hover {
    background: rgba(0, 212, 255, 0.1);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 32px 0;
    text-align: center;
}

.footer-links {
    margin-bottom: 16px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.footer-divider {
    color: var(--text-muted);
    margin: 0 12px;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-bottom: 8px;
}

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

.footer-text a:hover {
    color: var(--accent-primary);
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Hidden */
.hidden {
    display: none !important;
}

/* ===================================
   Content Pages (About, Privacy)
   =================================== */
.page-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 24px;
}

.page-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 32px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-section {
    margin-bottom: 40px;
}

.page-section h2 {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.page-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
}

.page-section ul {
    color: var(--text-secondary);
    margin-left: 24px;
    margin-bottom: 16px;
}

.page-section li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.page-section a {
    color: var(--accent-primary);
    text-decoration: none;
}

.page-section a:hover {
    text-decoration: underline;
}

.last-updated {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-style: italic;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 992px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .info-grid-2col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header .container {
        height: auto;
        padding: 12px 20px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .nav {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .search-wrapper {
        flex-direction: column;
        padding: 12px;
        gap: 12px;
    }

    .search-icon {
        display: none;
    }

    .search-input {
        width: 100%;
        padding: 12px;
        text-align: center;
    }

    .search-btn {
        width: 100%;
        justify-content: center;
    }

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

    .ip-header-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }

    .ip-value {
        font-size: 1.375rem;
    }

    .page-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .nav-link {
        padding: 6px 12px;
        font-size: 0.8125rem;
    }

    .main {
        padding: 24px 0 40px;
    }

    .hero {
        margin-bottom: 32px;
    }

    .card-header {
        padding: 14px 16px;
    }

    .card-content {
        padding: 12px 16px;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .info-value {
        max-width: 100%;
        text-align: left;
    }
}

/* Leaflet Customization */
.leaflet-container {
    font-family: inherit;
}

.leaflet-popup-content-wrapper {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
}

.leaflet-popup-tip {
    background: var(--bg-tertiary);
}

.leaflet-popup-content {
    margin: 12px 16px;
    font-size: 0.875rem;
}

.leaflet-control-zoom a {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.leaflet-control-zoom a:hover {
    background: var(--bg-card-hover) !important;
}

.leaflet-control-attribution {
    background: rgba(26, 34, 52, 0.9) !important;
    color: var(--text-muted) !important;
    font-size: 0.6875rem !important;
}

.leaflet-control-attribution a {
    color: var(--text-secondary) !important;
}