:root {
    --black: #1a1a1a;
    --matte-black: #2c2c2c;
    --dirty-red: #9a2a2a;
    --light-gray: #f2f2f2;
    --premium-gold: #bd9821; /* A gold-like color for premium models */
    --text-color: #e0e0e0;
    --border-radius: 5px;
}

body {
    background-color: var(--black);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    line-height: 1.6;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- General Link Styling --- */
a {
    color: var(--dirty-red);
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

/* --- Header / Navbar --- */
.navbar {
    background-color: var(--matte-black);
    /* padding: 1rem 0; */
    border-bottom: 2px solid var(--dirty-red);
    position: sticky;
    top: 0;
    z-index: 1000; /* Keep navbar on top when scrolling */
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    color: var(--light-gray);
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

.navbar-nav a {
    color: var(--light-gray);
    text-decoration: none;
    margin-left: 1rem;
    transition: color 0.2s;
}

.navbar-nav a:hover {
    color: var(--dirty-red);
}

/* --- Main Content --- */
.content {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

h1, h2, h3 {
    color: var(--light-gray);
    border-bottom: 1px solid var(--matte-black);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

hr {
    border: 0;
    border-top: 1px solid #444;
    margin: 2rem 0;
}

/* --- Search Form --- */
.search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.search-form input[type="text"] {
    flex-grow: 1;
    padding: 0.6rem;
    font-size: 1rem;
    border: 1px solid #555;
    border-radius: var(--border-radius);
    background-color: var(--matte-black);
    color: var(--text-color);
}

.search-form input[type="text"]:focus {
    outline: none;
    border-color: var(--dirty-red);
}

.search-form select {
    padding: 0.6rem;
    font-size: 1rem;
    border: 1px solid #555;
    border-radius: var(--border-radius);
    background-color: var(--matte-black);
    color: var(--text-color);
}

.search-form select:focus {
    outline: none;
    border-color: var(--dirty-red);
    box-shadow: 0 0 5px rgba(154, 42, 42, 0.5);
}

.search-form select option {
    background-color: var(--matte-black);
    color: var(--text-color);
}
.search-form select option:hover {
    background-color: var(--dirty-red);
}
.search-form .button {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.custom-option {
    display: block;
    padding: 0.6rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.custom-option:hover {
    background-color: var(--dirty-red);
    color: var(--light-gray);
}




/* --- Homepage Model Grid --- */
.model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.model-card {
    background-color: var(--matte-black);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #444;
    overflow: hidden; /* To contain the image within the card's border-radius */
    position: relative; /* This is crucial for positioning the ribbon */
    display: flex;
    flex-direction: column;
}

.model-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.model-card .price-tag {
    /* Ribbon styles */
    position: absolute;
    top: 15px;
    right: -34px;
    transform: rotate(45deg);
    width: 130px;
    text-align: center;
    padding: 0.3rem 0;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    background-color: var(--dirty-red);
    color: var(--light-gray);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 2;
}

.model-card .premium-tag {
    background-color: var(--premium-gold);
}

.model-card .favorite-icon {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    color: var(--dirty-red);
    /* Add a subtle shadow to make it stand out */
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

.model-card .favorite-icon svg {
    fill: currentColor;
}

.card-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

.card-image-placeholder {
    width: 100%;
    height: auto;
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 1.2rem;
    font-weight: bold;
}

.card-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allow content to fill available space */
    padding: 1rem;
}

.card-body {
    flex-grow: 1; /* This part will expand, pushing the footer down */
}

.card-content h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--dirty-red);
    border: none;
}

.card-meta, .card-rating {
    font-size: 0.9rem;
    color: #aaa;
}
.card-rating {
    float: right;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #aaa;
}

.card-footer p {
    margin: 0;
}

.card-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.star-filled {
    color: var(--dirty-red);
}

.model-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.model-gallery img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: var(--border-radius);
    /* Delay z-index change on un-hover to keep it on top during transform. */
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, z-index 0s linear 0.2s;
    border: 1px solid #444;
    position: relative;
    z-index: 1;
}

.model-gallery img:hover {
    transform: scale(1);
    z-index: 10;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    /* Apply z-index change immediately on hover, overriding the delay. */
    transition-delay: 0s;
}

/* --- Model Detail Page --- */
.versions-list, .ratings-list {
    margin-top: 1.5rem;
}

.version-item, .rating-item {
    background-color: var(--matte-black);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--dirty-red);
}

.version-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.button, .button-disabled {
    background-color: var(--dirty-red);
    color: var(--light-gray);
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.button:hover {
    opacity: 0.9;
}

.button-disabled {
    background-color: #555;
    cursor: not-allowed;
}

/* --- Model Detail Forms (Rating & Customization) --- */
.rating-form,
.customization-request-section {
    background-color: var(--matte-black);
    padding: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid #444;
}

.rating-form h3,
.customization-request-section h3 {
    margin-top: 0;
    color: var(--dirty-red);
    border-bottom: none;
}

.rating-form form p,
.customization-request-section form p {
    margin-bottom: 1rem;
}

.rating-form label,
.customization-request-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #ccc;
}

.rating-form input,
.rating-form textarea,
.rating-form select,
.customization-request-section input,
.customization-request-section textarea,
.customization-request-section select {
    display: block;
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    border: 1px solid #555;
    border-radius: var(--border-radius);
    background-color: var(--black);
    color: var(--text-color);
    box-sizing: border-box;
}

.rating-form input:focus,
.rating-form textarea:focus,
.rating-form select:focus,
.customization-request-section input:focus,
.customization-request-section textarea:focus,
.customization-request-section select:focus {
    outline: none;
    border-color: var(--dirty-red);
    box-shadow: 0 0 5px rgba(154, 42, 42, 0.5);
}

/* --- Footer --- */
.footer {
    background-color: var(--matte-black);
    color: #aaa;
    padding: 2rem 0;
    margin-top: 2rem;
    border-top: 2px solid #444;
    text-align: center;
}

.footer a {
    color: var(--dirty-red);
    text-decoration: none;
    margin: 0 0.5rem;
}

/* --- Auth Pages (Login, Signup, etc.) --- */
.auth-container {
    max-width: 480px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--matte-black);
    border-radius: var(--border-radius);
    border: 1px solid #444;
}

.auth-container h1 {
    text-align: center;
    color: var(--dirty-red);
    border-bottom: none;
    margin-bottom: 1.5rem;
}

.auth-form p {
    margin-bottom: 1rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #ccc;
}

.auth-form input[type="email"],
.auth-form input[type="text"],
.auth-form input[type="password"] {
    display: block;
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    border: 1px solid #555;
    border-radius: var(--border-radius);
    background-color: var(--black);
    color: var(--text-color);
    box-sizing: border-box;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--dirty-red);
    box-shadow: 0 0 5px rgba(154, 42, 42, 0.5);
}

.auth-form .button {
    width: 100%;
    padding: 0.8rem;
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

.auth-form .button-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    color: #aaa;
    text-decoration: none;
}

.auth-form .button-link:hover {
    color: var(--dirty-red);
}

.checkbox-field {
    display: flex;
    align-items: flex-start;
}

.checkbox-field input[type="checkbox"] {
    margin-right: 0.5rem;
    margin-top: 1rem;
}

.messages {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.messages li {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    color: #fff;
    background-color: #6c757d; /* Default/debug color */
}

.messages li.success {
    background-color: #28a745;
}

.messages li.error {
    background-color: #dc3545;
}

.messages li.warning {
    background-color: #ffc107;
    color: #212529;
}

.messages li.info {
    background-color: #17a2b8;
}

.design-idea-form-content label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #ccc;
}

.design-idea-form-content input,
.design-idea-form-content textarea {
    /* Inherit from .rating-form styles */
    display: block;
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    border: 1px solid #555;
    border-radius: var(--border-radius);
    background-color: var(--black);
    color: var(--text-color);
    box-sizing: border-box;
}

.design-idea-form-content input:focus,
.design-idea-form-content textarea:focus {
    outline: none;
    border-color: var(--dirty-red);
    box-shadow: 0 0 5px rgba(154, 42, 42, 0.5);
}

.design-idea-form-content .button {
    margin-top: 1rem;
}

/* --- Collapsible Form Sections (Homepage, Model Detail, etc.) --- */
.collapsible-form-section {
    background-color: var(--matte-black);
    padding: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid #444;
}

.collapsible-form-section details > summary {
    list-style: none;
    cursor: pointer;
}

.collapsible-form-section details > summary::-webkit-details-marker {
    display: none;
}

.collapsible-form-section .collapsible-form-title {
    color: var(--dirty-red);
    border-bottom: none;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.collapsible-form-section .collapsible-form-prompt {
    color: #aaa;
    margin-top: 0;
}

.collapsible-form-section summary {
    position: relative;
    padding-right: 2rem;
}

.collapsible-form-section summary::after {
    content: '▼';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--dirty-red);
    transition: transform 0.2s;
}

.collapsible-form-section details[open] > summary::after {
    transform: translateY(-50%) rotate(180deg);
}

.collapsible-form-content {
    margin-top: 1.5rem;
    border-top: 1px solid #444;
    padding-top: 1.5rem;
}

.collapsible-form-content p {
    margin-bottom: 1rem;
}

.collapsible-form-content label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #ccc;
}

