/* =============================================
   COMPONENTS.CSS - Composants réutilisables
   ============================================= */

/* PILLS */
.pill {
    background: var(--surface);
    border: 1px solid #E5E7EB;
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    transition: 0.2s;
    font-size: 0.9rem;
}

.pill:active {
    transform: scale(0.95);
}

.pill.active {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
}

/* RECIPE CARDS */
.recipe-card {
    min-width: 200px;
    max-width: 200px;
    background: var(--surface);
    border-radius: 20px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    border: 1px solid #F3F4F6;
    scroll-snap-align: start;
}

.recipe-card-img {
    height: 130px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.recipe-card-body {
    padding: 12px 14px;
}

.recipe-card-title {
    font-weight: 800;
    font-size: 0.95rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recipe-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Eco Badge on cards */
.eco-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 900;
    padding: 4px 8px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

/* Mini tags (Halal, Vegan, etc.) - discrets */
.mini-tag {
    display: inline-block;
    margin-top: 6px;
    background: #F3F4F6;
    color: #6B7280;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

/* CATEGORY CARDS */
.category-card {
    position: relative;
    flex: 0 0 auto;
    width: 140px;
    height: 100px;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.category-card:hover {
    transform: scale(1.03);
}

.category-img {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
}

.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.2));
}

.category-name {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    color: white;
    font-weight: 800;
    font-size: 0.95rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* TAG CHIPS */
.tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 14px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 900;
    background: #F3F4F6;
    color: #111827;
    border: 1px solid #E5E7EB;
    letter-spacing: .3px;
    text-transform: uppercase;
}

/* BUTTONS */
.btn-close {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, .25);
    color: #fff;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
}

.btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, .25);
    color: #fff;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
    transition: .2s;
}

.btn-icon:active {
    transform: scale(.96);
}

#btn-fav.fav-active {
    background: rgba(248, 113, 113, 0.18);
    border-color: rgba(248, 113, 113, 0.6);
    color: #fb7185;
}

.btn-generate {
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 800;
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    transition: transform 0.2s;
    font-size: 1rem;
}

.btn-generate:active {
    transform: scale(0.96);
}

/* TIP BOX */
.tip-box {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: .8rem;
    line-height: 1.4;
    font-weight: 800;
    color: #374151;
    margin-left: 32px;
}

.tip-box.eco {
    background: #ECFDF5;
    border-color: #A7F3D0;
    color: #065F46;
}

.tip-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 900;
    flex-shrink: 0;
    background: currentColor;
    color: white;
    margin-top: 1px;
}

/* LOADER */
#view-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
}

.loader-content {
    text-align: center;
    width: 100%;
    max-width: 320px;
    padding: 20px;
}

.fox-spinner {
    font-size: 4rem;
    display: inline-block;
    animation: bounceFox 1.5s infinite cubic-bezier(0.28, 0.84, 0.42, 1);
    margin-bottom: 15px;
}

.progress-track {
    background: #F1F2F6;
    height: 8px;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0 10px;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width .3s ease-out;
    border-radius: 10px;
}