/* 
 * Escape Tsunami for Brainrots Calculator - Main Styles 
 * Aesthetic: Neon, Dark Mode, Roblox-inspired, High Contrast
 */

:root {
    --neon-green: #39ff14;
    --neon-purple: #bc13fe;
    --neon-blue: #04d9ff;
    --neon-red: #ff073a;
    --dark-bg: #0a0a12;
    --card-bg: #161625;
    --text-main: #ffffff;
    --text-muted: #b0b0b0;
    --roblox-blue: #00a2ff;
    --glass: rgba(255, 255, 255, 0.05);
    --border-radius: 12px;
    --nav-bg: rgba(10, 10, 18, 0.9);
}

/* Light Mode Overrides */
body.light-mode {
    --dark-bg: #f0f2f5;
    --card-bg: #ffffff;
    --text-main: #1a1a1a;
    --text-muted: #555555;
    --glass: rgba(0, 0, 0, 0.05);
    --nav-bg: rgba(255, 255, 255, 0.95);
    --input-bg: rgba(0, 0, 0, 0.05);
    --border-color: rgba(0, 0, 0, 0.1);
}

/* Default Dark Mode Vars (Implicit in root, but defining new ones) */
:root {
    /* ... existing vars ... */
    --input-bg: rgba(0, 0, 0, 0.3);
    --border-color: rgba(255, 255, 255, 0.1);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--dark-bg);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Navigation */
.main-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.logo span {
    color: var(--neon-green);
}

.nav-links {
    display: flex;
    gap: 0.8rem;
    margin-left: auto;
}

.nav-links a {
    font-weight: 600;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--neon-blue);
    text-shadow: 0 0 10px rgba(4, 217, 255, 0.5);
}

.dropdown {
    position: relative;
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    min-width: 200px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    flex-direction: column;
}

.dropdown:hover .dropdown-content {
    display: flex;
}

.dropdown-content a {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-content a:hover {
    background: var(--glass);
}

#theme-toggle {
    background: var(--glass);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#theme-toggle:hover {
    transform: rotate(15deg);
    background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    position: relative;
    height: 60vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    filter: brightness(0.4);
}

.hero-img.active {
    opacity: 1;
}

.hero-content {
    max-width: 800px;
    padding: 2rem;
    z-index: 1;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.neon-text {
    color: var(--neon-purple);
    text-shadow: 0 0 15px rgba(188, 19, 254, 0.6);
}

.hero-content p {
    font-size: 1.2rem;
    color: #ffffff;
    margin-bottom: 2rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
    background: var(--neon-green);
    color: #000;
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.4);
    margin-right: 1rem;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(57, 255, 20, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #fff;
    color: #fff;
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    background: #fff;
    color: #000;
}

/* Calculators Section */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.calculators-section {
    margin-top: -3rem;
    /* Overlap hero slightly */
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass);
    overflow: hidden;
    position: relative;
    z-index: 10;
}

/* Tabs */
.calc-tabs {
    display: flex;
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.calc-tab {
    flex: 1;
    min-width: 120px;
    padding: 1.2rem 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.calc-tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.02);
}

.calc-tab.active {
    color: var(--neon-blue);
    border-bottom-color: var(--neon-blue);
    background: rgba(4, 217, 255, 0.05);
}

