/* Global Styles */
body {
    background-color: #1A233A;
    color: white;
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
}

/* Top Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background-color: #1A233A;
    max-width: 1200px; /* Constrain width to match other sections */
    margin: 0 auto; /* Center horizontally */
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 0px;
}

.logo i {
    font-size: 24px;
    color: #00C4B4;
}

.logo span {
    font-size: 20px;
    font-weight: 700;
}

.auth-buttons {
    display: flex;
    gap: 15px;
    /*margin-right: 200px;*/
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-signup {
    background-color: #00C4B4;
    color: white;
}

.btn-signup:hover {
    background-color: #009688;
}

.btn-signin {
    background-color: #007BFF;
    color: white;
}

.btn-signin:hover {
    background-color: #0056b3;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0); /* Start with transparent background */
    transition: background-color 0.3s ease, opacity 0.3s ease; /* Transition both background and opacity */
}

.modal.show {
    background-color: rgba(0, 0, 0, 0.5); /* Darken background when modal is shown */
    opacity: 1;
}

.modal-content {
    background-color: #2A3550;
    margin: 5% auto;
    padding: 20px;
    border-radius: 10px;
    width: 60%;
    max-width: 300px;
    text-align: center;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.5s ease, width 0.3s ease, max-width 0.3s ease;
    position: fixed; /* Use fixed to center relative to viewport */
    left: 50%;
    transform: translateX(-50%) translateY(-20px); /* Center horizontally */
}

.modal.show .modal-content {
    opacity: 1;
    transform: translateX(-50%) translateY(0); /* Maintain centering when shown */
}

.modal-content.expanded {
    max-width: 1370px; /* Total width = form (300px) + padding (10px + 10px) + panel (1050px) + padding (10px + 10px) */
    transform: translateX(-50%) translateY(0); /* Keep centered */
}

@media (max-height: 600px) {
    .modal-content {
        margin: 2% auto;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1; /* Prevents extra vertical space */
    position: relative;
    top: -22px; /* Moves the close button higher */
}

.close:hover {
    color: white;
}

/* Modal Container for Side-by-Side Layout */
.modal-container {
    display: flex;
    align-items: stretch;
}

.modal-form {
    width: 300px; /* Fixed width for the form */
    flex-shrink: 0;
    padding-right: 0; /* Default padding */
}

.modal-content.expanded .modal-form {
    padding-right: 10px; /* Add padding on the right when expanded */
}

.modal-terms,
.modal-privacy,
.modal-risk {
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease;
    background-color: #2A3550;
    border-left: none; /* Remove border when collapsed */
}

.modal-content.expanded .modal-terms,
.modal-content.expanded .modal-privacy,
.modal-content.expanded .modal-risk {
    width: 1050px; /* 3.5x the original 300px */
    border-left: 1px solid rgba(255, 255, 255, 0.1); /* Add border only when expanded */
    padding-left: 10px; /* Add padding on the left when expanded */
}

.terms-content,
.privacy-content,
.risk-content {
    padding: 10px;
    height: 400px; /* Fixed height for scrollable area */
    overflow-y: auto;
    text-align: left;
    font-size: 14px;
}

.terms-content h3,
.privacy-content h3,
.risk-content h3 {
    font-size: 16px;
    margin-top: 20px;
    margin-bottom: 10px;
}

.terms-content p,
.privacy-content p,
.risk-content p {
    margin-bottom: 15px;
    line-height: 1.5;
}

.terms-content a,
.privacy-content a,
.risk-content a {
    color: #00C4B4;
    text-decoration: none;
}

.terms-content a:hover,
.privacy-content a:hover,
.risk-content a:hover {
    text-decoration: underline;
}

.back-btn {
    background-color: #00C4B4;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    float: right;
}

.back-btn:hover {
    background-color: #009688;
}

form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.input-group {
    margin-bottom: 0px;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    text-align: left;
    font-size: 14px;
    color: #aaa;
}

/* Input Wrapper for Icon and Input */
.input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

input[type="password"],
input[type="email"] {
    width: 100%;
    box-sizing: border-box;
    background-color: #333F5E !important; /* Ensure consistent background */
    border: none !important; /* Remove any border */
}

/* Override autofill styles for Webkit browsers (Chrome, Safari) */
.input-wrapper input:-webkit-autofill,
.input-wrapper input:-webkit-autofill:hover,
.input-wrapper input:-webkit-autofill:focus,
.input-wrapper input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #333F5E inset !important; /* Force dark background */
    -webkit-text-fill-color: white !important; /* Ensure text color is white */
    transition: background-color 5000s ease-in-out 0s; /* Prevent color change */
}

.symbol {
    position: absolute;
    top: 50%;
    left: 29%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: #aaa;
    opacity: 0;
}

.symbol.exclaim {
    animation: fadeInOut 4s infinite;
}

.symbol.question {
    animation: fadeInOut 4s infinite 2s;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    25% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 0; }
}

