/* ==========================================================================
   User Accounts — Premium Experience
   ========================================================================== */

/* ── Heart / Save Button ────────────────────────────────────────────────── */

.kf-save-btn { transition: color 0.2s, transform 0.2s; }
.kf-save-btn-active { color: #c4714b !important; }
.kf-save-btn.kf-heart-bounce { animation: kf-heart-bounce 0.4s ease; }

@keyframes kf-heart-bounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.3); }
    60% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* ── Modal ───────────────────────────────────────────────────────────────── */

.kf-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.kf-modal-overlay.kf-modal-visible { display: flex; opacity: 1; }

.kf-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 420px;
    width: 90%;
    padding: 36px;
    position: relative;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
    animation: kf-modal-enter 0.3s ease;
}

@keyframes kf-modal-enter {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.kf-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}
.kf-modal-close:hover { color: #333; }

.kf-modal h3 { margin: 0 0 8px; font-size: 22px; color: #2B354F; font-weight: 700; }
.kf-modal p { margin: 0 0 16px; color: #6b5e4b; font-size: 14px; line-height: 1.5; }

.kf-modal-input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 12px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.kf-modal-input:focus { border-color: #c4714b; box-shadow: 0 0 0 3px rgba(196, 113, 75, 0.1); }

.kf-modal-submit {
    width: 100%;
    padding: 14px;
    background: #c4714b;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.kf-modal-submit:hover { background: #a0593a; }
.kf-modal-submit:active { transform: scale(0.98); }
.kf-modal-submit:disabled { opacity: 0.6; cursor: default; }

.kf-modal-error { color: #d32f2f; font-size: 13px; margin-top: 8px; }

.kf-modal-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #eee;
    border-top-color: #c4714b;
    border-radius: 50%;
    margin: 16px auto;
    animation: kf-spin 0.8s linear infinite;
}
@keyframes kf-spin { to { transform: rotate(360deg); } }
.kf-modal-hint { text-align: center; font-size: 13px; color: #999; }

/* ── Toast ───────────────────────────────────────────────────────────────── */

.kf-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #2B354F;
    color: #fff;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999999;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.kf-toast-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Note UI (on recipe pages) ───────────────────────────────────────────── */

.kf-note-area { padding: 16px 20px; border-top: 1px solid #eee; }

.kf-note-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px 14px;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.kf-note-textarea:focus { border-color: #c4714b; box-shadow: 0 0 0 3px rgba(196, 113, 75, 0.1); }

.kf-note-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.kf-note-charcount { font-size: 12px; color: #999; }

.kf-note-save {
    padding: 8px 18px;
    background: #2B354F;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.kf-note-save:hover { background: #1e2638; }

/* ── My Recipes Page ─────────────────────────────────────────────────────── */

.kf-myrecipes { padding: 0 0 60px; }

/* Hero — Logged Out */
.kf-myrecipes-hero {
    display: flex;
    align-items: center;
    gap: 48px;
    padding: 60px 40px;
    background: #fdf9f5;
    border-radius: 20px;
    margin: 32px 0 40px;
}

.kf-myrecipes-hero-content { flex: 1; }

.kf-myrecipes-hero h1 {
    font-size: 36px;
    color: #2B354F;
    margin: 0 0 8px;
    font-weight: 800;
    line-height: 1.15;
}

.kf-myrecipes-hero-subtitle {
    font-size: 18px;
    color: #6b5e4b;
    margin: 0 0 28px;
    font-weight: 400;
}

.kf-myrecipes-hero-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
}

.kf-myrecipes-hero-benefits li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    color: #2B354F;
    padding: 8px 0;
    font-weight: 500;
}

.kf-myrecipes-hero-form {
    display: flex;
    gap: 8px;
    max-width: 440px;
}

.kf-myrecipes-hero-input {
    flex: 1;
    padding: 14px 16px;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #fff;
}
.kf-myrecipes-hero-input:focus { border-color: #c4714b; box-shadow: 0 0 0 3px rgba(196, 113, 75, 0.1); }

.kf-myrecipes-hero-btn {
    padding: 14px 28px;
    background: #c4714b;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, transform 0.1s;
}
.kf-myrecipes-hero-btn:hover { background: #a0593a; }
.kf-myrecipes-hero-btn:active { transform: scale(0.98); }
.kf-myrecipes-hero-btn:disabled { opacity: 0.6; cursor: default; }

.kf-myrecipes-hero-hint { font-size: 13px; color: #999; margin: 10px 0 0; }
.kf-myrecipes-hero-error { color: #d32f2f; font-size: 13px; margin: 8px 0 0; }
.kf-myrecipes-hero-sent p { text-align: center; color: #6b5e4b; }

.kf-myrecipes-hero-preview {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.kf-hero-card-placeholder {
    width: 200px;
    height: 56px;
    background: linear-gradient(135deg, #e8ddd4 0%, #f0e8e0 100%);
    border-radius: 12px;
    opacity: 0.7;
}
.kf-hero-card-placeholder:nth-child(2) { width: 180px; opacity: 0.5; }
.kf-hero-card-placeholder:nth-child(3) { width: 160px; opacity: 0.3; }

/* Greeting — Logged In */
.kf-myrecipes-greeting {
    padding: 40px 0 8px;
}

.kf-myrecipes-greeting h1 {
    font-size: 32px;
    color: #2B354F;
    margin: 0 0 4px;
    font-weight: 700;
    animation: kf-fade-up 0.4s ease;
}

.kf-myrecipes-count-wrap { font-weight: 400; color: #6b5e4b; }

.kf-myrecipes-greeting-sub {
    font-size: 16px;
    color: #999;
    margin: 0;
}

@keyframes kf-fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tabs */
.kf-myrecipes-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #eee;
    margin-bottom: 28px;
    margin-top: 16px;
}

.kf-myrecipes-tab {
    padding: 12px 24px;
    border: none;
    background: none;
    font-size: 15px;
    font-weight: 600;
    color: #999;
    cursor: pointer;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}
.kf-myrecipes-tab:hover { color: #2B354F; }
.kf-myrecipes-tab.kf-active { color: #2B354F; border-bottom-color: #c4714b; }

/* Panel transitions */
.kf-myrecipes-panel { animation: kf-fade-up 0.3s ease; }

/* Filters */
.kf-myrecipes-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }

.kf-filter-chip {
    padding: 8px 16px;
    border: 1.5px solid #ddd;
    border-radius: 24px;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: #6b5e4b;
    cursor: pointer;
    transition: all 0.15s;
}
.kf-filter-chip:hover { border-color: #c4714b; color: #c4714b; }
.kf-filter-chip.kf-active { background: #c4714b; border-color: #c4714b; color: #fff; }

/* Save Cards — Rich */
.kf-myrecipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.kf-save-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    text-decoration: none;
    color: #2B354F;
    transition: box-shadow 0.2s, transform 0.2s;
    animation: kf-fade-up 0.3s ease both;
}

.kf-save-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.kf-save-card-img {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.kf-save-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }

.kf-save-card-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kf-save-card-stats { display: flex; flex-wrap: wrap; gap: 8px; }

.kf-save-card-stat {
    font-size: 12px;
    color: #6b5e4b;
    background: #f5ebe4;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.kf-save-card-rating { color: #c4714b; background: rgba(196, 113, 75, 0.1); }

/* Skeleton Loading */
.kf-skeleton-card {
    border-radius: 14px;
    background: #fff;
    padding: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.kf-skeleton-img {
    width: 100%;
    height: 120px;
    border-radius: 10px;
    background: linear-gradient(90deg, #f0ebe6 25%, #f7f3ef 50%, #f0ebe6 75%);
    background-size: 200% 100%;
    animation: kf-shimmer 1.5s ease infinite;
    margin-bottom: 12px;
}

.kf-skeleton-text {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, #f0ebe6 25%, #f7f3ef 50%, #f0ebe6 75%);
    background-size: 200% 100%;
    animation: kf-shimmer 1.5s ease infinite;
    margin-bottom: 8px;
}

.kf-skeleton-short { width: 60%; }

.kf-skeleton-note {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #eee;
}

.kf-skeleton-note-img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background: linear-gradient(90deg, #f0ebe6 25%, #f7f3ef 50%, #f0ebe6 75%);
    background-size: 200% 100%;
    animation: kf-shimmer 1.5s ease infinite;
    flex-shrink: 0;
}

.kf-skeleton-note-lines { flex: 1; padding-top: 8px; }

@keyframes kf-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty States */
.kf-myrecipes-empty-state {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.kf-empty-icon {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.kf-myrecipes-empty-state h3 {
    font-size: 20px;
    color: #2B354F;
    margin: 0 0 8px;
    font-weight: 600;
}

.kf-myrecipes-empty-state p {
    font-size: 15px;
    color: #999;
    margin: 0 0 20px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.kf-empty-cta {
    display: inline-block;
    padding: 12px 24px;
    background: #c4714b;
    color: #fff;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.15s;
}
.kf-empty-cta:hover { background: #a0593a; color: #fff; }

/* Note Cards */
.kf-note-card {
    display: flex;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid #f0ebe6;
    text-decoration: none;
    color: #2B354F;
    transition: background 0.15s;
    animation: kf-fade-up 0.3s ease both;
}
.kf-note-card:hover { background: rgba(196, 113, 75, 0.03); }

.kf-note-card-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.kf-note-card-body { flex: 1; min-width: 0; }
.kf-note-card-title { font-weight: 600; font-size: 15px; display: block; margin-bottom: 6px; }
.kf-note-card-text { font-size: 13px; color: #6b5e4b; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5; }
.kf-note-card-date { font-size: 12px; color: #bbb; margin-top: 6px; display: block; }

/* Profile */
.kf-profile {
    max-width: 520px;
    animation: kf-fade-up 0.3s ease;
}

.kf-profile-section {
    margin-bottom: 32px;
}

.kf-profile-section h3 {
    font-size: 18px;
    color: #2B354F;
    margin: 0 0 16px;
    font-weight: 600;
}

.kf-profile-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #6b5e4b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.kf-profile-input {
    display: block;
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    margin-top: 6px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    background: #fff;
}
.kf-profile-input:focus { border-color: #c4714b; box-shadow: 0 0 0 3px rgba(196, 113, 75, 0.1); }
.kf-profile-readonly { background: #f7f3ef; color: #999; cursor: not-allowed; }

.kf-profile-hint { font-size: 13px; color: #999; margin: 0 0 12px; }

.kf-profile-prefs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.kf-pref-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #2B354F;
    padding: 10px 14px;
    border: 1.5px solid #eee;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.kf-pref-check:hover { border-color: #c4714b; }
.kf-pref-check:has(input:checked) { border-color: #c4714b; background: rgba(196, 113, 75, 0.05); }
.kf-pref-check input { accent-color: #c4714b; }

.kf-profile-save {
    padding: 12px 28px;
    background: #c4714b;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.kf-profile-save:hover { background: #a0593a; }
.kf-profile-save:active { transform: scale(0.98); }
.kf-profile-save:disabled { opacity: 0.6; cursor: default; }

.kf-profile-account { margin-top: 40px; padding-top: 24px; border-top: 1px solid #eee; }

.kf-profile-logout {
    font-size: 14px;
    color: #999;
    text-decoration: none;
    transition: color 0.15s;
}
.kf-profile-logout:hover { color: #d32f2f; }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .kf-myrecipes-hero {
        flex-direction: column;
        padding: 40px 24px;
        gap: 32px;
    }
    .kf-myrecipes-hero h1 { font-size: 28px; }
    .kf-myrecipes-hero-form { flex-direction: column; }
    .kf-myrecipes-hero-preview { flex-direction: row; }
    .kf-hero-card-placeholder { width: 80px; height: 48px; }

    .kf-myrecipes-greeting h1 { font-size: 24px; }
    .kf-myrecipes-greeting { padding: 24px 0 4px; }

    .kf-myrecipes-grid { grid-template-columns: 1fr; }

    .kf-save-card { padding: 12px; }
    .kf-save-card-img { width: 90px; height: 68px; }

    .kf-myrecipes-tab { padding: 10px 16px; font-size: 14px; }

    .kf-profile-prefs { grid-template-columns: 1fr; }
}
