/* ==========================
   Recipe Layout
========================== */
.dm-recipes-wrapper{
    max-width:1300px;
    margin:0 auto;
    padding:20px;
}

.dm-recipes-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:20px;
    margin:0 auto;
}

/* ==========================
   Recipe Card
========================== */
.dm-recipe-card{
    background:#fff;
    border:1px solid #e9e9e9;
    border-radius:12px;
    overflow:hidden;
    cursor:pointer;
    transition:.3s ease;
    box-shadow:0 2px 10px rgba(0,0,0,.08);
    height:100%;
}

.dm-recipe-card:hover{
    transform:translateY(-5px);
    box-shadow:0 10px 25px rgba(0,0,0,.15);
}

.dm-recipe-image,
.dm-recipe-card img{
    width:100%;
    height:170px;
    object-fit:cover;
    display:block;
}

/* Card title (renamed from duplicate .dm-recipe-title) */
.dm-card-title{
    margin:10px;
    min-height:42px;
    font-size:15px;
    font-weight:600;
    line-height:1.35;
    text-align:center;
    color:#222;
}

.dm-tag-row{
    display:flex;
    justify-content:center;
    align-items:center;
    flex-wrap:wrap;
    gap:5px;
    padding:0 10px 15px;
}

.dm-tag{
    display:inline-block;
    padding:4px 10px;
    border-radius:20px;
    background:#28a745;
    color:#fff;
    font-size:11px;
    line-height:1.2;
}

/* Responsive */
@media (max-width:1199px){
    .dm-recipes-grid{grid-template-columns:repeat(3,1fr);}
}

@media (max-width:991px){
    .dm-recipes-grid{grid-template-columns:repeat(2,1fr);}
}

@media (max-width:576px){
    .dm-recipes-wrapper{padding:10px;}
    .dm-recipes-grid{grid-template-columns:repeat(2,1fr);gap:10px;}
    .dm-recipe-image,
    .dm-recipe-card img{height:120px;}
    .dm-card-title{font-size:13px;margin:8px;min-height:34px;}
    .dm-tag{font-size:10px;padding:3px 8px;}
}

/* Pagination */
.dm-pagination{
    margin:40px 0;
    text-align:center;
}

.dm-pagination ul{
    display:inline-flex;
    gap:8px;
    list-style:none;
    margin:0;
    padding:0;
}

.dm-pagination li{margin:0;}

.dm-pagination a,
.dm-pagination span{
    display:block;
    padding:10px 16px;
    border:1px solid #ddd;
    border-radius:8px;
    text-decoration:none;
    color:#333;
    background:#fff;
}

.dm-pagination .current{
    background:#2e7d32;
    color:#fff;
    border-color:#2e7d32;
}

.dm-pagination a:hover{background:#f3f3f3;}

/* Previous / Next */
.dm-recipe-navigation{
    display:flex;
    justify-content:center;
    align-items:stretch;
    flex-wrap:wrap;
    gap:20px;
    margin:40px 0;
}

.dm-prev-recipe,
.dm-next-recipe{
    flex:1;
    min-width:250px;
    max-width:320px;
}

.dm-recipe-navigation a{
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    min-height:90px;
    padding:18px;
    border-radius:12px;
    text-decoration:none;
    color:#fff;
    background:#2e7d32;
    font-weight:600;
    transition:.3s ease;
    box-shadow:0 4px 12px rgba(0,0,0,.15);
}

.dm-recipe-navigation a:hover{
    background:#1b5e20;
    color:#fff;
    transform:translateY(-2px);
}

.dm-recipe-navigation strong{
    display:block;
    margin-top:8px;
    font-size:18px;
    color:#fff;
}

@media (max-width:768px){
    .dm-recipe-navigation{
        flex-direction:column;
        align-items:center;
    }
    .dm-prev-recipe,
    .dm-next-recipe{
        width:100%;
        max-width:100%;
    }
}

/* ==========================
   Admin
========================== */
.dm-admin-wrap{max-width:1200px;}

.dm-card{
    margin-bottom:25px;
    padding:25px;
    background:#fff;
    border:1px solid #dcdcde;
    border-radius:10px;
    box-shadow:0 2px 8px rgba(0,0,0,.05);
}

.dm-card h2{
    margin:0 0 20px;
    padding-bottom:12px;
    border-bottom:1px solid #eee;
    font-size:20px;
    color:#2271b1;
}

.dm-card textarea{
    width:100%;
    border-radius:6px;
}

.dm-card input[type=text],
.dm-card input[type=number],
.dm-card input[type=url],
.dm-card select{
    width:100%;
    max-width:400px;
}

.dm-card .form-table th{width:220px;}
.dm-card .description{color:#666;}

.dm-nutrition-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:18px;
    margin-top:20px;
}

.dm-nutrition-grid p{margin:0;}
.dm-nutrition-grid input{width:100%;}

.button-primary.button-large{
    padding:8px 28px;
    font-size:16px;
    border-radius:6px;
}

/* ==========================
   Single Recipe
========================== */
.dm-recipe-container{
    max-width:1100px;
    margin:25px auto;
}

.dm-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
    margin-bottom:25px;
}

/* Renamed from duplicate .dm-recipe-title */
.dm-single-title{
    margin:0 0 12px;
    font-size:38px;
    font-weight:700;
    line-height:1.2;
}

.dm-badges{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

.dm-badge{
    padding:6px 14px;
    border-radius:20px;
    background:#f1f5f9;
    font-size:14px;
    font-weight:600;
}

.dm-green{
    background:#dcfce7;
    color:#166534;
}

.dm-header-right{
    display:flex;
    gap:10px;
}


#dm-recipe-popup{
    display:none;
    position:fixed;
    inset:0;
    z-index:99999;
}

.dm-popup-overlay{
    position:absolute;
    inset:0;
    background:rgba(0,0,0,.45);
}

.dm-popup-box{
    position:relative;
    width:1000px;
    max-width:95%;
    max-height:90vh;
    overflow:auto;
    background:#fff;
    margin:30px auto;
    border-radius:8px;
    box-shadow:0 10px 40px rgba(0,0,0,.25);
}

.dm-popup-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:15px 20px;
    border-bottom:1px solid #ddd;
}

.dm-popup-body{
    padding:20px;
}

/* ==========================================
   Day Theme
========================================== */

.dm-day-blue{
    background:#EAF4FF;
    border:1px solid #B8DAFF;
    border-radius:8px;
    padding:20px;
    margin-bottom:20px;
}

.dm-day-green{
    background:#F2FFF3;
    border:1px solid #BFE8C4;
    border-radius:8px;
    padding:20px;
    margin-bottom:20px;
}

.dm-day-title{
    font-size:18px;
    font-weight:600;
    margin:0 0 20px;
    padding-bottom:10px;
    border-bottom:1px solid rgba(0,0,0,.08);
}