/* Basic styles to start */

body {
    font-family: 'Arial', sans-serif; /* A common sans-serif font */
    margin: 0;
    padding: 0;
    background-color: #f0f4f8; /* Light blue-grey background */
    color: #2c3e50; /* Dark blue-grey text color */
    line-height: 1.8; /* Increased line height for better readability */
    font-size: 1.1em; /* Slightly larger base font size */
    
    /* Add a subtle radial gradient background */
    background: radial-gradient(ellipse at center, #eef2f6 0%, #f0f4f8 100%); /* Very light gradient */
    background-attachment: fixed; /* Keep background fixed during scroll */
}

header {
    background-color: #e3f2fd; /* Very light blue */
    padding: 40px 20px;
    text-align: center;
    position: relative; /* For potential background effects */
}

header h1 {
    color: #0d47a1; /* Dark blue */
    margin-bottom: 15px; /* Increased margin below h1 */
    font-size: 2.8em; /* Larger h1 font size */
}

header p {
    font-size: 1.2em;
    margin-bottom: 20px;
}

nav {
    margin-bottom: 20px;
    /* Styles for sticky navigation */
    width: 100%; /* Full width */
    background-color: #e3f2fd; /* Match header background */
    padding: 15px 20px; /* Add some padding */
    box-sizing: border-box; /* Include padding in width */
    transition: top 0.3s ease; /* Smooth transition for sticking */
    z-index: 1000; /* Ensure it's above other content */
}

.sticky {
    position: fixed; /* Make it sticky */
    top: 0; /* Stick to the top */
    left: 0; /* Align to the left */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Add a subtle shadow */
}

nav a {
    color: #1976d2; /* Blue color for links */
    margin: 0 20px; /* Increased horizontal margin */
    text-decoration: none;
    font-size: 1.1em;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #0d47a1; /* Darker blue on hover */
}

nav a:focus, button:focus {
    outline: 2px solid #1976d2; /* Add focus indicator */
    outline-offset: 3px;
}

main {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px 20px 0 20px; /* Add top padding to main */
}

section {
    padding: 80px 40px; /* Adjust top and bottom padding for sections */
    margin: 40px auto; /* Center sections and keep vertical margin */
    max-width: 1000px; /* Limit maximum width of sections */
    background-color: #ffffff; /* White background */
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid #e3f2fd; /* Add a subtle bottom border */
}

/* Remove border from the last section in main */
main section:last-child {
    border-bottom: none;
}

/* Alternate section background color */
.section-alt {
    background-color: #eef2f6; /* Very light blue-grey */
}

section h2 {
    color: #0d47a1; /* Dark blue */
    text-align: center;
    margin-bottom: 40px; /* Adjusted margin below section titles */
    font-size: 2.2em; /* Adjusted h2 font size */
}

section div {
    margin-bottom: 20px;
}

section h3 {
     color: #1976d2; /* Blue color */
     margin-bottom: 15px; /* Keep margin below h3 */
     font-size: 1.4em; /* Adjusted h3 font size */
}

section p {
    margin-bottom: 15px; /* Keep margin below paragraphs */
    line-height: 1.7; /* Slightly adjusted line height for paragraphs */
}

/* Ensure lists have some bottom margin for consistency */
ul, ol {
    margin-bottom: 15px;
}

button {
    background-color: #ff9800; /* Orange button color */
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 15px;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease; /* Add transform and box-shadow to transition */
}

/* Add margin to the first button in the start section */
#start button:first-child {
    margin-right: 15px; /* Space between buttons */
}

button:hover {
    background-color: #f57c00; /* Darker orange */
    transform: translateY(-3px); /* Lift the button slightly on hover */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2); /* Enhanced shadow on hover */
}

button:active {
    background-color: #ef6c00; /* Even darker orange when active */
    transform: translateY(0); /* Press the button down */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Smaller shadow when active */
}

footer {
    background-color: #e3f2fd; /* Match header background */
    color: #1976d2; /* Blue color */
    text-align: center;
    padding: 40px 20px;
    margin-top: 40px;
    font-size: 0.9em;
    
    /* Flexbox for footer layout */
    display: flex;
    flex-wrap: wrap; /* Allow items to wrap */
    justify-content: space-around; /* Distribute items evenly */
    align-items: flex-start; /* Align items to the top */
}