.collapsible-form-content input,
.collapsible-form-content textarea,
.collapsible-form-content select {
    display: block;
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    border: 1px solid #555;
    border-radius: var(--border-radius);
    background-color: var(--black);
    color: var(--text-color);
    box-sizing: border-box;
}

.collapsible-form-content .button {
    margin-top: 1rem;
}

.nav-icon {
    display: none; /* Hidden by default on larger screens */
    display: inline-block; /* Show icons by default */
    width: 20px;
    height: 20px;
    /* Nudge the icon down slightly for better visual alignment with text */
    transform: translateY(3px);
}

.navbar-nav .button .nav-icon {
    display: none;
    display: inline-block; /* Show icons in buttons by default */
}

/* --- Responsive Adjustments --- */
@media (max-width: 600px) {
    /*
     * On smaller screens, switch the model image gallery from a 2-column
     * grid to a single column to prevent images from being cropped
     * too aggressively.
     */
    .model-gallery {
        grid-template-columns: 1fr;
    }

    .search-form {
        flex-direction: column;
        gap: 1rem;
    }

    .custom-select-wrapper {
        min-width: 0;
    }

    .nav-item-text {
        display: none;
    }

    .nav-icon {
        width: 22px; /* Consistent icon size */
        height: 22px;
    }

    .navbar-nav .button {
        padding: 0.5rem; /* Adjust padding for icon-only button */
        line-height: 1;
    }
}
/* Additional styles for the navbar to avoid modifying main.css */
.navbar-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.navbar-nav .nav-item {
    color: var(--light-gray);
    text-decoration: none;
    font-weight: 500;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}
