:root {
    /* Light Theme Tokens */
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --text-primary: #111111;
    --text-secondary: #666666;
    --border-color: #eaeaea;
    --accent-color: #000000;
    --card-bg: #ffffff;
    --card-hover: #fcfcfc;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.05);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
}

[data-theme="dark"] {
    /* Dark Theme Tokens */
    --bg-primary: #000000;
    --bg-secondary: #111111;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --border-color: #333333;
    --accent-color: #ffffff;
    --card-bg: #0a0a0a;
    --card-hover: #141414;
    --shadow-sm: 0 2px 4px rgba(255,255,255,0.02);
    --shadow-md: 0 4px 12px rgba(255,255,255,0.05);
    --shadow-hover: 0 8px 30px rgba(255,255,255,0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-text {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.logo-sub {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
}

/* Theme Toggle */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background-color: var(--bg-secondary);
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* Layout */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 4rem 2rem;
    flex-grow: 1;
    width: 100%;
}

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

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    display: block;
    text-decoration: none;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--text-secondary);
    background-color: var(--card-hover);
}

.tool-icon {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.tool-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.tool-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* IP Page */
.page-header {
    margin-bottom: 3rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--text-primary);
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.ip-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.data-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.data-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--text-secondary);
}

.data-card.full-width {
    grid-column: 1 / -1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.ip-value {
    font-size: 1.75rem;
    font-family: monospace;
    font-weight: 500;
    word-break: break-all;
}

.geo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.geo-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.geo-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.geo-value {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Status Indicator */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981; /* Success green */
}

.status-indicator.loading {
    background-color: #f59e0b; /* Warning yellow */
    animation: pulse 1.5s infinite;
}

.status-indicator.error {
    background-color: #ef4444; /* Error red */
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

.api-info {
    grid-column: 1 / -1;
    margin-top: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.api-link {
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .ip-container {
        grid-template-columns: 1fr;
    }
    .geo-grid {
        grid-template-columns: 1fr;
    }
    .hero-title {
        font-size: 2.5rem;
    }
}

/* VPN Status */
.vpn-status-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3rem;
}

.status-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: all 0.5s ease;
}

.status-circle svg {
    width: 60px;
    height: 60px;
    color: white;
}

.circle-success {
    background-color: #10b981;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
}

.circle-danger {
    background-color: #ef4444;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
}

.circle-unknown {
    background-color: #f59e0b;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.4);
}

.status-text {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Loading Spinner for VPN check */
.loading-spinner {
    animation: rotate 2s linear infinite;
    width: 60px;
    height: 60px;
}
.loading-spinner .path {
    stroke: var(--text-secondary);
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}
@keyframes rotate { 100% { transform: rotate(360deg); } }
@keyframes dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}
