*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #a903f6, #7004f3, #49388d, #505e9e, #3a4e5c, #4e6168);
    color: #fff;
    background-attachment: fixed;
}

.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    padding: 15px 20px;
}

.fixed-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.fixed-header .logo {
    font-size: 24px;
    font-weight: bold;
    color: white;
}

.fixed-header .logo a {
    color: white;
    text-decoration: none;
}

.fixed-header nav a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
}

main {
    padding: 40px;
    padding-top: 80px;
    max-width: 1200px;
    margin: 0 auto;
}

.hero {
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 3em;
    margin-bottom: 20px;
}

.cta-button,
.tool-button,
.read-more {
    background-color: #00bcd4;
    color: #fff;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    display: inline-block;
    width: 80%;
    max-width: 200px;
}

.cta-button:hover,
.tool-button:hover,
.read-more:hover {
    background-color: #0097a7;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tools {
    text-align: center;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5em;
    margin-top: 20px;
    align-items: stretch;
}

.tool-card {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 1.5em;
    border-radius: 8px;
    text-decoration: none;
    color: white;
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 280px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tool-card:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.tool-card h3 {
    font-size: 1.2em;
    margin-bottom: 0.8em;
    text-align: center;
}

.tool-card p {
    font-size: 0.95em;
    margin-bottom: 1.2em;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.tool-card .tool-button {
    margin-top: auto;
    align-self: center;
    width: 80%;
}

.charts {
    margin-top: 20px;
}

footer {
    text-align: center;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.2);
}

footer nav a {
    margin: 0 10px;
    color: #fff;
    text-decoration: none;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .fixed-header .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .fixed-header nav {
        margin-top: 10px;
    }

    .tool-grid {
        grid-template-columns: 1fr;
        gap: 1em;
    }

    .tool-card {
        padding: 1.2em;
        min-height: 240px;
    }

    main {
        padding: 20px;
        padding-top: 100px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2em;
    }
}

/* Tool Page Styles */
.tool-content {
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 30px;
}

.tool-content h1 {
    font-size: 2em;
    margin-bottom: 20px;
}

.tool-content h2 {
    font-size: 1.5em;
    margin: 15px 0;
}

.tool-content p {
    font-size: 1em;
    line-height: 1.6;
}

.calculator,
.budget-planner,
.currency-converter {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.calculator h3,
.budget-planner h3,
.currency-converter h3 {
    margin-top: 0;
    text-align: center;
}

.calculator label,
.budget-planner label,
.currency-converter label {
    display: block;
    margin-bottom: 8px;
}

.calculator input,
.budget-planner input,
.currency-converter input,
.calculator select,
.budget-planner select,
.currency-converter select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.calculator button,
.budget-planner button,
.currency-converter button {
    background-color: #00bcd4;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 10px;
    transition: background-color 0.3s;
}

.calculator button:hover,
.budget-planner button:hover,
.currency-converter button:hover {
    background-color: #0097a7;
}

#loanResult,
#investmentResult,
#budgetResult,
#currencyResult,
#compoundResult,
#sipResult,
#fdrdResult,
#retirementResult {
    margin-top: 20px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    line-height: 1.6;
}

select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

select option {
    background-color: #333;
    color: white;
}

select:focus {
    outline: none;
    border-color: #00bcd4;
}

input[type="range"] {
    width: 100%;
    margin-bottom: 15px;
}

/* New Home Page Sections Styles */
.get-started,
.why-use,
.financial-tips {
    margin-bottom: 40px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.tool-links {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.tool-links a {
    margin: 5px;
}

.why-use ul {
    list-style-type: none;
    padding: 0;
}

.why-use li {
    padding: 8px 0;
    position: relative;
    padding-left: 25px;
}

.why-use li::before {
    content: "•";
    color: #00bcd4;
    font-size: 1.5em;
    position: absolute;
    left: 0;
    top: 2px;
}

.financial-tips article {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.financial-tips article:last-child {
    border-bottom: none;
}

.financial-tips .quick-tips {
    text-align: left;
}

.tool-button i {
    margin-right: 8px;
}

/* Budget Planner Specific Styles */
.budget-planner {
    max-width: 600px;
    margin: 0 auto;
    padding: 25px;
}

.budget-planner label {
    display: block;
    margin: 15px 0 5px;
    font-weight: bold;
}

.budget-planner input,
.budget-planner select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 6px;
}

.budget-planner input[type="range"] {
    padding: 0;
    height: 8px;
}

.button-group {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}

.button-group .tool-button {
    width: 100%;
    margin: 0;
}

.result-container {
    margin: 25px 0;
    padding: 20px;
    border-radius: 8px;
}

.result-container h4 {
    margin-top: 0;
    color: #00bcd4;
}

/* Consolidated Chart Styles */
.chart-container {
    position: relative;
    width: 100%;
    max-height: 400px;
    margin: 20px 0;
    overflow: hidden;
}

#myChart, #myChart.investment {
    width: 100%;
    max-width: 600px;
    max-height: 400px;
    margin: 20px auto;
    box-sizing: border-box;
}

/* Responsive adjustments for chart */
@media (max-width: 768px) {
    .chart-container,
    #myChart, #myChart.investment {
        max-height: 300px;
    }
}

/* Compound Interest Calculator Specific Styles */
.compound-calculator {
    max-width: 600px;
    margin: 0 auto;
    padding: 25px;
}

.compound-calculator label {
    display: block;
    margin: 15px 0 5px;
    font-weight: bold;
}

.compound-calculator input,
.compound-calculator select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
}