footer div {
    margin-bottom: 20px;
    padding: 0 15px; /* Add some horizontal padding */
    flex: 1 1 200px; /* Flex properties: grow, shrink, base width */
    max-width: 300px; /* Optional: Maximum width for footer columns */
    text-align: left; /* Align text to left within footer columns */
}

/* Style for the copyright div to take full width */
footer div:last-child {
    flex: 1 100%; /* Take full width */
    text-align: center; /* Center the copyright text */
    margin-top: 20px; /* Add space above copyright */
    padding: 0;
    max-width: none; /* Remove max-width restriction */
}

footer h3 {
    color: #0d47a1; /* Dark blue */
    margin-bottom: 10px;
}

footer ul {
    list-style: none;
    padding: 0;
}

footer ul li {
    margin-bottom: 8px; /* Adjust margin between list items */
}

footer ul li a {
    color: #1976d2; /* Blue color */
    text-decoration: none;
    transition: color 0.3s ease;
}

footer ul li a:hover {
     color: #0d47a1; /* Darker blue on hover */
     text-decoration: underline; /* Add underline on hover */
}

/* Style for the Three.js canvas */
#three-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Ensure canvas is behind content */
}

/* Style for the header content to layer above canvas */
.header-content {
    position: relative; /* Create a new stacking context */
    z-index: 1; /* Ensure content is above the canvas */
    text-align: center; /* Keep header content centered */
    padding: 40px 20px 60px 20px; /* Add padding similar to the original header, increased bottom padding */
    background-color: rgba(227, 242, 253, 0.8); /* Semi-transparent very light blue */
    border-radius: 8px; /* Rounded corners */
    margin: 20px auto; /* Center the block and add vertical margin */
    max-width: 800px; /* Limit the width for better readability */
}

/* Flexbox layout for dashboard and features sections */
#dashboard > div,
#features > div {
    display: flex;
    flex-wrap: wrap; /* Allow items to wrap to the next line */
    gap: 20px; /* Space between the inner divs */
}

/* Basic styling for the inner divs within dashboard and features */
#dashboard > div > div,
#features > div > div {
    flex: 1 1 300px; /* Allow flex items to grow/shrink, with a base width of 300px */
    background-color: #ffffff; /* White */
    padding: 30px; /* Increase padding for better spacing */
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: left; /* Ensure text is left-aligned */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Add transition for smooth effect */
}

#dashboard > div > div:hover,
#features > div > div:hover {
    transform: translateY(-5px); /* Lift the element slightly on hover */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); /* Enhance shadow on hover */
}

/* Flexbox layout for the how-to section steps */
#how-to > div {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center; /* Center the step items */
}

/* Styling for individual steps in the how-to section */
#how-to > div > div {
    flex: 1 1 250px; /* Allow items to grow/shrink, with a base width of 250px */
    background-color: #eef2f6; /* Match alternate section background */
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: left; /* Align text to the left within each step */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Add transition for smooth effect */
}

#how-to > div > div:hover {
    transform: translateY(-5px); /* Lift the element slightly on hover */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); /* Enhance shadow on hover */
}

#how-to > div > div h3 {
    margin-top: 0;
}

/* ============================================================= */
/* Responsive Adjustments */
/* ============================================================= */

