:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --border-color: #334155;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-blue: #38bdf8;
    --accent-blue-hover: #0ea5e9;
    --accent-indigo: #6366f1;
    --accent-green: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* Typography & Utilities */
.font-mono {
    font-family: var(--font-mono);
}

.text-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Navbar */
.navbar {
    background-color: rgba(30, 41, 59, 0.95);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.9rem 0;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.brand-icon {
    font-size: 1.5rem;
}

.brand-name strong {
    color: var(--accent-blue);
    font-weight: 800;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

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

/* Badges & Tags */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.badge-primary {
    background-color: rgba(56, 189, 248, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-secondary {
    background-color: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-weight: 600;
    display: inline-block;
}

.tag-blue {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-blue);
}

.tag-gray {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
}

.tag-green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.tag-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-warning);
}

/* Hero Section */
.hero-section {
    padding: 2.5rem 0 1.75rem;
    text-align: center;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 680px;
    margin: 0 auto 1.5rem;
}

/* Search Form */
.search-form {
    max-width: 780px;
    margin: 0 auto 1rem;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    padding: 0.4rem 0.5rem;
    gap: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input-wrapper:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.search-icon {
    font-size: 1.2rem;
    padding-left: 0.8rem;
    opacity: 0.7;
}

.search-input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 1rem;
    font-family: var(--font-mono);
    padding: 0.6rem 0.5rem;
}

.search-input-wrapper input::placeholder {
    color: #64748b;
    font-family: var(--font-sans);
}

/* Buttons */
.btn {
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn-primary {
    background-color: var(--accent-blue);
    color: #041226;
}

.btn-primary:hover {
    background-color: var(--accent-blue-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: rgba(148, 163, 184, 0.15);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(148, 163, 184, 0.25);
}

.copy-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
}

.copy-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Error Banner */
.error-banner {
    margin: 1rem auto 0;
    max-width: 780px;
    padding: 0.75rem 1.25rem;
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    border-radius: 10px;
    font-size: 0.9rem;
    text-align: left;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

/* WebRTC Real IP Leak Section */
.webrtc-section {
    margin-bottom: 2.5rem;
}

.webrtc-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.webrtc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.webrtc-card {
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid #293548;
    border-radius: 12px;
    padding: 1.15rem;
}

.webrtc-card-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.webrtc-card-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.35rem;
}

.webrtc-card-sub {
    font-size: 0.8rem;
    color: #64748b;
}

.webrtc-status-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.webrtc-status-text {
    margin-bottom: 0.5rem;
}

.webrtc-actions {
    margin-top: auto;
}

.webrtc-details {
    border-top: 1px solid #293548;
    padding-top: 1rem;
}

.webrtc-details summary {
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--accent-blue);
    font-weight: 600;
    user-select: none;
    outline: none;
}

.webrtc-details summary:hover {
    color: var(--accent-blue-hover);
}

#webrtc-candidates-log {
    margin-top: 0.75rem;
    background-color: #0b1120;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.78rem;
    color: #94a3b8;
    max-height: 180px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Section Common */
.results-section, .map-section, .comparison-section {
    margin-bottom: 2.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.section-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
}

.status-indicator {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.status-indicator.live {
    background-color: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

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

.section-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: -0.5rem;
    margin-bottom: 1.25rem;
}

/* Single Overview Box */
.overview-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 0.5rem 1.75rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.info-row {
    display: flex;
    align-items: center;
    padding: 0.85rem 0;
    border-bottom: 1px solid #273549;
}

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

.info-label {
    min-width: 240px;
    width: 240px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.info-value-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    flex-wrap: wrap;
    min-width: 0;
}

.info-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    word-break: break-word;
}

.info-value.highlight {
    font-size: 1.25rem;
    color: var(--accent-blue);
    font-weight: 700;
}

.flag-icon {
    font-size: 1.35rem;
}

@media (max-width: 768px) {
    .overview-box {
        padding: 0.5rem 1.2rem;
    }
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
        padding: 0.75rem 0;
    }
    .info-label {
        width: 100%;
        min-width: 0;
        font-size: 0.78rem;
    }
    #map {
        height: 260px;
    }
    .map-header-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* Map Section */
.map-wrapper {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    position: relative;
}

#map {
    height: 420px;
    width: 100%;
    background-color: #1e293b;
}

.map-header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.map-coordinates-badge {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.1);
    padding: 0.3rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

/* Comparison Table */
.table-responsive {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background-color: var(--bg-card);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.925rem;
}

.comparison-table th {
    background-color: #162032;
    color: var(--text-muted);
    font-weight: 600;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.comparison-table td {
    padding: 1rem;
    border-bottom: 1px solid #273549;
    color: var(--text-main);
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table tr:hover td {
    background-color: rgba(56, 189, 248, 0.03);
}

.provider-name {
    color: var(--accent-blue);
    font-weight: 700;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: #0f172a;
    color: #38bdf8;
    border: 1px solid #38bdf8;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Footer */
.footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding: 1.75rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.75rem;
    }
    .search-input-wrapper {
        flex-direction: column;
        align-items: stretch;
        padding: 0.75rem;
    }
    .search-icon {
        display: none;
    }
    .grid-cards {
        grid-template-columns: 1fr;
    }
    .map-coordinates-badge {
        display: none;
    }
}
