:root {
    --primary-color: #1a365d;  /* Darker blue */
    --text-color: #2d3748;    /* Dark gray-blue */
    --border-color: #e2e8f0;
    --background-color: rgba(255, 255, 255, 0.92);
    --slider-color: #3182ce;  /* Bright blue */
    --button-hover: #2c5282;  /* Darker bright blue */
    --success-color: #059669;
    --secondary-color: #1e40af;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    min-height: 100vh;
    background: linear-gradient(135deg, 
        #1a365d 0%,      /* Dark blue */
        #2c5282 30%,     /* Medium blue */
        #2b6cb0 60%,     /* Lighter blue */
        #2c5282 100%     /* Back to medium blue */
    );
    background-attachment: fixed;
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

main {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    padding: 3.5rem 1rem 5rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    background: linear-gradient(to bottom right, 
        rgba(26, 54, 93, 0.97),    /* Dark blue */
        rgba(44, 82, 130, 0.92)     /* Medium blue */
    );
    margin-bottom: -3rem;
    position: relative;
    overflow: hidden;
    border-bottom-left-radius: 30% 5rem;
    border-bottom-right-radius: 30% 5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right,
        var(--slider-color),
        #63b3ed,  /* Lighter blue */
        var(--slider-color)
    );
}

header::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 150%;
    height: 12rem;
    background: linear-gradient(to right,
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0.05)
    );
    z-index: 1;
}

header .circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
}

header .circle-1 {
    width: 15rem;
    height: 15rem;
    top: -5rem;
    left: -5rem;
    opacity: 0.1;
}

header .circle-2 {
    width: 10rem;
    height: 10rem;
    bottom: -2rem;
    right: -2rem;
    opacity: 0.15;
}

header h1 {
    font-size: 3.2rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    line-height: 1.2;
    position: relative;
    z-index: 2;
    margin: 0;
    padding: 0;
}

header h1::after {
    display: none;
}

header .tagline {
    font-size: 1.4rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
    position: relative;
    z-index: 2;
}

section {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: var(--background-color);
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

section:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

footer {
    text-align: center;
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    margin-bottom: 2rem;
}

footer .disclaimer {
    color: var(--text-color);
    opacity: 0.9;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

footer .copyright {
    color: var(--text-color);
    opacity: 0.7;
    font-size: 0.85rem;
}

.calculator, .assumptions, .results {
    margin-bottom: 2rem;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

input:focus, button:focus {
    outline: 2px solid var(--slider-color);
    outline-offset: 2px;
}

@media (max-width: 768px) {
    main {
        margin: 1rem;
        padding: 1rem;
    }

    header {
        padding: 2rem 1rem;
    }

    header h1 {
        font-size: 2.5rem;
    }

    header .tagline {
        font-size: 1.2rem;
    }

    section {
        padding: 1rem;
    }
}

.calculator-container {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    margin-bottom: 2rem;
}

.input-section {
    margin-bottom: 2rem;
}

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

.input-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

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

.calculate-btn {
    background: var(--slider-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 1rem;
}

.calculate-btn:hover {
    background: var(--button-hover);
    transform: translateY(-1px);
}

.results {
    border-top: 2px solid var(--border-color);
    padding-top: 2rem;
    margin-top: 2rem;
}

.ballpark-heading {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.results h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.years-result {
    text-align: center;
    margin: 2rem 0 1rem 0;
}

#years {
    font-size: 3rem;
    font-weight: bold;
    color: var(--success-color);
}

.years-label {
    font-size: 1.5rem;
    margin-left: 0.5rem;
}

.disclaimer {
    background-color: #fee2e2;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 0 0 2rem 0;
    border: 1px solid #fca5a5;
}

.disclaimer p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #991b1b;
}

.disclaimer strong {
    color: #7f1d1d;
}

.monthly-breakdown {
    background-color: var(--background-color);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-top: 1.5rem;
}

.monthly-breakdown ul {
    list-style: none;
    margin-top: 0.5rem;
}

.monthly-breakdown li {
    margin: 0.5rem 0;
    display: flex;
    justify-content: space-between;
}

.assumptions {
    background-color: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    margin-top: 2rem;
}

.assumptions h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.fixed-assumptions {
    background-color: var(--background-color);
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.assumption-item {
    color: var(--text-color);
    padding: 0.4rem 0;
    font-size: 0.95rem;
}

.assumption-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.slider-group {
    margin-bottom: 1.25rem;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}

.slider-label .value {
    color: var(--primary-color);
    font-weight: bold;
}

.slider-group input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s;
}

.slider-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s;
}

.slider-group input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--secondary-color);
}

.slider-group input[type="range"]::-moz-range-thumb:hover {
    background: var(--secondary-color);
}

.toggle-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

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

.assumptions-content {
    transition: max-height 0.3s ease-out;
    overflow: hidden;
}

.assumptions-content.hidden {
    max-height: 0;
}

.assumptions-content:not(.hidden) {
    max-height: 500px;
    margin-top: 1rem;
}

.recalculate-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--success-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 1rem;
}

.recalculate-btn:hover {
    background-color: #047857;
}

.results {
    text-align: center;
}

.years-result {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 1rem 0;
}

.monthly-breakdown {
    margin: 1rem 0;
    text-align: left;
}

.monthly-breakdown ul {
    list-style: none;
    padding: 0;
}

.monthly-breakdown li {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 5px;
}

.disclaimer {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 1rem;
    text-align: left;
}

/* Ad Container Styles */
.ad-container {
    max-width: 800px;
    margin: 1.5rem auto;
    text-align: center;
    background: var(--background-color);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    min-height: 100px;
}

.ad-label {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: #666;
    margin-bottom: 0.5rem;
}

.ad-top {
    margin-top: -1rem;
    margin-bottom: 2rem;
}

.ad-middle {
    margin: 2rem auto;
}

.ad-bottom {
    margin: 2rem auto 1rem;
}

/* Make ads responsive */
@media (max-width: 768px) {
    .ad-container {
        margin: 1rem;
        border-radius: 8px;
        padding: 0.75rem;
    }
}

/* Ensure ads don't overflow on mobile */
.adsbygoogle {
    max-width: 100%;
    height: auto;
    overflow: hidden;
}

@media (max-width: 640px) {
    main {
        padding: 1rem;
    }
    
    .calculator-container {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    #years {
        font-size: 2.5rem;
    }
}