/* Initial state for scroll animation */
.section-hidden {
    opacity: 0;
    transform: translateY(50px); /* Start slightly below their final position */
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Active state when in view */
.section-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    body {
        padding: 0 10px; /* Reduce horizontal padding */
    }

    header {
        padding: 30px 10px; /* Reduce header padding */
    }

    nav a {
        margin: 0 8px; /* Reduce space between nav links */
        font-size: 1em; /* Slightly smaller font */
    }

    main {
        margin: 10px auto; /* Reduce main margin */
        padding: 10px 10px 0 10px; /* Reduce main padding */
    }

    section {
        padding: 40px 20px; /* Reduce section padding */
        margin: 20px 0; /* Reduce vertical margin between sections */
    }

    section h2 {
        font-size: 1.8em; /* Slightly smaller section titles */
        margin-bottom: 30px; /* Reduce space below section titles */
    }

    /* Adjust flex basis for inner divs to encourage stacking on smaller screens */
    #dashboard > div > div,
    #features > div > div,
    #how-to > div > div {
        flex: 1 1 100%; /* Allow items to take full width */
        max-width: none; /* Remove max-width restriction */
        padding: 20px; /* Reduce padding */
        text-align: left; /* Ensure text is left-aligned */
    }

    button {
        padding: 10px 20px; /* Adjust button padding */
        font-size: 0.9em; /* Slightly smaller font */
    }

    footer {
        padding: 30px 10px; /* Reduce footer padding */
        justify-content: center; /* Center footer items when stacked */
    }

    footer div {
         flex: 1 1 100%; /* Allow footer items to take full width */
         max-width: none; /* Remove max-width restriction */
         text-align: center; /* Center text in footer columns */
         padding: 10px 0; /* Adjust padding */
    }

     /* Style for the copyright div remains centered and full width */
    footer div:last-child {
        flex: 1 100%;
        text-align: center;
        margin-top: 10px; /* Reduce space above copyright */
        padding: 0;
        max-width: none;
    }
}

/* ============================================================= */
/* Modal Styles */
/* ============================================================= */

/* The Modal (background) */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 2000; /* Sit on top (higher than navbar) */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.6); /* Black w/ opacity */
    backdrop-filter: blur(5px); /* Add a blur effect to the background */
    -webkit-backdrop-filter: blur(5px); /* Safari support */
}

/* Modal Content/Box */
.modal-content {
    background-color: #4a657c; /* Match alternate section background */
    margin: 10% auto; /* 10% from the top and centered */
    padding: 30px;
    border: 1px solid #3b536a; /* Match section background border */
    border-radius: 8px;
    width: 90%; /* Could be more responsive */
    max-width: 500px; /* Max width */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    position: relative; /* Needed for the close button positioning */
}

/* The Close Button */
.close-button {
    color: #ecf0f1; /* Light grey */
    font-size: 30px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover,
.close-button:focus {
    color: #e74c3c; /* Red on hover/focus */
    text-decoration: none;
    cursor: pointer;
}

/* Form Group Styling */
.modal-content .form-group {
    margin-bottom: 20px;
    text-align: left; /* Align labels and inputs to the left */
}

.modal-content label {
    display: block; /* Labels on their own line */
    margin-bottom: 8px;
    color: #ecf0f1; /* Light grey */
    font-size: 1em;
}

.modal-content input[type="text"],
.modal-content input[type="email"],
.modal-content input[type="password"] {
    width: calc(100% - 22px); /* Full width minus padding and border */
    padding: 10px;
    border: 1px solid #3b536a;
    border-radius: 4px;
    background-color: #34495e; /* Match header background */
    color: #ecf0f1; /* Light grey text */
    font-size: 1em;
    box-sizing: border-box; /* Include padding in width */
}

.modal-content input[type="text"]:focus,
.modal-content input[type="email"]:focus,
.modal-content input[type="password"]:focus {
    outline: none;
    border-color: #3498db; /* Blue accent on focus */
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5); /* Subtle blue shadow on focus */
}

/* Style for links within the modal content */
.modal-content a {
    color: #3498db; /* Blue accent color for links */
    text-decoration: none;
    transition: color 0.3s ease;
}

.modal-content a:hover {
    color: #2980b9; /* Darker blue on hover */
    text-decoration: underline;
}

