@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap');

:root {
    --bg-color: #1a1a2e; /* Dark blue/purple background */
    --container-bg: #16213e; /* Slightly lighter container */
    --text-color: #e0e0e0; /* Light grey text */
    --header-color: #ffffff; /* White headers */
    --label-color: #a0a0c0; /* Lighter purple/grey for labels */
    --input-bg: #0f3460; /* Darker blue for inputs */
    --input-border: #4a4a6a; /* Subtle border */
    --button-bg: #e94560; /* Vibrant pink/red button */
    --button-hover-bg: #c73850; /* Darker button hover */
    --results-bg: #1f4068; /* Different blue for results */
    --chart-bg-1: '#36A2EB'; /* Keep original chart colors for now */
    --chart-bg-2: '#FF6384';
    --chart-bg-3: '#FFCE56';
    --chart-bg-4: '#4BC0C0';
    --chart-bg-5: '#9966FF';
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Hero Section Styles */
.hero-section {
    text-align: center;
    padding: 60px 20px 40px 20px; /* More top padding */
    background-color: var(--bg-color); /* Same as body or slightly different if desired */
}

.hero-section h1 {
    color: var(--header-color);
    font-size: 2.8em; /* Larger title */
    margin-bottom: 15px;
    font-weight: 700;
    letter-spacing: 1px;
}

.hero-section .subtitle {
    color: var(--label-color); /* Use label color for subtitle */
    font-size: 1.2em;
    max-width: 600px;
    margin: 0 auto 40px auto; /* Center and add bottom margin */
    font-weight: 300;
}

/* Section Headers (used within container) */
h2 {
    color: var(--header-color);
    font-weight: 400;
    border-bottom: 1px solid var(--input-border);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px; /* Increased gap */
    background-color: var(--container-bg);
    padding: 30px;
    border-radius: 12px; /* More rounded corners */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 1200px; /* Limit overall width */
    margin: 0 auto 40px auto; /* Remove top margin, add bottom margin, center */
}

/* Use section tag selector now */
section.chart-container {
    flex: 1;
    min-width: 300px;
    max-width: 450px; /* Slightly larger max width */
    margin: auto;
    padding: 15px;
    background-color: var(--input-bg); /* Give chart area a background */
    border-radius: 8px;
}

/* Style Chart.js legend and tooltips for dark mode */
/* This might need adjustment depending on Chart.js version/structure */
/* Attempting a more general approach */
canvas + div[class*="chartjs-legend"] ul li span {
     color: var(--text-color) !important;
}

/* Use section tag selector now */
section.form-container {
    flex: 1.5; /* Give form slightly more space */
    min-width: 350px;
}

#creditForm label {
    display: block;
    margin-top: 15px;
    margin-bottom: 8px;
    font-weight: 400;
    color: var(--label-color);
    font-size: 0.95em;
}

#creditForm select,
#creditForm button {
    width: 100%;
    padding: 12px 15px; /* Slightly more padding */
    margin-bottom: 18px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    box-sizing: border-box;
    background-color: var(--input-bg);
    color: var(--text-color);
    font-size: 1em;
    appearance: none; /* Remove default dropdown arrow */
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23e0e0e0%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 10px 10px;
}

#creditForm select:focus {
    outline: none;
    border-color: var(--button-bg);
    box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.3); /* Subtle focus glow */
}

#creditForm button {
    background-color: var(--button-bg);
    color: var(--header-color);
    border: none;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: background-color 0.3s ease, transform 0.1s ease;
    margin-top: 10px; /* Add some space before button */
}

#creditForm button:hover {
    background-color: var(--button-hover-bg);
    transform: translateY(-1px); /* Slight lift on hover */
}

#creditForm button:active {
    transform: translateY(0px); /* Press down effect */
}

.results {
    margin-top: 25px;
    padding: 20px;
    background-color: var(--results-bg);
    border-radius: 8px;
    border: 1px solid var(--input-border);
}

.results h2 {
    margin-top: 0;
    text-align: left;
    color: var(--header-color);
    border-bottom: none; /* Remove border from results header */
    font-size: 1.2em;
}

.results p {
    font-size: 1.15em;
    color: var(--text-color);
    margin: 12px 0;
}

#scoreResult {
    font-weight: 700;
    font-size: 1.3em;
}

/* Footer Styles */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    color: var(--label-color);
    font-size: 0.9em;
    border-top: 1px solid var(--input-border);
}

footer p {
    margin: 0;
}


/* Responsive adjustments */
@media (max-width: 850px) {
    .container {
        flex-direction: column;
        padding: 20px;
    }
    .chart-container, .form-container {
        max-width: 100%;
    }
    /* Adjust hero title size for responsiveness */
    .hero-section h1 {
        font-size: 2.2em;
    }
    .hero-section .subtitle {
        font-size: 1.1em;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    .container {
        padding: 15px;
    }
     /* Adjust hero title size for smaller screens */
    .hero-section h1 {
        font-size: 1.8em;
    }
     .hero-section .subtitle {
        font-size: 1em;
    }
    #creditForm select,
    #creditForm button {
        padding: 10px 12px;
        font-size: 0.95em;
    }
    .results {
        padding: 15px;
    }
    .results p {
        font-size: 1.1em;
    }
}