.input-wrapper i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 16px;
    z-index: 1;
}

form input.input-with-icon {
    padding-left: 30px;
    width: 100%;
    box-sizing: border-box;
}

form input.input-with-icon:focus {
    outline: none;
    border: 1px solid #00C4B4;
}

form input {
    padding: 10px;
    border: none;
    border-radius: 5px;
    background-color: #333F5E; /* Dark background */
    color: white;
    opacity: 1; /* Ensure inputs are fully opaque */
}

.input-wrapper input {
    width: 100%;
    padding: 10px 10px 10px 40px; /* Adjusted padding to account for icon */
    box-sizing: border-box;
    border: none;
    border-radius: 5px;
    background-color: #333F5E !important; /* Dark background with highest specificity */
    color: white;
    opacity: 1; /* Ensure inputs are fully opaque */
    -webkit-appearance: none; /* Remove browser default styles */
    -moz-appearance: none;
    appearance: none;
}

form label {
    font-size: 14px;
    color: #aaa;
    text-align: left;
    margin: 10px 0;
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #00C4B4;
    font-size: 12px;
    margin-top: 10px;
}

#signinModal form button {
    margin-top: 20px; /* Add gap between the password input and the button */
}

a {
    color: #00C4B4;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.logo-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.subtitle {
    font-size: 14px;
    color: #aaa;
    margin-top: 5px;
}

.modal-content .logo i {
    font-size: 20px;
    color: #00C4B4;
}

.modal-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-google {
    background-color: white;
    color: #000000;
    padding: 10px 20px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 20px;
    border: none;
    cursor: pointer;
}

.btn-google span {
    font-weight: bold;
    font-size: 18px;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #aaa;
    margin: 20px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #aaa;
}

.divider span {
    padding: 0 10px;
}

.modal-content .logo span {
    font-size: 22px;
    font-weight: 700;
    color: whitesmoke;
}

.modal-content h2,
.modal-content {
    background-color: #2A3550;
    color: white;
}

form button {
    background-color: #00C4B4;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

form button:hover {
    background-color: #009688;
}

/* Hero Section */
.hero-section {
    background-color: #20254B; /* Background extends full width */
    padding: 50px 20px; /* Maintain vertical padding; horizontal padding applies to full width */
    width: 100%; /* Ensure full viewport width */
}

.hero-container {
    max-width: 1200px; /* Constrains content width */
    margin: 0 auto; /* Centers the container horizontally */
    display: flex; /* Enables side-by-side layout */
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.hero-content {
    flex: 1;
    text-align: left;
    max-width: 500px; /* Constrain text width to force wrapping */
}

.hero-section h1 {
    font-size: 40px;
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 26px;
    margin-bottom: 20px;
}

.selling-points {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}

.selling-points li {
    display: flex;
    align-items: center;
    font-size: 18px;
    margin-bottom: 10px;
}

.selling-points li i {
    color: #00C4B4;
    margin-right: 10px;
    font-size: 20px;
}

.selling-points li#sharpe-ratio {
    display: inline-flex;
    align-items: center;
    white-space: nowrap; /* Prevent text wrapping */
}

.selling-points li#sharpe-ratio span#sharpe-ratio-value {
    margin-left: 4px !important; /* Increased spacing with higher specificity */
    color: #FFFFFF; /* Ensure text color matches */
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 530px; /* Constrain the image container size */
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: 0; /* Remove rounded corners to blend better */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5); /* Add subtle shadow for depth */
    opacity: 0.9; /* Slight opacity to blend with background */
    filter: brightness(1) contrast(1.1); /* Adjust brightness and contrast to match theme */
}

/* Features Section */
.features-section {
    padding: 50px 20px;
    text-align: center;
    max-width: 1200px; /* Add for centering */
    margin: 0 auto;
}

.features-section h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.feature-card {
    background-color: #2A3550;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.feature-card i {
    font-size: 36px;
    margin-bottom: 10px;
    color: #00C4B4; /* Icons remain green */
}

.feature-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.feature-card p {
    font-size: 14px;
}