/* Adjust button style within modal to fit context */
.modal-content button[type="submit"] {
    width: 100%; /* Full width button */
    padding: 12px;
    margin-top: 20px; /* More space above button */
    background-color: #1abc9c; /* Turquoise button color */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}

.modal-content button[type="submit"]:hover {
    background-color: #16a085; /* Darker turquoise on hover */
}

/* Responsive adjustments for modal */
@media (max-width: 600px) {
    .modal-content {
        margin: 15% auto; /* Adjust margin for smaller screens */
        width: 95%; /* Use more width on smaller screens */
        padding: 20px; /* Reduce padding */
    }

    .close-button {
        font-size: 24px; /* Smaller close button */
        top: 5px;
        right: 10px;
    }

    .modal-content .form-group {
        margin-bottom: 15px; /* Reduce margin */
    }
}

/* ============================================================= */
/* Form Validation Styles */
/* ============================================================= */

.form-group .error-message {
    color: #d32f2f; /* Red color for error messages */
    font-size: 0.9em;
    margin-top: 5px;
    display: block; /* Display error messages below the input */
}

.form-group input.input-error {
    border-color: #d32f2f !important; /* Red border for invalid input */
    box-shadow: 0 0 5px rgba(211, 47, 47, 0.5); /* Red shadow for invalid input */
}

/* ============================================================= */
/* Button Loading State Styles */
/* ============================================================= */

/* Keeping this for now, although not used in JS due to previous issues */
button.loading {
    position: relative;
    pointer-events: none; /* Prevent clicks while loading */
    opacity: 0.7; /* Dim the button slightly */
    background-color: #ffb74d; /* Lighter orange */
}

button.loading::after {
    content: '';
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-left: 10px;
    border: 2px solid #ffffff; /* White border for the spinner */
    border-radius: 50%;
    border-top-color: #1976d2; /* Blue color for the spinning part */
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================= */
/* Login/Register Page Styles */
/* ============================================================= */

.form-container {
    max-width: 400px; /* Limit the width of the form container */
    margin: 80px auto; /* Center the container and add vertical margin */
    padding: 30px; /* Add padding inside the container */
    background-color: #ffffff; /* White */
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center; /* Center text within the container */
}

.form-container h2 {
    color: #0d47a1; /* Dark blue */
    margin-bottom: 30px; /* Space below title */
    font-size: 2em;
}

/* Reuse form-group and input styles from modal, adjust if necessary */
.form-container .form-group {
     margin-bottom: 20px;
     text-align: left; /* Align labels and inputs to the left */
}

.form-container label {
    display: block; /* Labels on their own line */
    margin-bottom: 8px;
    color: #2c3e50; /* Dark blue-grey */
    font-size: 1em;
}

.form-container input[type="text"],
.form-container input[type="email"],
.form-container input[type="password"] {
    width: calc(100% - 22px); /* Full width minus padding and border */
    padding: 10px;
    border: 1px solid #cccccc; /* Light grey border */
    border-radius: 4px;
    background-color: #f9f9f9; /* Very light grey background */
    color: #333333; /* Dark text color */
    font-size: 1em;
    box-sizing: border-box; /* Include padding in width */
}

.form-container input[type="text"]:focus,
.form-container input[type="email"]:focus,
.form-container input[type="password"]:focus {
    outline: none;
    border-color: #1976d2; /* Blue accent on focus */
    box-shadow: 0 0 5px rgba(25, 118, 210, 0.5); /* Subtle blue shadow on focus */
}

.form-container button[type="submit"] {
    width: 100%; /* Full width button */
    padding: 12px;
    margin-top: 20px; /* More space above button */
    background-color: #1976d2; /* Blue button color */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}

.form-container button[type="submit"]:hover {
    background-color: #1565c0; /* Darker blue on hover */
}

.form-container p {
    margin-top: 20px; /* Space above the paragraph */
    font-size: 1em;
    color: #555555; /* Medium grey text */
}

.form-container a {
    color: #0d47a1; /* Dark blue color for links */
    text-decoration: none;
    transition: color 0.3s ease;
}

.form-container a:hover {
    color: #0b3a80; /* Even darker blue on hover */
    text-decoration: underline;
}

.back-to-home {
    text-align: center; /* Center the link */
    margin-bottom: 20px; /* Space below the link */
}

.back-to-home a {
    color: #1976d2; /* Blue color */
    text-decoration: none;
    font-size: 1em;
    transition: color 0.3s ease;
}

.back-to-home a:hover {
    color: #0d47a1; /* Darker blue on hover */
    text-decoration: underline;
} 