:root {
    /* Palette from main site */
    --primary-blue: #3B5BDB;
    --primary-blue-light: #4C6EF5;
    --magic-purple: #845EF7;
    --magic-purple-light: #B197FC;
    --text-dark: #111827;
    --text-gray: #4B5563;
    --text-light: #9CA3AF;
    --bg-white: #FFFFFF;
    --bg-gray: #F8F9FA;
    --success-green: #10B981;
    --border-color: #E5E7EB;

    --gradient-magic: linear-gradient(135deg, var(--primary-blue) 0%, var(--magic-purple) 100%);
    --gradient-magic-hover: linear-gradient(135deg, var(--primary-blue-light) 0%, var(--magic-purple-light) 100%);

    --container-width: 1200px;
}

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

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-gray);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
header {
    background: white;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

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

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

.logo-img {
    height: 32px;
    width: auto;
}

.logo span span {
    color: var(--magic-purple);
}

.back-link {
    color: var(--text-gray);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s;
}

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

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        text-align: center;
    }

    .logo {
        margin-bottom: 0.5rem;
    }
}

/* Main Layout */
.calculator-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
    padding-bottom: 4rem;
}

@media (max-width: 900px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 1.75rem;
    }

    .sticky-results {
        padding: 1.5rem;
    }

    .main-result .result-value {
        font-size: 2.25rem;
    }

    .result-card {
        padding: 1rem;
    }

    .results-grid .result-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* Inputs Section */
h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

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

/* Nav Dropdown */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropbtn {
    background-color: transparent;
    color: var(--text-gray);
    padding: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.2s;
}

.nav-dropdown:hover .nav-dropbtn {
    color: var(--primary-blue);
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    background-color: #ffffff;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.1);
    z-index: 1;
    border-radius: 8px;
    padding: 0.5rem 0;
    border: 1px solid var(--border-color);
    left: 50%;
    transform: translateX(-50%);
}

.nav-dropdown-content a {
    color: var(--text-dark);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
}

.nav-dropdown-content a:hover {
    background-color: var(--bg-gray);
    color: var(--primary-blue);
}

.nav-dropdown:hover .nav-dropdown-content {
    display: block;
}

.input-group {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.input-group h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--primary-blue);
}

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

.input-wrapper:last-child {
    margin-bottom: 0;
}

.label-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.value-display {
    color: var(--primary-blue);
    font-weight: 700;
    font-family: monospace;
    font-size: 1.1rem;
}

/* Custom Slider Styling */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]:focus {
    outline: none;
}

/* Slider Track */
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: #E5E7EB;
    border-radius: 99px;
}

input[type=range]::-moz-range-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: #E5E7EB;
    border-radius: 99px;
}

/* Slider Thumb */
input[type=range]::-webkit-slider-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--primary-blue);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -7px;
    /* center thumb on track */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: var(--primary-blue-light);
}

@media (max-width: 768px) {
    input[type=range]::-webkit-slider-thumb {
        height: 28px;
        width: 28px;
        margin-top: -11px;
        /* Center larger thumb */
    }
}

input[type=range]::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border: none;
    border-radius: 50%;
    background: var(--primary-blue);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s;
}

input[type=range]::-moz-range-thumb:hover {
    transform: scale(1.1);
    background: var(--primary-blue-light);
}

@media (max-width: 768px) {
    input[type=range]::-moz-range-thumb {
        height: 28px;
        width: 28px;
    }
}

/* Results Section */
.sticky-results {
    position: sticky;
    top: 2rem;
    background: var(--text-dark);
    color: white;
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.sticky-results h2 {
    color: white;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.result-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.main-result {
    background: var(--gradient-magic);
    text-align: center;
    border: none;
    padding: 2rem;
    box-shadow: 0 10px 30px -5px rgba(132, 94, 247, 0.5);
}

.main-result .result-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.5rem;
}

.main-result .result-value {
    font-size: 3.5rem;
    font-weight: 800;
}

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

.results-grid .result-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.results-grid .result-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.results-grid .result-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.cta-box {
    text-align: center;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cta-box p {
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    width: 100%;
}

.btn-primary {
    background: var(--gradient-magic);
    color: white !important;
}

.btn-primary:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Mobile Menu Styles */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    z-index: 1002;
    position: relative;
    margin-left: auto;
    /* Push to right */
}

.mobile-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--primary-blue);
    margin: 6px auto;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hamburger Animation */
.nav-links.active~.mobile-toggle span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.nav-links.active~.mobile-toggle span:nth-child(2) {
    opacity: 0;
}

.nav-links.active~.mobile-toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

@media (max-width: 900px) {
    .nav-links {
        display: block;
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 6rem 2rem 2rem;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        text-align: left;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1001;
        overflow-y: auto;
    }

    .nav-links.active {
        right: 0;
        display: flex;
    }

    .nav-links.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        z-index: -1;
        backdrop-filter: blur(2px);
        transform: translateX(-100%);
    }

    .mobile-toggle {
        display: block;
    }

    .nav-links a,
    .nav-dropbtn {
        display: block;
        font-size: 1.25rem;
        margin-bottom: 1.5rem;
        border-bottom: 1px solid #f3f4f6;
        padding-bottom: 0.5rem;
        width: 100%;
        text-align: left;
    }

    .nav-dropdown {
        display: block;
        width: 100%;
    }

    .nav-dropdown-content {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: 1rem;
        transform: none;
        display: block;
        width: 100%;
    }

    .nav-dropdown-content a {
        font-size: 1rem;
        border-bottom: none;
        margin-bottom: 0.5rem;
        padding: 0.5rem 0;
    }
}