/**
 * assets/css/style.css
 * Projekt: Co z lednice
 * Moderní, vřelé a hravé gastronomické webové rozhraní optimalizované pro mobilní telefony
 */

:root {
    /* Barevná paleta */
    --bg-body: #FBF9F5;              /* Teplý krémový podklad */
    --bg-surface: #FFFFFF;           /* Čistě bílý podklad karet */
    --primary-orange: #E8590C;       /* Teplá terakota / oranžová pro chuť k jídlu */
    --primary-orange-hover: #D9480F;
    --primary-gradient: linear-gradient(135deg, #FF6B6B 0%, #E8590C 100%);
    --secondary-green: #2B8A3E;      /* Svěží přírodní zelená pro potvrzené stavy */
    --secondary-green-hover: #237032;
    --secondary-green-light: #EBFBEE;
    --text-heading: #212529;         /* Hluboká tmavá pro čitelné nadpisy */
    --text-body: #495057;            /* Měkká tmavě šedá pro čtení */
    --text-muted: #868E96;           /* Ztlumený text pro metadata */
    --border-subtle: #E9ECEF;        /* Jemné dělicí linie */
    --border-accent: #FFE8CC;        /* Teplý podtón ohraničení */
    
    /* Ergonomie a poloměry */
    --radius-pill: 999px;
    --radius-card: 20px;
    --radius-island: 30px;
    --touch-min-height: 46px;
    
    /* Stíny */
    --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 15px 30px rgba(232, 89, 12, 0.12);
    --shadow-island: 0 15px 35px rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   1. Globální nastavení a typografie
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-body);
    color: var(--text-body);
    font-family: system-ui, -apple-system, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    padding-bottom: 110px; /* Bezpečné odsazení pro plovoucí spodní lištu */
    -webkit-font-smoothing: antialiased;
    touch-action: manipulation;
}

/* Podpora bezpečných zón pro iPhony a bezrámečková zařízení */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: calc(115px + env(safe-area-inset-bottom));
    }
}

/* ==========================================================================
   2. Navigační lišta a záhlaví
   ========================================================================== */
