/* Diabetic Plate styles */

.plate-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Plate visualization card - subtle gray background */
.plate-container .col-lg-7>.card {
    background-color: var(--bs-gray-100);
}

/* Main heading */
.plate-container>.d-flex>h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* History plate title */
.saved-plate-card h6 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--bs-black);
}

/* Nutrition Facts header - gray like Selected Foods */
.plate-container .nutrition-facts-header {
    background-color: var(--bs-gray-200);
    color: var(--bs-black);
}

.plate-container .nutrition-facts-header h5 {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--bs-black);
}

/* Selected Foods card header - match Nutrition Facts */
.plate-container .card-header.bg-light h6 {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--bs-black);
}

/* Colored badges in Selected Foods - matching plate colors */
.plate-badge-veggies {
    background-color: #b8e0c8;
    color: #2d7a4d;
    font-weight: 600;
}

.plate-badge-protein {
    background-color: #a8d0e8;
    color: #2563a8;
    font-weight: 600;
}

.plate-badge-carbs {
    background-color: #f5d8b0;
    color: #b8860b;
    font-weight: 600;
}

.plate-container .card-body .badge {
    font-size: 0.85rem;
    padding: 0.4em 0.6em;
}

/* Selected food names - larger to match nutrients */
#selected-vegetable,
#selected-protein,
#selected-carb {
    font-size: 1rem;
    font-weight: 500;
}

#selected-vegetable:not(.text-muted),
#selected-protein:not(.text-muted),
#selected-carb:not(.text-muted) {
    color: var(--bf-text);
}

.plate-wrapper {
    max-width: 400px;
    margin: 0 auto;
}

.plate-svg {
    width: 100%;
    height: auto;
    display: block;
}

.plate-section {
    transition: all 0.2s ease;
    transform-origin: 110px 110px;
}

.plate-section:hover {
    cursor: pointer;
}

/* Colored fill on hover - use light versions of plate colors */
.plate-section[data-section="vegetable"]:hover {
    fill: var(--plate-veggies-light);
}

.plate-section[data-section="protein"]:hover {
    fill: var(--plate-protein-light);
}

.plate-section[data-section="carb"]:hover {
    fill: var(--plate-carbs-light);
}

.plate-section.selected {
    stroke-width: 3 !important;
}

/* Colored fill when selected - use light versions of plate colors */
.plate-section.selected[data-section="vegetable"] {
    fill: var(--plate-veggies-light) !important;
    stroke: var(--plate-veggies) !important;
}

.plate-section.selected[data-section="protein"] {
    fill: var(--plate-protein-light) !important;
    stroke: var(--plate-protein) !important;
}

.plate-section.selected[data-section="carb"] {
    fill: var(--plate-carbs-light) !important;
    stroke: var(--plate-carbs) !important;
}

.plate-icon {
    pointer-events: none;
    user-select: none;
}

.plate-label {
    pointer-events: none;
    user-select: none;
    font-family: var(--font-family-base);
}

.plate-selection {
    pointer-events: none;
    user-select: none;
    font-family: var(--font-family-base);
}

/* Selection boxes below the plate */
.plate-selections {
    max-width: 100%;
}

.plate-selection-box {
    border: 2px solid;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.plate-selection-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.plate-selection-box small {
    font-size: 0.7rem;
    letter-spacing: 0.05em;
}

#plate-name-input::placeholder {
    font-size: 0.75rem;
}

.plate-selection-box .selected-food-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.plate-selection-box .food-name {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
}

.plate-selection-box .food-portion {
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.8;
}

.plate-selection-veggies {
    background-color: var(--plate-veggies-light);
    border-color: var(--plate-veggies);
    color: var(--plate-veggies);
}

.plate-selection-protein {
    background-color: var(--plate-protein-light);
    border-color: var(--plate-protein);
    color: var(--plate-protein);
}

.plate-selection-carbs {
    background-color: var(--plate-carbs-light);
    border-color: var(--plate-carbs);
    color: var(--plate-carbs);
}

/* Plate buttons - ByteFlavor accent orange */
.plate-container .btn-outline-primary {
    color: var(--bf-accent);
    border-color: var(--bf-accent);
}

.plate-container .btn-outline-primary:hover,
.plate-container .btn-outline-primary.active {
    background-color: var(--bf-accent);
    border-color: var(--bf-accent);
    color: var(--bs-white);
}

#save-plate-btn.btn-primary {
    background-color: var(--bf-accent);
    border-color: var(--bf-accent);
}

#save-plate-btn.btn-primary:hover {
    background-color: var(--bf-accent-hover);
    border-color: var(--bf-accent-hover);
}

.nutrition-table td {
    padding: 0.5rem 0.75rem;
}

.nutrition-table tr:last-child td {
    border-bottom: none;
}

.nutrient-icon {
    display: inline-block;
    width: 20px;
    text-align: center;
}

#food-options-list .list-group-item {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

#food-options-list .list-group-item:hover {
    background-color: var(--bf-surface-2);
}

.saved-plate-card {
    cursor: pointer;
    transition: box-shadow 0.2s ease;
}

.saved-plate-card:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* Mobile responsive */
@media (max-width: 576px) {
    .plate-container {
        padding: 0 4px;
    }

    .plate-container > .d-flex > h2 {
        font-size: 1.25rem;
    }

    .plate-container .btn-group .btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .plate-wrapper {
        max-width: 260px;
    }

    .plate-section {
        transform-origin: center center;
    }

    .plate-selection-box {
        min-height: 50px;
        padding: 6px !important;
    }

    .plate-selection-box small {
        font-size: 0.6rem;
    }

    .plate-selection-box .food-name {
        font-size: 0.7rem;
    }

    .plate-selection-box .food-portion {
        font-size: 0.6rem;
    }

    .nutrition-table td {
        padding: 0.35rem 0.5rem;
        font-size: 0.85rem;
    }

    .saved-plate-card h6 {
        font-size: 1rem;
    }
}