/* ==========================================================================
   KHX Recipe Engine — Tøm dit køleskab (Fridge Finder)
   ========================================================================== */

/* Trigger-knap til forsiden / hero */
.khx-fridge-trigger-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 14px 22px;
    cursor: pointer;
    text-align: left;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.khx-fridge-trigger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.35);
}

.khx-fridge-trigger-btn .khx-ft-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
}

.khx-fridge-trigger-btn .khx-ft-sub {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 400;
}

/* Modal Backdrop */
.khx-fridge-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

/* Modal Dialog */
.khx-fridge-dialog {
    background: #ffffff;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: khxFridgeFadeIn 0.25s ease-out;
}

@keyframes khxFridgeFadeIn {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Header */
.khx-fridge-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: #fafafa;
}

.khx-fridge-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.khx-fridge-icon {
    font-size: 28px;
    line-height: 1;
}

.khx-fridge-title-wrap h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}

.khx-fridge-title-wrap p {
    margin: 2px 0 0;
    font-size: 13px;
    color: #64748b;
}

.khx-fridge-close {
    background: transparent;
    border: none;
    font-size: 28px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 6px;
}

.khx-fridge-close:hover {
    color: #0f172a;
}

/* Body */
.khx-fridge-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex-grow: 1;
}

/* Søgeboks & Autosuggest */
.khx-fridge-search-box {
    position: relative;
    margin-bottom: 18px;
}

.khx-fridge-input-wrap {
    display: flex;
    align-items: center;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 6px 14px;
    background: #ffffff;
    transition: border-color 0.2s;
}

.khx-fridge-input-wrap:focus-within {
    border-color: #0284c7;
}

.khx-input-icon {
    font-size: 16px;
    margin-right: 8px;
    color: #94a3b8;
}

.khx-fridge-input-wrap input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 15px;
    padding: 6px 0;
    background: transparent;
}

.khx-fridge-suggestions-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    max-height: 180px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    z-index: 10;
}

.khx-suggestion-item {
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 1px solid #f8fafc;
}

.khx-suggestion-item:hover {
    background: #f1f5f9;
    color: #0284c7;
}

/* Sektions-labels */
.khx-fridge-section-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.khx-fridge-section-label button {
    background: none;
    border: none;
    color: #dc2626;
    font-size: 12px;
    cursor: pointer;
    padding: 0;
}

/* Tags & Bobler */
.khx-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 38px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    margin-bottom: 16px;
}

.khx-tags-empty {
    font-size: 13px;
    color: #94a3b8;
    align-self: center;
}

.khx-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #0284c7;
    color: #ffffff;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 500;
}

.khx-tag-remove {
    cursor: pointer;
    font-size: 14px;
    opacity: 0.8;
}

.khx-tag-remove:hover {
    opacity: 1;
}

.khx-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
    max-height: 100px;
    overflow-y: auto;
}

.khx-quick-tag {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
    border-radius: 999px;
    padding: 4px 11px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.khx-quick-tag:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.khx-quick-tag.selected {
    background: #e0f2fe;
    border-color: #38bdf8;
    color: #0369a1;
    font-weight: 600;
}

/* Basislager Toggle */
.khx-fridge-pantry-wrap {
    background: #fdf6ec;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 20px;
}

.khx-pantry-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.khx-pantry-text {
    font-size: 13px;
    color: #78350f;
}

.khx-pantry-text small {
    display: block;
    color: #92400e;
    opacity: 0.85;
}

/* Resultater */
.khx-fridge-results-wrap {
    margin-top: 10px;
    border-top: 1px solid #f1f5f9;
    padding-top: 16px;
}

.khx-spinner {
    border: 3px solid #e2e8f0;
    border-top: 3px solid #0284c7;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    animation: khxSpin 0.7s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes khxSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.khx-result-group-title {
    font-size: 15px;
    font-weight: 700;
    margin: 14px 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.khx-result-group-title.perfect { color: #16a34a; }
.khx-result-group-title.partial { color: #d97706; }

.khx-recipe-match-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.khx-recipe-match-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s ease;
}

.khx-recipe-match-card:hover {
    border-color: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.khx-recipe-match-card img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    background: #f1f5f9;
}

.khx-recipe-match-info {
    flex-grow: 1;
}

.khx-recipe-match-info h4 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
}

.khx-recipe-match-meta {
    font-size: 12px;
    color: #64748b;
}

.khx-recipe-missing-note {
    margin-top: 4px;
    font-size: 12px;
    color: #b45309;
    line-height: 1.4;
}

.khx-recipe-missing-note strong {
    color: #78350f;
}

/* Footer */
.khx-fridge-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-top: 1px solid #f1f5f9;
    background: #fafafa;
}

#khx-fridge-match-summary {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}