.site-header {
    background: rgba(251, 249, 245, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(233, 236, 239, 0.8);
    transition: all 0.25s ease;
}

.brand-badge {
    background: #FFF4E6;
    color: var(--primary-orange);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid #FFE8CC;
}

/* Hero uvítací sekce */
.hero-card {
    background: linear-gradient(180deg, #FFFFFF 0%, #FFFDF9 100%);
    border-radius: 24px;
    border: 1px solid rgba(255, 232, 204, 0.6);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.hero-card::after {
    content: "";
    position: absolute;
    top: -40px;
    right: -40px;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(255, 107, 107, 0.12) 0%, rgba(232, 89, 12, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-icon-bubble {
    width: 64px;
    height: 64px;
    background: #FFF4E6;
    border: 2px solid #FFE8CC;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 12px rgba(232, 89, 12, 0.12);
}

/* ==========================================================================
   3. Klikací tagy surovin (.surovina-tag)
   ========================================================================== */
.suroviny-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.surovina-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: var(--touch-min-height);
    padding: 0.55rem 1.25rem;
    background-color: var(--bg-surface);
    color: var(--text-heading);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), 
                background-color 0.2s ease, 
                border-color 0.2s ease, 
                box-shadow 0.2s ease,
                color 0.2s ease;
}

.surovina-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.surovina-tag:active {
    transform: scale(0.96);
}

/* Barevné pastelové tagy podle typu surovin */
.tag-dairy {
    background-color: #FFF9DB !important;
    border-color: #FFE066 !important;
    color: #D9480F !important;
}

.tag-meat {
    background-color: #FFE3E3 !important;
    border-color: #FFA8A8 !important;
    color: #C92A2A !important;
}

.tag-veg {
    background-color: #EBFBEE !important;
    border-color: #B2F2BB !important;
    color: #2B8A3E !important;
}

.tag-carb {
    background-color: #FFF4E6 !important;
    border-color: #FFD8A8 !important;
    color: #D9480F !important;
}

/* Aktivní stav tagu: sytá smaragdová zelená s výrazným stínem a zvětšením */
.surovina-tag.active,
.surovina-tag.active.tag-dairy,
.surovina-tag.active.tag-meat,
.surovina-tag.active.tag-veg,
.surovina-tag.active.tag-carb {
    background: #2B8A3E !important;
    color: #FFFFFF !important;
    border-color: #237032 !important;
    box-shadow: 0 6px 18px rgba(43, 138, 62, 0.4) !important;
    transform: translateY(-2px);
}

.surovina-tag.active::before {
    content: "✓";
    font-weight: 800;
    font-size: 0.85rem;
    margin-right: 0.15rem;
}

/* Textové pole pro přidání vlastní suroviny */
.custom-ingredient-group {
    background: #FFFFFF;
    border-radius: var(--radius-pill);
    padding: 0.3rem 0.35rem 0.3rem 1.2rem;
    border: 1.5px solid var(--border-subtle);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.custom-ingredient-group:focus-within {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 4px rgba(232, 89, 12, 0.15);
}

.custom-ingredient-group input {
    background: transparent;
    border: none;
    font-size: 0.95rem;
    color: var(--text-heading);
}

.custom-ingredient-group input:focus {
    outline: none;
    box-shadow: none;
}

.btn-add-ingredient {
    background: var(--primary-orange);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-pill);
    padding: 0.55rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.btn-add-ingredient:hover {
    background-color: var(--primary-orange-hover);
    color: #FFFFFF;
}

.btn-add-ingredient:active {
    transform: scale(0.96);
}

/* ==========================================================================
   4. Karty receptů v inspiraci (.recipe-card)
   ========================================================================== */
.recipe-card {
    background: var(--bg-surface);
    border: none !important;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease;
    cursor: pointer;
    text-decoration: none !important;
    position: relative;
    overflow: hidden;
}

/* Horní vizuální banner s barevným přechodem */
.recipe-card-banner {
    height: 65px;
    background: linear-gradient(135deg, #FF922B 0%, #FA5252 100%);
    position: relative;
    display: flex;
    align-items: flex-end;
    padding-left: 1.25rem;
}

.recipe-card:nth-child(2n) .recipe-card-banner {
    background: linear-gradient(135deg, #FF6B6B 0%, #E8590C 100%);
}
.recipe-card:nth-child(3n) .recipe-card-banner {
    background: linear-gradient(135deg, #FD7E14 0%, #F76707 100%);
}
.recipe-card:nth-child(4n) .recipe-card-banner {
    background: linear-gradient(135deg, #FA5252 0%, #D9480F 100%);
}

/* Velká kulatá ikona jídla částečně přesahující do těla karty */
.recipe-card-icon-badge {
    width: 48px;
    height: 48px;
    background: #FFFFFF;
    border-radius: 50%;
    border: 3.5px solid #FFFFFF;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    position: absolute;
    bottom: -18px;
    left: 1.25rem;
    z-index: 2;
}

.recipe-card-body {
    padding: 1.4rem 1.25rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.recipe-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.recipe-card:active {
    transform: scale(0.98);
}

.recipe-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
    line-height: 1.35;
}

/* Výrazný oranžový pill badge pro dobu přípravy */
.recipe-badge-time {
    background: linear-gradient(135deg, #FFF4E6 0%, #FFE8CC 100%);
    color: #E8590C;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid #FFD8A8;
    box-shadow: 0 2px 5px rgba(232, 89, 12, 0.1);
}

.recipe-badge-difficulty {
    background: #F1F3F5;
    color: #495057;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-pill);
}

.recipe-badge-views {
    color: var(--text-muted);
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.recipe-ing-chip {
    background: #F8F9FA;
    color: #495057;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    padding: 0.25rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 500;
}

/* ==========================================================================
   5. Plovoucí ostrovní spodní lišta (.floating-island)
   ========================================================================== */
.floating-action,
.floating-island {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    margin: 0 auto;
    max-width: 520px;
    z-index: 1040;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-island);
    box-shadow: var(--shadow-island);
    padding: 0.6rem;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
}

@supports (bottom: env(safe-area-inset-bottom)) {
    .floating-action,
    .floating-island {
        bottom: calc(16px + env(safe-area-inset-bottom));
    }
}

/* Výrazné energické tlačítko s teplým korálovým gradientem a září */
.btn-generate-main,
#btnGenerate,
#btnGenerate.btn-secondary,
#btnGenerate.btn-success {
    min-height: 52px;
    border-radius: var(--radius-pill) !important;
    background: linear-gradient(135deg, #FF6B4A 0%, #FF8E53 100%) !important;
    border: none !important;
    color: #FFFFFF !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    box-shadow: 0 10px 25px rgba(255, 107, 74, 0.45) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
}

#btnGenerate:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(255, 107, 74, 0.55) !important;
}

#btnGenerate:active {
    transform: scale(0.97);
}

/* ==========================================================================
   6. Velké odškrtávací položky surovin a kroků (.step-check)
   ========================================================================== */
.step-check {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    min-height: 50px;
    padding: 0.9rem 1.1rem;
    margin-bottom: 0.75rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

.step-check:hover {
    background-color: #FFFFFF;
    border-color: #CED4DA;
}

.step-check:active {
    transform: scale(0.99);
}

.step-check input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-top: 2px;
    accent-color: var(--secondary-green);
    cursor: pointer;
    flex-shrink: 0;
}

.step-check .step-text {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-heading);
    transition: all 0.25s ease;
}

.step-check input[type="checkbox"]:checked ~ .step-text,
.step-check.checked .step-text {
    text-decoration: line-through;
    opacity: 0.45;
    color: var(--text-muted);
}

/* ==========================================================================
   7. Vizuální spinnery a celoobrazovkový AI loader
   ========================================================================== */
@keyframes ai-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes ai-pulse-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15) rotate(5deg); }
}

.btn-loading {
    pointer-events: none !important;
    opacity: 0.85;
}

.ai-spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: ai-spin 0.75s linear infinite;
    vertical-align: text-bottom;
    margin-right: 0.5rem;
}

.ai-overlay-loader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(251, 249, 245, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.ai-overlay-loader.active {
    opacity: 1;
    pointer-events: auto;
}

.ai-overlay-icon {
    font-size: 4rem;
    margin-bottom: 1.25rem;
    animation: ai-pulse-bounce 2s ease-in-out infinite;
    display: inline-block;
}

.ai-overlay-spinner {
    width: 54px;
    height: 54px;
    border: 4px solid #FFE8CC;
    border-top-color: var(--primary-orange);
    border-radius: 50%;
    animation: ai-spin 0.9s linear infinite;
    margin-bottom: 1.25rem;
}

/* ==========================================================================
   8. Režim vaření (Wake Lock)
   ========================================================================== */
.btn-wake-lock {
    transition: all 0.25s ease;
    border-radius: var(--radius-pill);
    font-weight: 600;
}

.btn-wake-lock.active {
    background-color: #FFF4E6;
    border-color: #FFE8CC;
    color: var(--primary-orange);
    box-shadow: 0 0 12px rgba(232, 89, 12, 0.25);
}

.btn-wake-lock.active::before {
    content: "💡 ";
}