/* Individual Tab Colors */
.calc-tab-earnings {
    background: rgba(57, 255, 20, 0.15);
    color: var(--text-main);
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.calc-tab-earnings:hover,
.calc-tab-earnings.active {
    background: rgba(57, 255, 20, 0.35);
    border-bottom-color: var(--neon-green);
    box-shadow: inset 0 0 15px rgba(57, 255, 20, 0.2);
}

.calc-tab-rebirth {
    background: rgba(188, 19, 254, 0.15);
    color: var(--text-main);
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.calc-tab-rebirth:hover,
.calc-tab-rebirth.active {
    background: rgba(188, 19, 254, 0.35);
    border-bottom-color: var(--neon-purple);
    box-shadow: inset 0 0 15px rgba(188, 19, 254, 0.2);
}

.calc-tab-speed {
    background: rgba(4, 217, 255, 0.15);
    color: var(--text-main);
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.calc-tab-speed:hover,
.calc-tab-speed.active {
    background: rgba(4, 217, 255, 0.35);
    border-bottom-color: var(--neon-blue);
    box-shadow: inset 0 0 15px rgba(4, 217, 255, 0.2);
}

.calc-tab-time {
    background: rgba(255, 7, 58, 0.15);
    color: var(--text-main);
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.calc-tab-time:hover,
.calc-tab-time.active {
    background: rgba(255, 7, 58, 0.35);
    border-bottom-color: var(--neon-red);
    box-shadow: inset 0 0 15px rgba(255, 7, 58, 0.2);
}

.calc-tab-advanced {
    background: rgba(0, 162, 255, 0.15);
    color: var(--text-main);
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.calc-tab-advanced:hover,
.calc-tab-advanced.active {
    background: rgba(0, 162, 255, 0.35);
    border-bottom-color: var(--roblox-blue);
    box-shadow: inset 0 0 15px rgba(0, 162, 255, 0.2);
}

/* Calculator Content */
.calc-display {
    padding: 2rem;
    min-height: 400px;
}

.calc-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.calc-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.calc-desc {
    margin-bottom: 2rem;
    color: var(--text-muted);
}

.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.input-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

input,
select {
    width: 100%;
    padding: 1rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px rgba(4, 217, 255, 0.1);
}

button.calc-btn,
button#add-brainrot {
    width: 100%;
    padding: 1rem;
    background: var(--roblox-blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 162, 255, 0.3);
    transition: transform 0.1s;
}

button:active {
    transform: scale(0.98);
}

/* Results Box */
.results-box {
    background: rgba(57, 255, 20, 0.05);
    border: 1px solid var(--neon-green);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
}

.results-box h3 {
    color: var(--neon-green);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.result-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-main);
    text-shadow: 0 0 20px rgba(57, 255, 20, 0.4);
    margin-bottom: 0.5rem;
}

.result-sub {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.advice-text {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
    color: #fff;
}

/* Info Section */
.info-section {
    margin-top: 4rem;
    padding: 2rem;
}

.info-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--neon-blue);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--neon-purple);
}

.feature-card h3 {
    color: var(--neon-purple);
    margin-bottom: 1rem;
}

/* Brainrot Showcase */
.updates-section {
    margin: 4rem 0;
    text-align: center;
}

.brainrot-showcase {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.brainrot-card {
    width: 100%;
    min-height: 180px;
    padding: 1.5rem;
    border-radius: 16px;
    position: relative;
    border: 1px solid var(--border-color);
    overflow: hidden;
    color: var(--text-main);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.brainrot-card .badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.7rem;
    font-weight: 900;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    color: #000;
}

.brainrot-card.celestial {
    border-bottom: 4px solid #ffffff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.brainrot-card.celestial .badge {
    background: #ffffff;
    color: #000;
}

.brainrot-card.secret {
    border-bottom: 4px solid #ff0055;
}

.brainrot-card.secret .badge {
    background: #ff0055;
    color: #fff;
}

.brainrot-card.cosmic {
    border-bottom: 4px solid #04d9ff;
}

.brainrot-card.cosmic .badge {
    background: #04d9ff;
    color: #000;
}

.brainrot-card.mythical {
    border-bottom: 4px solid #bc13fe;
}

.brainrot-card.mythical .badge {
    background: #bc13fe;
    color: #fff;
}

/* Handling "mythic" typo from old code compatibility */
.brainrot-card.mythic {
    border-bottom: 4px solid #bc13fe;
}

.brainrot-card.mythic .badge {
    background: #bc13fe;
    color: #fff;
}

.brainrot-card.legendary {
    border-bottom: 4px solid #ffaa00;
}

.brainrot-card.legendary .badge {
    background: #ffaa00;
    color: #000;
}

.brainrot-card.epic {
    border-bottom: 4px solid #9900ff;
}

.brainrot-card.epic .badge {
    background: #9900ff;
    color: #fff;
}

.brainrot-card.rare {
    border-bottom: 4px solid #00a2ff;
}

.brainrot-card.rare .badge {
    background: #00a2ff;
    color: #fff;
}

.brainrot-card.uncommon {
    border-bottom: 4px solid #39ff14;
}

.brainrot-card.uncommon .badge {
    background: #39ff14;
    color: #000;
}

.brainrot-card.common {
    border-bottom: 4px solid #888;
}

.brainrot-card.common .badge {
    background: #888;
    color: #fff;
}

/* Footer */
footer {
    background: #050508;
    padding: 4rem 1rem 1rem;
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    color: var(--text-main);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer-col ul li {
    margin-bottom: 0.8rem;
}

.footer-col ul li a {
    color: var(--text-muted);
    transition: color 0.2s;
}

.footer-col ul li a:hover {
    color: var(--neon-green);
}

.copyright {
    text-align: center;
    color: #444;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

/* Dex Controls */
.dex-controls {
    margin: 2rem 0;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 50;
    /* Fix for dropdown overlapping with grid */
}

.dex-grid {
    position: relative;
    z-index: 1;
}

/* Ensure dropdown options are readable */
select option {
    background: var(--card-bg);
    color: var(--text-main);
}

/* Mobile Responsive */
@media (max-width: 768px) {

    /* Side Drawer Mobile Menu */
    .nav-links {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: -100%;
        /* Hidden off-screen */
        left: auto;
        bottom: 0;
        /* Full height */
        width: 75%;
        max-width: 300px;
        height: 100vh;
        background: var(--nav-bg);
        padding: 5rem 1.5rem 2rem 1.5rem;
        /* Padding for top button */
        gap: 1rem;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(15px);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        /* Enable scrolling */
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
    }

    .nav-links.active {
        right: 0;
        opacity: 1;
        visibility: visible;
    }

    .mobile-menu-btn {
        display: block;
        font-size: 1.8rem;
        cursor: pointer;
        padding: 0.5rem;
        position: relative;
        z-index: 1001;
        /* Ensure button stays above the menu */
    }

    .hero h1 {
        font-size: 2rem;
    }

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

    .calculators-section {
        margin-top: 0;
        border-radius: 0;
    }

    /* Fix Mobile Dropdown Positioning */
    .dropdown-content {
        position: relative;
        top: 0;
        right: auto;
        left: 0;
        width: 100%;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.05);
        /* Slight contrast */
        border: none;
        padding-left: 1rem;
        /* Indent items */
    }

    .dropdown-content a {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--neon-blue);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Tier List Specific */
.tier-section {
    margin-bottom: 3rem;
}

.tier-section h2 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--neon-purple);
    display: inline-block;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Guide Section */
.guide-section {
    margin-bottom: 3rem;
}

.guide-section h2 {
    color: var(--neon-green);
    margin-bottom: 1.5rem;
}

.guide-section ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
    list-style: disc;
}

.guide-section ul li {
    margin-bottom: 1rem;
    color: var(--text-main);
}

/* Alert/Info Boxes */
.alert-box {
    margin-bottom: 2rem;
}

.alert-box h3 {
    margin-bottom: 0.5rem;
}

/* References & Sources Section */
.references-section {
    margin: 40px 0;
    padding: 30px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 15px;
    border: 1px solid var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 163, 255, 0.2);
}

.references-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--neon-blue);
    display: flex;
    align-items: center;
    gap: 10px;
}

.references-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.ref-item {
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border-left: 3px solid var(--neon-purple);
}

.ref-item h3 {
    font-size: 1rem;
    margin-bottom: 5px;
    color: #fff;
}

.ref-item p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.ref-link {
    font-size: 0.85rem;
    color: var(--neon-green);
    font-weight: 600;
    text-decoration: underline;
    transition: filter 0.2s;
}

.ref-link:hover {
    filter: brightness(1.2);
}
