:root {
    --bg-main: #0a0e27;
    --bg-panel: rgba(16, 23, 56, 0.6);
    --bg-panel-hover: rgba(22, 30, 70, 0.8);
    --border-color: rgba(255, 255, 255, 0.1);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --primary: #00d4ff;
    --primary-hover: #00b8e6;
    --purple: #7c3aed;
    --error: #ef4444;
    
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

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

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

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
}

.glow-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--purple) 0%, transparent 70%);
}

.glow-2 {
    bottom: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.2;
}

/* Typography & Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.text-primary { color: var(--primary); }
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hidden { display: none !important; }

/* Navigation */
.navbar {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    background: rgba(10, 14, 39, 0.8);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

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

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

/* Search Box */
.search-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.search-container:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 212, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.3);
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    color: var(--text-main);
    font-size: 1.1rem;
    font-family: var(--font-main);
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

select option {
    background-color: var(--bg-main);
    color: var(--text-main);
}

.search-btn {
    background: var(--primary);
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 0 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s, transform 0.1s;
}

.search-btn:hover {
    background: var(--primary-hover);
}

.search-btn:active {
    transform: scale(0.98);
}

.my-ip-badge {
    margin-top: 1rem;
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.2s;
}

.my-ip-badge:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

/* Layout */
.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-bottom: 4rem;
    max-width: 900px;
    margin: 0 auto;
}

/* Result Cards */
.result-card {
    margin-bottom: 2rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.badge-primary { background: rgba(0, 212, 255, 0.15); color: var(--primary); }
.badge-purple { background: rgba(124, 58, 237, 0.15); color: #a78bfa; }

.ip-main-info, .asn-main-info {
    text-align: center;
    margin-bottom: 2rem;
}

.ip-display, .asn-display {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.country-display, .asn-meta {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.detail-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 600;
    word-break: break-all;
}

.asn-link {
    color: var(--purple);
    cursor: pointer;
    text-decoration: underline;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Sidebar History */
.recent-searches h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.history-list {
    list-style: none;
}

.history-list li {
    padding: 0.8rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid transparent;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
}

.history-list li:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.history-list .empty-history {
    background: transparent;
    color: var(--text-muted);
    text-align: center;
    cursor: default;
}

.history-type {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 1rem;
    width: 100%;
    text-align: center;
}

.btn-text:hover { color: var(--error); }

/* Stats Page */
.page-header {
    text-align: center;
    margin: 3rem 0;
}

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

.stat-card {
    text-align: center;
    padding: 2rem;
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* Utilities */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}
.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.loading-spinner {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 212, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.btn-icon:hover { opacity: 1; }

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

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(10px);
}

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

/* Responsive */
@media (max-width: 900px) {
    .content-grid { grid-template-columns: 1fr; }
    .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .hero-title { font-size: 2rem; }
    .search-form { flex-direction: column; }
    .search-btn { padding: 1rem; justify-content: center; }
    .ip-display { font-size: 1.8rem; }
}

/* Animated Text Logo */
.logo-animated-text {
    background: linear-gradient(270deg, #7c3aed, #00d4ff, #7c3aed);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: gradient-text 3s linear infinite;
}

@keyframes gradient-text {
    to { background-position: 200% center; }
}
