body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #00c6fb 0%, #005bea 100%);
    height:  100vh;
    margin: 0;
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    max-height: calc(100% - 40px);
    background: #fff;
    max-width: 900px;
    min-width: 320px;
    min-height: 500px;
    display: flex;           /* Add flex display */
    flex-direction: column;  /* Stack children vertically */
    border-radius: 25px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    padding-inline: 20px;
    padding-bottom: 20px;
    padding-top: 10px;
    overflow-y: scroll;
    scrollbar-width: none;  /* Firefox */
    -ms-overflow-style: none;  /* Internet Explorer and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.container::-webkit-scrollbar {
    display: none;
}

.main-grid {
    width: 100%;
    flex: 1;               /* Make main-grid fill available space */
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: center;
}

.product-title {
    font-size: 1.5em;
    font-weight: 700;
    color: #222;
    margin: 0px;
    margin-top : 10px;
    margin-bottom: 10px;
    padding-block: 10px;
    padding-inline : 1em;
    /* border : 2px solid #7eadf0; */
    border-radius: 100px;
    text-align: center;
}

.left-panel {
    /* margin: 20px; */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    width:calc(100% - 40px);
    height: cals(100% - 20px);
    flex: 1;               /* Make left panel fill its container */

    background-color: #7eadf0;
    /* border: 2px solid black;   */
    border-radius: 20px;  /* Optional: adds rounded corners to match the container style */
}

.upload-label {
    width: 100%;
    padding:0px 20px;
    text-align: center;
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #ffffff;
    /* font-size: 1.2em; */
    letter-spacing: 0.5px;
}

#imageInput {
    display: none;
}

.custom-upload-btn {
    flex-shrink: 1;
    background: rgb(141, 235, 94);
    /* color: #7890d8; */
    color: black;
    width: 160px;
    border: none;
    padding-block: 8px;
    text-align: center;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: black 0px 3px 0px;
    margin-bottom: 10px;
    border-radius: 100px;
}

.file-name {
    display: none;
}

#preview {
    width: 100%;
    max-width: 260px;
    max-height: 260px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 18px;
    object-fit: cover;
    background: #f4f8fb;
    display: none;
}

#analyzeBtn {
    width: 160px;
    padding-block: 8px;
    text-align: center;
    background: rgb(141, 235, 94);
    /* color: #7890d8; */
    color: black;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    align-self: center;
    border-radius: 100px;
    box-shadow: black 0px 3px 0px;
}

#analyzeBtn:disabled {
    background: #5d6772;
    cursor: not-allowed;
}

.right-panel {
    min-height: 260px;
    border-radius: 20px;  
    background-color: #7eadf0;
    display: none;  /* Hide by default */
    flex: 2;               /* Make right panel twice the size of left panel */
}

#result {
    font-size: 1.08em;
    color: #222;
    padding: 20px;
}

.dish-name {
    font-size: 1.3em;
    width: 100%;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1em;
    text-align: center;
}

.ingredients {
    margin-block: 10px;
    padding: 20px;
    border: white 2px solid;
    border-radius: 20px;
}

.ingredients-title {
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
}

.ingredients-list {
    margin-top: 1rem;
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.ingredient-item {
    flex-grow: 0;
    flex-shrink: 0;
    flex-basis: auto;
    background-color: white;
    padding: 0.5em 1em;
    align-content: center;
    color: black;
    border-radius: 20px;
    text-align: center;  
    display: flex;      
    align-items: center; 
    justify-content: center; 
}

.nutrients {
    margin-top: 10px;
    padding: 20px;
    border: white 2px solid;
    border-radius: 20px;
}

.nutrients-title {
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1em;
}

.serving-info {
    margin-bottom: 10px;
}

.nutrients-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap:10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nutrient-item {
    background: #f4f8fb;
    border-radius: 100px;
    padding: 0.5em 2em;
    color: #000000;
    font-size: 1em;
    display: flex;
    align-items: center;
    justify-content: space-between;

}

.loading {
    width: 350px;
    align-self: center;
    justify-self: center;
    color: #ffffff;
    font-weight: 500;
    margin-top: 20px;
}

.error {
    color: #dc3545;
    background: #f8d7da;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
}

.not-food {
    color: #ff4444;
    font-weight: bold;
}

@media (max-width: 900px) {
    .main-grid {
        flex-direction: column;
    }
    .right-panel {
        min-height: 0;
    }
    .left-panel {
        align-items: center;
    }
    .ingredients-list, .nutrients-list {
        grid-template-columns: 1fr;
    }
    #preview {
        max-width: 90vw;
        max-height: 40vw;
    }
}

@media (max-width: 600px) {

    .dish-name {
        font-size: 1.1em;
    }
    .custom-upload-btn, #analyzeBtn {
        font-size: 1em;
    }
}