.ingredients-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:15px;}
.ingredient-card{background:#fdfdfd;border-left:5px solid #27ae60;border-radius:12px;padding:15px;box-shadow:0 5px 15px rgba(0,0,0,.05);cursor:pointer;transition:.3s;}
.ingredient-card:hover{transform:translateY(-4px);box-shadow:0 10px 25px rgba(0,0,0,.08);}
.ingredient-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;}
.ingredient-title{font-size:16px;font-weight:700;}
.ingredient-calories{background:#ffecec;color:#e74c3c;padding:4px 8px;border-radius:15px;font-size:13px;font-weight:700;}
.ingredient-body ul{padding:0;margin:0;list-style:none;}
.ingredient-body li{font-size:13px;margin-bottom:5px;}
.modal{display:none;position:fixed;z-index:1000;left:0;top:0;width:100%;height:100%;background:rgba(0,0,0,0.5);overflow:auto;}
.modal-content{background:#fff;margin:10% auto;padding:20px;border-radius:12px;max-width:400px;position:relative;}
.close{position:absolute;top:10px;right:15px;font-size:24px;cursor:pointer;}
.modal-title{font-size:20px;font-weight:700;margin-bottom:10px;}
.modal-description{font-size:14px;margin-bottom:15px;}
.modal-table{width:100%;border-collapse:collapse;}
.modal-table th,.modal-table td{text-align:left;padding:8px 5px;}
<style>
.ingredients-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
    gap:20px;
}

.ingredient-card{
    background: linear-gradient(135deg, #ffffff, #f0f0f5);
    border-radius:18px;
    padding:20px;
    box-shadow:0 10px 25px rgba(0,0,0,0.08);
    cursor:pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.ingredient-card:hover{
    transform:translateY(-6px) scale(1.03);
    box-shadow:0 14px 35px rgba(0,0,0,0.12);
}

.ingredient-card h3{
    margin:0 0 12px;
    font-size:19px;
    font-weight:700;
    color:#222;
}

.ingredient-card .calorie-level{
    font-weight:700;
    font-size:14px;
    color:#fff;
    padding:5px 10px;
    border-radius:8px;
    text-align:center;
    margin-bottom:10px;
    display:inline-block;
}

.ingredient-stats{
    display:flex;
    flex-direction:column;
    gap:8px;
    margin-top:12px;
}

.ingredient-stats p{
    margin:0;
    padding:8px 12px;
    border-radius:10px;
    background:#f9f9f9;
    display:flex;
    align-items:center;
    font-size:15px;
    color:#333;
    box-shadow:0 2px 5px rgba(0,0,0,0.05);
}

.ingredient-stats p span.icon{
    margin-right:10px;
    font-size:18px;
}

.weight-impact{
    font-size:13px;
    font-weight:700;
    color:#fff;
    text-align:center;
    margin-top:12px;
    padding:8px 14px;
    border-radius:22px;
    box-shadow:0 2px 6px rgba(0,0,0,0.15);
}

.weight-impact.nazil{ background:#2ecc71; }
.weight-impact.muhafaz{ background:#f1c40f; }
.weight-impact.yesid{ background:#e74c3c; }

/* Modal */
.modal{
    position:fixed;
    top:0; left:0; right:0; bottom:0;
    background:rgba(0,0,0,0.6);
    display:flex;
    align-items:center;
    justify-content:center;
    z-index:9999;
}

.modal-content{
    background:#fff;
    padding:25px;
    border-radius:16px;
    width:90%;
    max-width:450px;
    position:relative;
    box-shadow:0 8px 25px rgba(0,0,0,0.25);
    animation:fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn{
    from{opacity:0; transform:translateY(-20px);}
    to{opacity:1; transform:translateY(0);}
}

.modal-content h2{
    margin-top:0;
    font-size:20px;
    color:#222;
}

.close{
    position:absolute;
    top:12px;
    right:16px;
    font-size:24px;
    font-weight:bold;
    cursor:pointer;
}

.modal-content .ingredient-stats{
    display:flex;
    flex-direction:column;
    gap:8px;
    margin-top:12px;
}

.modal-content .ingredient-stats p{
    margin:0;
    padding:8px 12px;
    border-radius:10px;
    background:#f9f9f9;
    display:flex;
    align-items:center;
    font-size:15px;
    color:#333;
    box-shadow:0 2px 5px rgba(0,0,0,0.05);
}

.modal-content .ingredient-stats p span.icon{
    margin-right:10px;
    font-size:18px;
}

.modal-content p.weight-impact{
    font-size:13px;
    font-weight:700;
    color:#fff;
    text-align:center;
    margin-top:12px;
    padding:8px 14px;
    border-radius:22px;
    box-shadow:0 2px 6px rgba(0,0,0,0.15);
}

.modal-content p.modal-description-title{
    font-weight:700;
    font-size:16px;
    margin-top:14px;
    margin-bottom:6px;
    color:#222;
}

.modal-content p.modal-description{
    background:#f7f7f7;
    padding:12px;
    border-radius:10px;
    margin:0;
    color:#333;
    font-size:15px;
    line-height:1.6;
    max-height:220px;
    overflow-y:auto;
}
</style>
.modal-content{
    background: linear-gradient(145deg, #ffffff, #f4f6f9);
    padding:30px;
    border-radius:20px;
    width:90%;
    max-width:480px;
    position:relative;
    box-shadow:0 12px 40px rgba(0,0,0,0.3);
    animation:slideFadeIn 0.35s ease-in-out;
}

@keyframes slideFadeIn{
    from{opacity:0; transform:translateY(-25px);}
    to{opacity:1; transform:translateY(0);}
}

.modal-content h2{
    margin-top:0;
    font-size:22px;
    font-weight:700;
    color:#1a1a1a;
    text-align:center;
    background: linear-gradient(90deg, #f39c12, #e74c3c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-content .ingredient-stats p{
    margin:0;
    padding:10px 14px;
    border-radius:12px;
    background:#f0f2f5;
    display:flex;
    align-items:center;
    font-size:15px;
    color:#333;
    box-shadow:0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s;
}

.modal-content .ingredient-stats p:hover{
    transform:translateX(3px);
}

.modal-content p.modal-description{
    background:#eef1f6;
    padding:14px;
    border-radius:12px;
    margin-top:12px;
    color:#333;
    font-size:15px;
    line-height:1.6;
    max-height:220px;
    overflow-y:auto;
}

.copy-link-btn{
    display:block;
    width:100%;
    text-align:center;
    margin-top:16px;
    padding:10px 0;
    border:none;
    border-radius:10px;
    background:#3498db;
    color:#fff;
    font-weight:700;
    cursor:pointer;
    transition:all 0.3s;
}

.copy-link-btn:hover{
    background:#2980b9;
}