.feature-card:hover {
    transform: scale(1.05);
    transition: transform 0.3s;
}

/* Performance Section */
.performance-section {
    padding: 80px 40px;
    text-align: center;
    background-color: #1A233A;
    max-width: 1200px; /* Add for consistency */
    margin: 0 auto;
}

.performance-section h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.performance-section > p {
    font-size: 18px;
    color: #d1d5db;
    margin-bottom: 40px;
}

#performanceChart {
    background-color: #2A3550; /* Dashboard-like background */
    border: 1px solid rgba(255, 255, 255, 0.25); /* Dashboard-like border */
    border-radius: 10px;
    padding: 20px; /* Dashboard-like padding */
    width: 100%;
    max-width: 1200px; /* Wide chart */
    height: 410px; /* Increased to ensure border visibility */
    margin: 0 auto;
    transform: translateX(8px);
    box-sizing: border-box; /* Include padding and border in height */
}

.chart-container {
    width: 100%;
    height: 370px; /* Match effective canvas height (410px - 40px padding) */
    overflow: hidden; /* Prevent canvas overflow */
    position: relative; /* Allow absolute positioning of the title */
}

.chart-container h2 {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 24px;
    margin: 0;
    color: white;
    z-index: 1; /* Ensure title is above the canvas */
}

#performanceChartCanvas {
    width: 100% !important;
    height: 100% !important;
    max-height: 370px; /* Ensure canvas doesn't exceed container */
}

/* Metrics Section */
.metrics {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.metrics div {
    background-color: #2A3550;
    padding: 15px 30px;
    border-radius: 5px;
    font-size: 16px;
}

.performance-section .disclaimer {
    font-size: 14px;
    color: #9ca3af;
    margin-top: 20px;
}

/* Call-to-Action Section */
.cta-section {
    padding: 50px 20px;
    text-align: center;
}

.cta-section p {
    font-size: 18px;
    margin-bottom: 20px;
}

.btn-primary {
    background-color: #00C4B4;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
}

.btn-primary:hover {
    background-color: #009688;
}

.input-wrapper input {
    padding-left: 40px;
}

.password-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
}

.password-icon::before {
    content: '';
    position: absolute;
    left: -3px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 1px dashed #aaa;
    border-radius: 50%;
}

/* Footer */
.footer {
    background-color: #1A233A;
    padding: 40px 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    max-width: 1200px; /* Increase from 800px for consistency with other sections */
    margin: 0 auto; /* Center properly */
    /* Remove margin-left: 440px; */
    flex-wrap: wrap;
}

.footer-section {
    flex: 1;
    min-width: 200px;
    margin-right: 200px;
}

.footer-section.company-info {
    margin-left: 0px; /* Adjust this to move the "NeuraKinetic" column left or right */
    margin-right: 110px;
}

.footer-section.links {
    margin-left: 0px; /* Adjust this to move the "Links" column left or right */
    margin-right: 50px;
}

.footer-section.contact {
    margin-left: 0px; /* Adjust this to move the "Contact" column left or right */
    margin-right: 0px;
}

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
}

.footer-section p, .footer-section a {
    font-size: 14px;
    color: #d1d5db;
}

.footer-section a {
    display: block;
    margin-bottom: 10px;
    text-decoration: none;
}

.footer-section a:hover {
    color: #00C4B4;
}

.footer-section i {
    margin: 0 5px;
}

.footer-disclaimer {
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 20px;
}

/* Reduce gap after Send Reset Code button */
#sendCodeButton {
    margin-bottom: 0px;  /* Adjust this value lower (e.g., 0px) to close the gap more */
}

/* Reduce margins on the timer and message paragraphs */
#resetCountdownTimer,
#resetResendMessage {
    margin-top: 0px;     /* Lower from 10px; try 0px for no space */
    margin-bottom: 0px;   /* Add if needed to space below them */
}

