/* Global styles */

/* Reset margin and padding for html and body, and set full height */
html, body {
    height: 100%; /* Ensure the body and html elements fill the screen height */
    margin: 0;
    padding: 0;
}

/* Set base font and layout for the body */
body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column; /* Enables flexbox layout for the entire body */
    min-height: 100vh; /* Ensure the body takes up at least the full height of the viewport */
    background-color: #f4f4f4; /* Light gray background color */
    text-align: center;
}

/* Header styles */
header {
    background-color: #333; /* Dark background color */
    color: #fff; /* White text color */
    padding: 1rem 0; /* Vertical padding */
    text-align: center; /* Center-align text */
}

header h1 {
    margin: 0; /* Remove default margin */
}

/* Center-align headings */
h1, h2, h3 {
    text-align: center;
}


/* Navigation menu styles */
nav ul {
    list-style: none; /* Remove bullet points */
    padding: 0; /* Remove default padding */
}

nav ul li {
    display: inline-block; /* Display list items horizontally */
    margin: 0 10px; /* Horizontal spacing between menu items */
}

nav ul li a {
    color: #fff; /* White text color */
    text-decoration: none; /* Remove underline from links */
}

/* Main content area styles */
main {
    padding: 0 10%; /* Horizontal padding (10% of viewport width on each side) */
    flex: 1; /* Allows main to grow and fill available space */
    padding-bottom: 60px; /* Additional padding at the bottom to prevent content overlap with footer */
}

/* General section styles */
section {
    margin-bottom: 40px; /* Spacing below each section */
}

/* Footer styles */
footer {
    background-color: #333; /* Dark background color */
    color: #fff; /* White text color */
    text-align: center; /* Center-align text */
    padding: 10px 0; /* Vertical padding */
    width: 100%; /* Full width */
    position: relative; /* Positioning context for any absolutely positioned child elements */
}

/* Responsive images and videos */
.responsive-image, .responsive-video {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%; /* Image/video will not exceed the container's width */
    height: auto; /* Height adjusts to maintain aspect ratio */
    padding: 50px 0; /* Vertical padding */
}

/* Link styles */
a {
    color: #007BFF; /* Blue text color for links */
}

a:hover {
    text-decoration: underline; /* Underline text on hover */
}

/* Download section styles */
#download {
    text-align: center; /* Center-align content */
    margin-bottom: 20px; /* Spacing below the download section */
}

/* Download button styles */
.download-button {
    font-size: 18px;
    padding: 15px 30px; /* Button padding */
    background-color: #007BFF; /* Blue background color */
    color: white; /* White text color */
    border: none; /* No border */
    cursor: pointer; /* Pointer cursor on hover */
    border-radius: 5px; /* Rounded corners */
}

.download-button:hover {
    background-color: #0056b3; /* Darker blue on hover */
}

/* Custom styles for the Projects page */

/* Projects container styles */
.projects-container {
    text-align: center; /* Center-align content */
    padding: 20px; /* Padding around the container */
}

.projects-container h2 {
    font-size: 28px; /* Larger font size for headings */
}

.projects-container p {
    font-size: 16px; /* Standard font size for paragraphs */
    margin-bottom: 30px; /* Spacing below paragraphs */
}

/* Make project buttons and images align in columns */
.project-buttons,
.project-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    justify-items: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px; 
}

/* Buttons styling */
.project-buttons a {
    padding: 15px 30px;
    border-radius: 20px;
    font-size: 1.2rem;
    text-decoration: none;
    color: white;
    display: inline-block;
    text-align: center;
}

/* Specific button colors */
.project-buttons a.green {
    background-color: #28a745;
}

.project-buttons a.red {
    background-color: #dc3545;
}

.project-buttons a.yellow {
    background-color: #ffc107;
}

.project-buttons a.blue {
    background-color: #0f07ff;
}

.project-buttons a:hover {
    opacity: 0.9;
}

/* Project images styling */
.project-images .image {
    background-color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: black;
    border: 1px solid #ddd;
    transition: 0.3s;
    width: 100%; 
    height: 150px; 
}

.project-images .image img {
    max-width: 100%;
    max-height: 100%;
}

/* Hover effect for project images */
.project-images .image:hover {
    background-color: #ddd;
}

/* Media queries for responsiveness */
@media screen and (min-width: 768px) {
    .project-buttons a {
        font-size: 1.5rem;
    }

    .project-images .image {
        height: 200px;
    }
}

@media screen and (min-width: 1024px) {
    .project-buttons a {
        font-size: 1.8rem;
    }

    .project-images .image {
        height: 250px;
    }
}

/* Replace personal finance related CSS with the finance code provided */

/* Finance tools specific styles */

/* Expense list container for Budgeting Tool */
#budgeting-tool #expense-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

#budgeting-tool #expense-list div {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
}

#budgeting-tool #expense-list input[type="text"] {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#budgeting-tool #expense-list button.remove-expense {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#budgeting-tool #expense-list button.remove-expense:hover {
    background-color: #c82333;
}

.tool-buttons {
    display: flex;
    justify-content: center;
    gap: 120px; /* Increased gap between buttons */
    margin-bottom: 40px;
    padding: 20px 0;
    background-color: #f8f9fa;
    border-bottom: 2px solid #ccc;
}

.tool-buttons button {
    background-color: #6b5b95;
    color: white;
    padding: 15px 30px;
    font-size: 1.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tool-buttons button:hover {
    background-color: #5a4b82;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.tool-buttons button.active {
    background-color: #4e3d63;
    color: #e4d7f7;
}

.tool-section {
    display: none;
    padding: 20px;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.tool-section.active {
    display: block;
}

.tool-section form {
    display: inline-block;
    text-align: left;
    width: 100%;
}

.tool-section form div {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tool-section label {
    display: inline-block;
    width: 150px;
    font-weight: bold;
    text-align: right;
    margin-right: 10px;
}

.tool-section input[type="text"],
.tool-section select {
    width: 60%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.tool-section button {
    background-color: #28a745;
    color: white;
    padding: 10px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: block;
    margin: 0 auto;
}

.tool-section button:hover {
    background-color: #218838;
}

/* Additional spacing for the calculate buttons */
.calc-button {
    margin-top: 30px;
    margin-bottom: 30px;
}

.tool-section .error-message {
    color: red;
    font-weight: bold;
    margin-top: 10px;
}

@media screen and (max-width: 768px) {
    .tool-buttons {
        flex-direction: column;
        gap: 15px;
        padding: 15px 0;
    }

    .tool-buttons button {
        width: 100%;
    }

    .tool-section {
        width: 90%;
    }

    .tool-section form div {
        flex-direction: column;
        align-items: flex-start;
    }

    .tool-section label {
        text-align: left;
        margin-bottom: 5px;
        width: 100%;
    }

    .tool-section input[type="text"],
    .tool-section select {
        width: 100%;
    }
}