.navbar-nav .nav-item:hover,
.navbar-nav .nav-item.selected {
    color: var(--dirty-red);
    border-bottom-color: var(--dirty-red);
}
.navbar-nav .button {
    margin-left: 0.5rem;
}
.navbar-nav .user-greeting {
    color: #ccc;
}
.navbar-nav .button-primary {
    background-color: transparent;
    border: 2px solid var(--dirty-red);
    color: var(--dirty-red);
    transition: background-color 0.2s, color 0.2s;
}
.navbar-nav .button-primary:hover {
    background-color: var(--dirty-red);
    color: var(--light-gray);
}

.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--matte-black); /* Match theme */
    color: var(--text-color); /* Match theme */
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    font-size: 0.9rem;
    border-top: 2px solid var(--dirty-red); /* Add a border to match navbar */
}
.cookie-consent-banner p {
    margin: 0;
    margin-right: 1rem;
}
.cookie-consent-banner .buttons {
    display: flex;
    gap: 0.5rem;
}
.cookie-consent-banner a {
    color: var(--dirty-red); /* Match theme links */
    text-decoration: underline;
}
/* Style for the decline button to make it distinct */
#cookie-consent-decline {
    background-color: transparent;
    border: 1px solid var(--dirty-red);
    color: var(--dirty-red);
}
#cookie-consent-decline:hover {
    background-color: var(--dirty-red);
    color: var(--light-gray);
}