:root {
    --primary-color: #c0c0c0; /* Silver */
    --primary-hover: #a9a9a9; /* Darker Silver */
    --secondary-color: #cccccc; /* Lighter Gray Text (More Silver) */
    --background-color: #333333; /* Matte Dark Gray */
    --content-bg: #444444; /* Slightly Lighter Gray for cards/header */
    --text-color: #e0e0e0; /* Soft Light Silver/White */
    --border-color: #555555; /* Darker border */
    --dark-text: #333333; /* For use on light buttons */
    --border-radius: 8px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* --- Basic Reset & Body --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Header & Navigation --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--content-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    font-size: 1rem;
    font-weight: 500;
    color: var(--secondary-color);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease-in-out;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
}

.auth-link {
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.auth-link:hover {
    background-color: var(--primary-color);
    color: var(--dark-text); /* Dark text on silver background */
}

/* --- Main Content & Page Sections --- */
.main-content {
    flex-grow: 1;
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.page-section {
    display: none; /* Hidden by default, JS will show the active one */
    animation: fadeIn 0.5s ease-in-out;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.section-content p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.product-card {
    background-color: var(--content-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 200px;
    background-color: var(--background-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    font-style: italic;
}

.product-info {
    padding: 1.5rem;
}

.product-info h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.product-info p {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.product-details {
    display: none; /* Hidden by default */
    padding: 1.5rem;
    padding-top: 0;
    background-color: var(--content-bg); /* Same as card */
    color: var(--text-color);
    animation: fadeIn 0.5s;
}

.product-details h4 {
    font-weight: 700;
    margin-bottom: 0.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.product-details ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

/* --- Forms --- */
.form-container {
    max-width: 500px;
    margin: 2rem auto; /* Centered the form */
    background-color: var(--content-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.form-container h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #555555;
    color: var(--text-color);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(192, 192, 192, 0.25);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark-text); /* Dark text on silver button */
    background-color: var(--primary-color);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s ease-in-out;
}

.btn:hover {
    background-color: var(--primary-hover);
}

.form-toggle-link {
    text-align: center;
    margin-top: 1rem;
}

.form-toggle-link span {
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 500;
}

.form-toggle-link span:hover {
    text-decoration: underline;
}

.message-box {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    display: none; /* Hidden by default */
}

.message-box.success {
    background-color: #2a572a; /* Dark green */
    color: #d4edda;
    border: 1px solid #c3e6cb;
}

.message-box.error {
    background-color: #721c24; /* Dark red */
    color: #f8d7da;
    border: 1px solid #f5c6cb;
}

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 1rem 2rem; /* Smaller padding */
    background-color: #222222; /* Darkest */
    color: var(--secondary-color);
    margin-top: 2rem;
}

/* --- Auth Modal --- */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6); /* Darker overlay */
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--content-bg);
    margin: auto;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 450px;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-modal {
    color: var(--secondary-color);
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: 700;
    cursor: pointer;
}

.close-modal:hover {
    color: var(--text-color);
}

.modal-content.product-modal-content {
    max-width: 800px; /* Wider for product details */
    display: flex;
    flex-direction: row;
    gap: 2rem;
    padding: 2.5rem;
}

.product-modal-image {
    flex: 1;
    height: 400px;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    font-style: italic;
}

.product-modal-details {
    flex: 1;
}

.product-modal-details h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.product-modal-details p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.product-modal-details h4 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.product-modal-details ul {
    margin-left: 1.5rem;
    font-size: 1rem;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-menu {
        width: 100%;
        justify-content: center;
        gap: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .nav-menu {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .nav-link {
        padding: 0.5rem;
    }
    
    .auth-link {
        margin-top: 0.5rem;
    }
    
    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }

    .modal-content.product-modal-content {
        flex-direction: column;
        height: 90vh;
        overflow-y: auto;
    }
    
    .product-modal-image {
        height: 250px;
        flex: none; /* Reset flex */
    }

    .product-modal-details {
        flex: none;
    }
}
