* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root {
    --color-bg: #2C2C2E; /* Main Background */
    --color-surface: #3A3A3C; /* Button/Card Background */
    --color-text: #E5E5E5; /* Light Text */
    --color-border: #525255; /* Subtle Border/Divider */
    --color-primary: #949494; /* Button Text/Unselected color */
    --color-star-default: #555555; /* Dark Star Outline */
    --color-star-active: #FFD60A; /* Yellow-Gold Active Star */
    --color-selection-active: #5E5E61; /* The dark gray/brown selected button color */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: #2a2522;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.container {
    width: 100%;
    max-width: 42rem;
}

.card {
    background-color: #1f1c1a;
    border: 1px solid #3d3532;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Success Message */
.success-message {
    display: none;
    padding: 4rem 1.5rem;
    text-align: center;
}

.success-message.show {
    display: block;
}

.success-icon {
    width: 5rem;
    height: 5rem;
    background-color: rgba(201, 165, 90, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.success-icon svg {
    width: 2.5rem;
    height: 2.5rem;
    color: #c9a55a;
    stroke-width: 2;
}

.success-message h3 {
    color: #c9a55a;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.success-message p {
    color: #9a8f8a;
    font-size: 1rem;
}

/* Form */
.review-form {
    padding: 1.5rem;
}

.review-form.hidden {
    display: none;
}

/* Header */
.header {
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid #3d3532;
    margin-bottom: 1.5rem;
}

.header h2 {
    color: #c9a55a;
    letter-spacing: 0.1em;
    font-size: 0.875rem;
    font-weight: 600;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.avatar {
    width: 2.5rem;
    height: 2.5rem;
    background-color: #c9a55a;
    color: #2a2522;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-details {
    flex: 1;
}

.user-name {
    color: #e8dfd6;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.posting-info {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #7a706b;
}

.info-icon {
    width: 0.75rem;
    height: 0.75rem;
    stroke-width: 2;
}

/* Rating Section */
.rating-section {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0;
    margin-bottom: 1.5rem;
}

.stars {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.star {
    font-size: 1.75rem;
    color: #5a534f;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.star:hover {
    transform: scale(1.1);
}

.star.filled {
    color: #c9a55a;
}

/* Selection CSS */
/* --- Checkbox-Style Multi-Select (New :has() Styling) --- */
.foods-multi-select {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.foods-multi-select label {

    padding: 0.5rem 1rem;
    background-color: #3d3532;
    color: #9a8f8a;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-family: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.15s, border-color 0.15s;
    position: relative; /* For absolute positioning if needed */
}

.foods-multi-select label:last-child {
    border-bottom: none;
}

/* --- The Checkmark/SVG Styling --- */
.icon-check {
    width: 0; /* Initially hidden */
    height: 1.25rem;
    transform-origin: left center;
    fill: var(--color-star-active); /* Use a noticeable color */
    transition: width 0.3s ease-in-out;
}

/* The magic: Select the label that has a checked checkbox */
.foods-multi-select label:has(input:checked) {
    background-color: #c9a55a;
    color: #2a2522;
}

/* The magic: Show the checkmark when the checkbox is checked */
.foods-multi-select label:has(input:checked) .icon-check {
    width: 1.25rem; /* Make it visible */
}

/* Screenreader-only class (Crucial for accessibility) */
.screenreader-only {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}
/* Category Ratings */
.category-ratings {
    margin-bottom: 1.5rem;
}

.category-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.category-label {
    color: #9a8f8a;
    font-size: 0.875rem;
    min-width: 6.25rem;
}

.category-stars .star {
    font-size: 1.5rem;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    color: #9a8f8a;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

textarea {
    width: 100%;
    background-color: #2a2522;
    border: 1px solid #3d3532;
    border-radius: 0.5rem;
    color: #e8dfd6;
    padding: 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    resize: none;
    transition: border-color 0.2s;
}

textarea::placeholder {
    color: #5a534f;
}

textarea:focus {
    outline: none;
    border-color: rgba(201, 165, 90, 0.5);
    box-shadow: 0 0 0 3px rgba(201, 165, 90, 0.1);
}

/* Add Photos Button */
.add-photos-btn {
    width: 100%;
    padding: 0.75rem;
    background-color: #3d3532;
    color: #9a8f8a;
    border: none;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.add-photos-btn:hover {
    background-color: #4a423d;
}

.add-photos-btn svg {
    width: 1rem;
    height: 1rem;
    stroke-width: 2;
}

/* Toggle Buttons */
.toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.toggle-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

.toggle-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.toggle-btn {
    padding: 0.5rem 1rem;
    background-color: #3d3532;
    color: #9a8f8a;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-family: inherit;
}

.toggle-btn:hover {
    background-color: #4a423d;
}

.toggle-btn.active {
    background-color: #c9a55a;
    color: #2a2522;
}

.toggle-btn-full {
    grid-column: 1;
}

/* Collapsible */
.additional-details {
    padding-top: 1rem;
    border-top: 1px solid #3d3532;
}

.collapsible {
    margin-bottom: 0.5rem;
}

.collapsible-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background-color: #2a2522;
    color: #e8dfd6;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.875rem;
    font-family: inherit;
}

.collapsible-trigger:hover {
    background-color: #3d3532;
}

.chevron {
    width: 1rem;
    height: 1rem;
    color: #7a706b;
    stroke-width: 2;
    transition: transform 0.2s;
}

.collapsible.open .chevron {
    transform: rotate(180deg);
}

.collapsible-content {
    display: none;
    padding: 0.75rem 1rem;
    background-color: rgba(42, 37, 34, 0.5);
    border-radius: 0 0 0.5rem 0.5rem;
}

.collapsible.open .collapsible-content {
    display: block;
}

.collapsible-content p {
    color: #7a706b;
    font-size: 0.875rem;
}

/* Collapsible Inner Content */
.collapsible-inner {
    padding: 0.5rem 0;
}

.sub-label {
    display: block;
    color: #e8dfd6;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    margin-top: 1rem;
}

.sub-label:first-child {
    margin-top: 0;
}

.sub-description {
    color: #7a706b;
    font-size: 0.75rem;
    margin-top: -0.5rem;
    margin-bottom: 0.75rem;
}

/* Radio Group */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: #9a8f8a;
    font-size: 0.875rem;
}

.radio-option input[type="radio"] {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
    accent-color: #c9a55a;
}

.radio-option:hover {
    color: #e8dfd6;
}



/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: #9a8f8a;
    font-size: 0.875rem;
}

.checkbox-option input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
    accent-color: #c9a55a;
}

.checkbox-option:hover {
    color: #e8dfd6;
}

/* Sub Textarea */
.sub-textarea {
    width: 100%;
    background-color: #1f1c1a;
    border: 1px solid #3d3532;
    border-radius: 0.5rem;
    color: #e8dfd6;
    padding: 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    resize: none;
    transition: border-color 0.2s;
}

.sub-textarea::placeholder {
    color: #5a534f;
}

.sub-textarea:focus {
    outline: none;
    border-color: rgba(201, 165, 90, 0.5);
    box-shadow: 0 0 0 3px rgba(201, 165, 90, 0.1);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
}

.btn-cancel,
.btn-submit {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-cancel {
    background-color: transparent;
    border: 1px solid #3d3532;
    color: #9a8f8a;
}

.btn-cancel:hover {
    background-color: #3d3532;
    color: #e8dfd6;
}

.btn-submit {
    background-color: #c9a55a;
    color: #2a2522;
}

.btn-submit:hover:not(:disabled) {
    background-color: #b8954a;
}

.btn-submit:disabled {
    background-color: #3d3532;
    color: #5a534f;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 640px) {
    /* Main Layout Adjustments */
    .review-form {
        padding: 1rem;
    }
    
    /* Star Rating Size/Spacing for narrow screens */
    .stars {
        gap: 0.15rem;
    }
    .star {
        font-size: 1.6rem; /* Slightly reduced */
    }
    .category-stars .star {
        font-size: 1.35rem; /* Slightly reduced */
    }
    
    /* Toggle Grids (Existing Rules Maintained) */
    .toggle-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .toggle-grid-2 {
        grid-template-columns: 1fr;
    }
    
    /* Multi-Select Grids (e.g., Vegetarian/Parking options) */
    .foods-multi-select {
        grid-template-columns: 1fr; /* Stack options for better tap targets and readability */
    }

    /* Action Buttons (Stacking for Mobile) */
    .action-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    .btn-cancel,
    .btn-submit {
        flex: none;
        width: 100%;
    }
}