.compound-calculator input[type="range"] {
    padding: 0;
    height: 8px;
    margin-bottom: 25px;
}

.compound-result {
    margin: 25px 0;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.compound-result h4 {
    margin-top: 0;
    color: #00bcd4;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .compound-calculator {
        padding: 15px;
    }
}

/* Calculator Container */
.calculator {
    max-width: 600px;
    margin: 0 auto;
    padding: 25px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

/* Input Styling */
.calculator label {
    display: block;
    margin: 15px 0 5px;
    font-weight: bold;
}

.calculator input,
.calculator select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: white;
}

.calculator input[type="range"] {
    padding: 0;
    height: 8px;
    margin-bottom: 25px;
    background: transparent;
}

/* Button Styling */
.button-group {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}

.button-group .tool-button {
    width: 100%;
    margin: 0;
}

/* Results Container */
#compoundResult {
    margin: 20px 0;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

#compoundResult h4 {
    margin-top: 0;
    color: #00bcd4;
}

/* Tool Explanation */
.tool-explanation {
    margin-top: 30px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

/* Error Message Styling */
.error {
    color: #ff6666;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    border: 1px solid rgba(255, 102, 102, 0.3);
}

/* Specific styling for the canvas element in investment.html */
#myChart.investment {
    width: 100%;
    max-width: 600px;
    max-height: 400px;
    margin: 20px auto;
    display: none;
    box-sizing: border-box;
}

/* Optional: Adjust chart height for smaller screens */
@media (max-width: 600px) {
    #myChart.investment {
        max-height: 300px;
    }
}
/* Styles specific to the contact page form */
.contact-page-content .contact-form { /* target only the form inside contact-page-content*/
    display: grid;
    grid-template-columns: 1fr;
    grid-gap: 10px;
    margin-top: 20px;
}

.contact-page-content .contact-form label {
    display: block;
    margin-bottom: 5px;
    color: white;
}

.contact-page-content .contact-form input,
.contact-page-content .contact-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #444;
    background-color: white;
    color: #333;
    box-sizing: border-box;
}

.contact-page-content .contact-form textarea {
    resize: vertical;
}

.contact-page-content .contact-form button {
    padding: 10px 20px;
    background-color: #00bcd4;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}

.contact-page-content .contact-form button:hover {
    background-color: #0097a7;
}