/* Optional: Tighten the next input group if needed */
#resetPasswordForm .input-group:nth-of-type(2) {  /* Targets the first input-group after the <p>s */
    margin-top: -15px;  /* Adjust lower to close gap from above */
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden; /* Prevent horizontal scrolling */
    }

    .top-header {
        padding: 20px;
        margin-left: 0; /* Reset margin on mobile */
    }

    .auth-buttons {
        flex-direction: row;
        gap: 10px;
        width: auto;
        margin-right: 0; /* Reset margin on mobile */
    }

    .btn {
        width: auto;
        padding: 6px 12px; /* Reduced padding for smaller buttons */
        font-size: 12px; /* Reduced font size for smaller buttons */
    }

    .hero-section {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 50px 0; /* Remove horizontal padding to allow full centering */
        margin: 0 auto; /* Ensure section is centered */
        max-width: 100%; /* Prevent overflow */
    }

    .hero-container {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        padding: 0 15px;
        box-sizing: border-box;
        margin: 0 auto; /* Center the container */
    }

    .hero-content {
        text-align: center;
        margin-left: 0;
        margin: 0 auto;
        max-width: 100%; /* Allow full width on mobile */
        padding: 0 10px;
    }

    .hero-section h1 {
        font-size: 30px; /* Reduced font size for mobile */
    }

    .hero-section p {
        font-size: 20px; /* Reduced font size for mobile */
    }

    .selling-points {
        margin-left: 0; /* Reset margin on mobile for centered alignment */
        text-align: center; /* Center the list text */
        display: flex;
        flex-direction: column;
        align-items: center; /* Center the list items horizontally */
        padding: 0;
        margin: 0 auto 30px auto; /* Center the list */
        max-width: 100%;
    }

    .selling-points li {
        justify-content: center; /* Center the list items */
        font-size: 14px; /* Reduced font size for mobile */
        white-space: normal; /* Allow wrapping to prevent overflow */
        word-break: break-word; /* Ensure text breaks if needed */
        display: flex;
        align-items: baseline; /* Align to baseline for inline appearance */
    }

    .selling-points li#sharpe-ratio {
        justify-content: center; /* Align to the center like other list items */
        text-align: center; /* Ensure text alignment */
        white-space: normal; /* Override nowrap to prevent overflow */
        display: flex;
        flex-wrap: wrap; /* Allow wrapping */
        align-items: baseline; /* Align to baseline for inline appearance */
    }


    .buttons {
        flex-direction: row;
        gap: 10px;
        justify-content: center; /* Center buttons */
    }

    .btn-primary {
        width: auto; /* Prevent buttons from expanding full width */
    }

    .metrics {
        flex-direction: row;
        gap: 10px;
        flex-wrap: wrap; /* Allow wrapping if needed */
        justify-content: center; /* Center metrics */
    }

    .grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .performance-section {
        padding: 40px 20px;
    }

    #performanceChart {
        height: 360px; /* Slightly shorter for mobile */
        transform: translateX(0); /* Remove horizontal shift to prevent overflow */
    }

    .chart-container {
        height: 320px; /* Match mobile canvas height */
    }

    .chart-container h2 {
        font-size: 16px; /* Reduced font size for the graph title on mobile */
    }

    #performanceChartCanvas {
        max-height: 320px; /* Ensure canvas doesn't exceed container */
    }

    .hero-image {
        display: none; /* Hide the hero image on mobile */
    }

    .footer-content {
        flex-direction: column;
        gap: 30px;
        text-align: center;
        margin-left: 0; /* Reset margin-left to center the footer */
        margin: 0 auto; /* Center the footer content */
    }

    .footer-section.company-info,
    .footer-section.links,
    .footer-section.contact {
        margin-left: 0;
        margin-right: 0; /* Reset right margins to prevent horizontal overflow */
    }

    .modal-content {
        width: 90%; /* Increase width to nearly full screen on mobile */
        max-width: none; /* Remove max-width restriction */
        padding: 15px; /* Reduce padding to fit more content */
    }

    .modal-form {
        width: 100%; /* Make form full width within modal */
        padding-right: 0; /* Remove extra padding */
    }

    form {
        width: 100%; /* Ensure form takes full width */
    }

    .input-group label,
    .security-note,
    .divider span,
    form p {
        word-wrap: break-word; /* Ensure text wraps properly */
        white-space: normal; /* Allow text to wrap */
    }

    .modal-content.expanded {
        max-width: 90%; /* Adjust expanded modal for mobile */
        transform: translateX(-50%) translateY(0); /* Maintain centering on mobile */
    }

    .modal-content.expanded .modal-form {
        display: none; /* Hide form on mobile when ToS, Privacy, or Risk is shown */
    }

    .modal-content.expanded .modal-terms,
    .modal-content.expanded .modal-privacy,
    .modal-content.expanded .modal-risk {
        width: 100%; /* Full width on mobile */
        border-left: none; /* No border on mobile since form is hidden */
        padding-left: 0; /* Remove padding on mobile */
    }

    .terms-content,
    .privacy-content,
    .risk-content {
        height: 500px; /* Adjust height for mobile */
    }
}