:root {
    --bg-color: #050511;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --glass-blur: 20px;

    --primary-neon: #00f2ea;
    --secondary-neon: #ff0050;
    --text-main: #ffffff;
    --text-muted: #8e9bb3;

    --success: #00e676;
    --danger: #ff1744;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: hidden;
    min-height: 100vh;
}

/* WebGL Background */
.webgl-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: all;
    /* Allow 3D interaction */
    background: radial-gradient(circle at 50% 50%, #1a1a2e 0%, #050511 100%);
}

/* Typography & Utilities */
h1,
h2,
h3 {
    font-family: var(--font-heading);
}

.gradient-text {
    background: linear-gradient(135deg, #fff 0%, #a5a5a5 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 3.5rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 1rem;
}

.gradient-text span {
    background: linear-gradient(90deg, var(--primary-neon), var(--secondary-neon));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 500px;
}

/* Navigation */
.glass-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(5, 5, 17, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    z-index: 100;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
}

.logo i {
    color: #ffd700;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
}

.cta-button {
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-button.primary {
    background: linear-gradient(90deg, var(--primary-neon), var(--secondary-neon));
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 0, 80, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 80, 0.4);
}

/* Hero Section */
.hero {
    padding: 7rem 2rem 2rem;
    /* Reduced top/bottom padding */
    min-height: auto;
    /* Removed 80vh forcing */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-content {
    max-width: 800px;
    /* Constrain width for readability */
    width: 100%;
    margin: 0 auto;
}

/* Hide the spacer as we are using a centered layout now */
.hero-spacer {
    display: none;
}

.stats-row {
    display: flex;
    gap: 3rem;
    margin-top: 2rem;
    justify-content: center;
    /* Center stats */
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-val {
    font-size: 2.5rem;
    /* Slightly larger for impact */
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--text-main);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.2rem;
    margin: 0 auto 2rem;
    /* Center margin */
    max-width: 600px;
}

/* Tools Container */
.tools-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    /* Above canvas */
}

/* Glass Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
}

.glass-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.card-header i {
    font-size: 1.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.icon-neon {
    color: var(--primary-neon);
}

.icon-blue {
    color: #4e8cff;
}

/* Calculator Styles */
.calc-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.input-group label {
    display: block;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    padding: 1rem;
    border-radius: 10px;
    color: var(--text-main);
    font-size: 1.2rem;
    font-family: var(--font-heading);
    margin-bottom: 1.5rem;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-neon);
}

.result-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.price-danger {
    color: var(--danger);
    font-weight: 600;
    text-decoration: line-through;
}

.price-success {
    color: var(--success);
    font-weight: 700;
    font-size: 1.1rem;
}

.divider {
    height: 1px;
    background: var(--card-border);
    margin: 1rem 0;
}

.saving-badge {
    text-align: center;
    background: rgba(0, 230, 118, 0.1);
    color: var(--success);
    padding: 0.8rem;
    border-radius: 10px;
    font-weight: 600;
}

/* Premium Table Styles */
.table-container {
    overflow-x: auto;
    padding-bottom: 1rem;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem; /* Space between rows for floating effect */
}

th,
td {
    padding: 1rem 1.2rem;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
    border: none;
}

th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

tbody tr {
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s ease;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.01);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

tbody td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

tbody td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

td {
    font-weight: 600;
}

/* Region cell inner layout */
td .region-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

td .region-cell img {
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    width: 28px;
    height: 20px;
    object-fit: cover;
}

.live-badge {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--danger);
    background: rgba(255, 23, 68, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* Guide Section */
.content-section {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 2rem;
}

.content-section h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.step-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 2rem;
    border-radius: 20px;
    position: relative;
}

.step-num {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.05);
    position: absolute;
    top: 10px;
    right: 20px;
}

.step-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-neon);
}

.step-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

footer {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    border-top: 1px solid var(--card-border);
    margin-top: 4rem;
}

/* Custom Number Input Controls */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

.number-control {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0.5rem;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.3s;
}

.number-control:focus-within {
    border-color: var(--primary-neon);
}

.number-control input {
    flex: 1;
    background: transparent;
    border: none !important;
    text-align: center;
    margin-bottom: 0 !important;
    padding: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.number-control input:focus {
    outline: none;
    box-shadow: none;
}

.num-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.num-btn:hover {
    background: rgba(0, 242, 234, 0.1);
    color: var(--primary-neon);
    border-color: var(--primary-neon);
    transform: translateY(-1px);
}

.num-btn:active {
    transform: translateY(1px);
    background: rgba(0, 242, 234, 0.2);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .gradient-text {
        font-size: 2.5rem;
    }

    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 6rem;
    }

    .stats-row {
        justify-content: center;
    }

    .nav-links {
        display: none;
    }

    /* Simplified for mobile MVP */
    .steps-grid {
        grid-template-columns: 1fr;
    }
}

/* Article Page Styles */
.article-container {
    max-width: 800px;
    margin: 8rem auto 4rem;
    padding: 2rem;
}

.article-header {
    text-align: center;
    margin-bottom: 4rem;
}

.article-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.article-content {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 3rem;
    backdrop-filter: blur(var(--glass-blur));
}

.article-content h2 {
    color: var(--primary-neon);
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.article-content h3 {
    color: #fff;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.article-content p {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: var(--text-muted);
}

.article-content li {
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

.article-content strong {
    color: var(--text-main);
}

.article-content a {
    color: var(--primary-neon);
    text-decoration: none;
    border-bottom: 1px dashed var(--primary-neon);
}

.article-content a:hover {
    border-bottom-style: solid;
}

.breadcrumb {
    margin-bottom: 2rem;
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 600;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary-neon);
}

.nav-buttons-footer {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--card-border);
    flex-wrap: wrap;
}

.cta-button.secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-main);
}

.cta-button.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

.related-articles {
    margin-top: 4rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.related-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 1.5rem;
    border-radius: 15px;
    transition: transform 0.2s;
    text-decoration: none;
    display: block;
}

.related-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.related-card h4 {
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.related-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}