/* ---------------------------------------------------------
   TOP ACTION BAR — UNIFIED, CONSISTENT, RIGHT-ALIGNED
--------------------------------------------------------- */
.recipe-top-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    z-index: 20;
}

/* All action buttons (share, print, edit, delete) */
.recipe-top-actions button,
.recipe-top-actions a {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(0,0,0,0.15);
    background: rgba(255,255,255,0.92);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;

    /* Normalize text + emoji + SVG */
    font-size: 18px;
    line-height: 1;
    color: #222 !important;

    transition: background 0.2s ease, border-color 0.2s ease;
}

.recipe-top-actions button:hover,
.recipe-top-actions a:hover {
    background: #f3f3f3;
    border-color: #888;
}

/* Normalize SVG icons */
.recipe-top-actions svg {
    width: 20px !important;
    height: 20px !important;
    stroke: #222 !important;
    fill: none !important;
    flex-shrink: 0;
    display: block;
}
/* ---------------------------------------------------------
   GRID LAYOUT
--------------------------------------------------------- */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    padding: 20px 0;
}

/* ---------------------------------------------------------
   RECIPE CARD
--------------------------------------------------------- */
.recipe-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.recipe-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

/* ---------------------------------------------------------
   CARD IMAGE
--------------------------------------------------------- */
.recipe-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

/* ---------------------------------------------------------
   CARD CONTENT
--------------------------------------------------------- */
.recipe-card-body {
    padding: 14px 16px 18px;
}

.recipe-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

/* ---------------------------------------------------------
   CARD ACTIONS (top-right)
--------------------------------------------------------- */
.card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    z-index: 5;
}

.card-actions button,
.card-actions a {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(0,0,0,0.15);
    background: rgba(255,255,255,0.9);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #222 !important;
    transition: background 0.2s, border-color 0.2s;
}

.card-actions button:hover,
.card-actions a:hover {
    background: #f0f0f0;
    border-color: #999;
}

.card-actions svg {
    stroke: #222 !important;
    fill: none !important;
    width: 18px;
    height: 18px;
}

/* ---------------------------------------------------------
   CHECKBOX STRIKETHROUGH (for inline card lists)
--------------------------------------------------------- */
.checked .ingredient-text,
.checked .instruction-text {
    text-decoration: line-through;
    opacity: 0.6;
}

/* ---------------------------------------------------------
   DELETE MODAL (unified with detail page)
--------------------------------------------------------- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal.open {
    display: flex;
}

.modal.fade-in {
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.modal-content {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    width: 320px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
}

.button-secondary,
.button-danger {
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    font-size: 15px;
}

.button-secondary {
    background: #ddd;
}

.button-danger {
    background: #c0392b;
    color: white;
}

/* ---------------------------------------------------------
   RESPONSIVE
--------------------------------------------------------- */
@media (max-width: 480px) {
    .recipe-grid {
        grid-template-columns: 1fr;
    }
}

/* Prevent SVG from triggering duplicate click events */
.recipe-print svg,
.recipe-print svg *,
.card-print svg,
.card-print svg * {
    pointer-events: none;
}

.recipe-detail-container {
    position: relative;
    padding-top: 60px; /* space for the action bar */
}
