:root {
    --primary-font: 'Montserrat', sans-serif;
    --heading-font: 'Playfair Display', serif;
    --bg-color: #1a1a2e; /* Dark Navy Blue */ 
    --card-bg-color: #162447; /* Slightly lighter Navy */
    --text-color: #e0e0e0; /* Light Gray */ 
    --accent-color: #1f4068; /* Muted Blue */
    --highlight-color: #FFD700; /* Gold for highlights/important text */ 
    --border-color: #3b3b58;
    --success-color: #5cb85c;
    --error-color: #d9534f;
}

/* General Reset and Body */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth; /* For smooth anchor link scrolling */
}

body {
    font-family: var(--primary-font);
    background-color: var(--bg-color);
    color: var(--text-color); 
    line-height: 1.6;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 900px;
    background-color: var(--accent-color);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3); 
}

/* NEW: Top Navigation Menu */
.top-nav {
    width: 100%;
    background-color: rgba(0,0,0,0.2);
    padding: 10px 0;
    margin-bottom: 25px;
    border-radius: 5px;
}
.top-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0;
}
.top-nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    padding: 10px 15px;
    font-weight: 600;
    transition: color 0.3s ease, background-color 0.3s ease;
    border-radius: 4px;
}
.top-nav ul li a:hover {
    color: var(--highlight-color);
    background-color: rgba(255, 215, 0, 0.1);
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color); 
    padding-bottom: 20px;
}
header h1 {
    font-family: var(--heading-font);
    color: var(--highlight-color);
    font-size: 2.8em;
    margin-bottom: 10px;
}
header .sub-headline { /* Adjusted from header p */
    font-size: 1.2em;
    color: var(--text-color);
    max-width: 700px;
    margin: 0 auto;
}

/* Input Section */
.input-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--card-bg-color); 
    border-radius: 8px;
}
.input-section h2 {
    font-family: var(--heading-font);
    color: var(--highlight-color);
    margin-bottom: 20px;
    text-align: center;
}

/* Form Styling */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color); 
}
.form-group input[type="text"],
.form-group input[type="date"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: #2c2c4a;
    color: var(--text-color); 
    font-size: 1em;
    font-family: var(--primary-font); /* Ensure consistent font */
}
.form-group input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1); /* Makes the calendar icon visible on dark background */
}
.form-group input[type="text"]::placeholder {
    color: #8a8a9e;
}
.form-group small {
    display: block;
    margin-top: 5px; 
    font-size: 0.85em;
    color: #b0b0c0;
}
button[type="submit"] {
    display: block;
    width: auto;
    min-width: 250px;
    margin: 0 auto; /* Center button */
    padding: 15px 30px;
    background-color: var(--highlight-color);
    color: var(--bg-color); 
    border: none;
    border-radius: 5px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
button[type="submit"]:hover {
    background-color: #e6c300;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-color); 
}
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-left-color: var(--highlight-color);
    border-radius: 50%;
    width: 40px;
    height: 40px; 
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results Section */
.results-section {
    padding-top: 20px;
}
.results-section h2 {
    font-family: var(--heading-font);
    color: var(--highlight-color);
    text-align: center;
    margin-bottom: 25px; 
}
.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}
.result-card {
    background-color: var(--card-bg-color);
    padding: 25px; 
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
.result-card h3 {
    font-family: var(--heading-font);
    color: var(--highlight-color); 
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}
.result-card p {
    margin-bottom: 10px;
    font-size: 0.95em;
}
.result-card strong {
    color: #f0f0f0;
    font-weight: 600;
}
.result-card ul {
    list-style-type: none;
    padding-left: 0;
}
.result-card ul li {
    background-color: #2c2c4a;
    padding: 8px 12px; 
    margin-bottom: 8px;
    border-radius: 4px;
    font-size: 0.9em;
    border-left: 3px solid var(--highlight-color);
}
.result-card .compatibility-yes {
    color: var(--success-color);
    font-weight: bold;
}
.result-card .compatibility-no {
    color: var(--error-color);
    font-weight: bold;
}

/* NEW: Content & Privacy Policy Sections */
.content-section {
    background-color: var(--card-bg-color);
    padding: 25px;
    border-radius: 8px;
    margin-top: 30px;
}
.content-section h2 {
    font-family: var(--heading-font);
    color: var(--highlight-color);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}
.content-section p, .content-section ul {
    margin-bottom: 15px;
}
.content-section ul {
    list-style-position: inside;
    padding-left: 10px;
}
.content-section ul li {
    margin-bottom: 10px;
}
.privacy-policy h3 {
    color: #f0f0f0;
    margin-top: 20px;
    margin-bottom: 10px;
}
.privacy-policy a {
    color: var(--highlight-color);
    text-decoration: none;
}
.privacy-policy a:hover {
    text-decoration: underline;
}

/* Error Section */
.error-section {
    margin-top: 20px;
    padding: 15px;
    background-color: rgba(217, 83, 79, 0.1);
    border: 1px solid var(--error-color); 
    color: var(--error-color);
    border-radius: 5px;
    text-align: center;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9em;
    color: #b0b0c0;
}
footer a {
    color: #c0c0d0;
    text-decoration: none;
}
footer a:hover {
    color: var(--highlight-color);
}
footer .disclaimer {
    margin-top: 8px;
    font-size: 0.8em;
}

/* Responsive Design */
@media (min-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr 1fr; /* Two columns on larger screens */ 
    }
}
@media (max-width: 520px) {
    header h1 {
        font-size: 2.2em;
    }
    header p, header .sub-headline {
        font-size: 1em; 
    }
    .container {
        padding: 15px;
    }
    .content-section, .result-card, .input-section {
        padding: 20px;
    }
    .top-nav ul {
        flex-direction: column;
        align-items: center;
    }
}

/* Styling for the back link on the privacy page */
.privacy-back-link {
    color: var(--highlight-color);
    text-decoration: none;
    font-weight: 600;
}

.privacy-back-link:hover {
    text-decoration: underline;
}
/* Styling for the active menu item */
.top-nav ul li a.active {
    color: var(--highlight-color);
    font-weight: bold;
}

/* Styling for the new subscribe section */
.subscribe-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}
.subscribe-section h4 {
    margin-bottom: 20px;
    color: var(--text-color);
}
.subscribe-section h4 small {
    font-style: italic;
    color: #b0b0c0;
    display: block;
    margin-bottom: 10px;
}

.subscribe-form {
    display: flex;
    justify-content: center;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
}

.subscribe-form input[type="email"] {
    width: 100%;
    flex-grow: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: #2c2c4a;
    color: var(--text-color);
    font-size: 1em;
}

.subscribe-form button[type="submit"] {
    padding: 12px 20px;
    background-color: var(--highlight-color);
    color: var(--bg-color);
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    /* Resetting some button styles to fit the new context */
    display: inline-block;
    width: auto;
    min-width: 0;
    margin: 0;
}
.subscribe-form button[type="submit"]:hover {
    background-color: #e6c300;
}
/* Styling for the subscribe message container */
.subscribe-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    font-weight: 600;
    text-align: center;
    display: block; /* Make it block to take up width */
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Hide it by default until there is a message */
.subscribe-message:empty {
    display: none;
}

.subscribe-message.success {
    background-color: rgba(92, 184, 92, 0.2);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.subscribe-message.error {
    background-color: rgba(217, 83, 79, 0.1);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}
