/* ==========================================
   🍳 КУХОННЫЙ РЕЖИМ (Kitchen Mode 2.0)
   Удобный мобильный интерфейс для кухни со свайпами и ингредиентами
   ========================================== */

.cook-mode-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #FFF8F0;
    display: flex;
    flex-direction: column;
    color: #2C1810;
    font-family: inherit;
    overflow: hidden;
    user-select: none;
    touch-action: pan-y;
}

/* === HEADER === */
.cook-mode-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(135deg, #D4A574, #A0722D);
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    flex-shrink: 0;
    gap: 8px;
}

.cook-mode-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.cook-mode-title {
    font-size: 16px;
    font-weight: 800;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: 55vw;
}

.cook-mode-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.cook-mode-btn-sm {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}
.cook-mode-btn-sm:active {
    background: rgba(255, 255, 255, 0.45);
    transform: scale(0.95);
}

.cook-mode-close {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: #fff;
    font-size: 20px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.cook-mode-close:active { background: rgba(255, 255, 255, 0.5); }

/* === PROGRESS BAR === */
.cook-mode-progress {
    height: 6px;
    background: #F0DCC0;
    flex-shrink: 0;
}
.cook-mode-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #F59E0B, #E65100);
    width: 0%;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === BODY (ШАГ) === */
.cook-mode-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    position: relative;
    touch-action: pan-y;
}

.cook-mode-step-num {
    font-size: 14px;
    font-weight: 800;
    color: #D97706;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.cook-mode-step-text {
    font-size: 22px;
    line-height: 1.55;
    font-weight: 600;
    color: #2C1810;
    margin-bottom: 16px;
    white-space: pre-wrap;
    transition: font-size 0.15s ease;
}

/* Размеры шрифта по выбору пользователя */
.cook-mode-body.font-large .cook-mode-step-text {
    font-size: 26px;
    line-height: 1.6;
}
.cook-mode-body.font-xlarge .cook-mode-step-text {
    font-size: 30px;
    line-height: 1.65;
}

.cook-mode-step-image {
    max-width: 100%;
    max-height: 36vh;
    border-radius: 16px;
    margin: 0 auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    object-fit: cover;
}

.cook-mode-hint-swipe {
    font-size: 11px;
    color: #8D6E63;
    margin-top: 10px;
    font-weight: 600;
}

/* === ВСПЛЫВАЮЩАЯ ПАНЕЛЬ ИНГРЕДИЕНТОВ === */
.cook-mode-ingredients-panel {
    position: absolute;
    inset: 0;
    background: rgba(255, 248, 240, 0.98);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: none;
    flex-direction: column;
    padding: 16px;
    overflow-y: auto;
}
.cook-mode-ingredients-panel.open {
    display: flex;
}
.cook-mode-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #E8D5B8;
    padding-bottom: 10px;
    margin-bottom: 14px;
}
.cook-mode-panel-title {
    font-size: 18px;
    font-weight: 800;
    color: #2C1810;
    margin: 0;
}
.cook-mode-panel-close {
    background: #E8D5B8;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-weight: 700;
    cursor: pointer;
    color: #2C1810;
}
.cook-mode-ingredients-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cook-mode-ing-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FFFDF8;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #E8D5B8;
    font-size: 15px;
    font-weight: 600;
}

/* === TIMER === */
.cook-mode-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 16px;
    background: #FFFDF8;
    border-top: 2px dashed #E8D5B8;
    flex-shrink: 0;
}

.cook-mode-timer-display {
    font-size: 28px;
    font-weight: 900;
    color: #B91C1C;
    font-variant-numeric: tabular-nums;
    min-width: 100px;
    text-align: center;
}

.cook-mode-timer-btn {
    padding: 9px 15px;
    border-radius: 12px;
    background: #F59E0B;
    color: #fff;
    border: none;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    min-height: 42px;
    transition: all 0.15s;
}
.cook-mode-timer-btn:active { transform: scale(0.96); }
.cook-mode-timer-reset { background: #E8D5B8; color: #2C1810; }

/* === NAVIGATION BUTTONS === */
.cook-mode-nav {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
    background: #FFFDF8;
    border-top: 2px solid #E8D5B8;
    flex-shrink: 0;
}

.cook-mode-btn {
    flex: 1;
    padding: 14px 12px;
    border-radius: 14px;
    border: none;
    font-family: inherit;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    min-height: 52px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.cook-mode-prev {
    background: #E8D5B8;
    color: #2C1810;
}
.cook-mode-next, .cook-mode-done {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: #fff;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}
.cook-mode-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.cook-mode-btn:not(:disabled):active { transform: scale(0.97); }

/* === ПЛАВАЮЩАЯ КНОПКА НА СМАРТФОНЕ (FAB) === */
.floating-cook-btn {
    display: none;
    position: fixed;
    bottom: calc(75px + env(safe-area-inset-bottom, 0));
    right: 16px;
    z-index: 850;
    background: linear-gradient(135deg, #F59E0B, #E65100);
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(230, 81, 0, 0.45);
    cursor: pointer;
    align-items: center;
    gap: 8px;
    animation: cookPulse 2.5s infinite;
}

@keyframes cookPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.04); box-shadow: 0 10px 28px rgba(230, 81, 0, 0.6); }
    100% { transform: scale(1); }
}

@media (max-width: 768px) {
    .floating-cook-btn {
        display: flex;
    }
}


/* ========================================================
   🎙️ ГОЛОСОВОЕ УПРАВЛЕНИЕ HANDS-FREE И ОЗВУЧКА ШАГОВ (ЭТАП 121)
   ======================================================== */
.cook-mode-voice-btn {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s ease;
    white-space: nowrap;
}
.cook-mode-voice-btn:hover { background: rgba(255, 255, 255, 0.3); }
.cook-mode-voice-btn.active {
    background: #10B981 !important;
    border-color: #34D399 !important;
    color: #fff !important;
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.7);
    animation: pulse-voice 1.8s infinite;
}
@keyframes pulse-voice {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.04); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.cook-mode-speak-btn {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.cook-mode-speak-btn.speaking {
    background: #F59E0B !important;
    border-color: #FBBF24 !important;
    animation: pulse-speak 1s infinite alternate;
}
@keyframes pulse-speak { from { opacity: 0.8; } to { opacity: 1; } }
.cook-mode-help-btn {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.cook-mode-voice-hud {
    position: absolute;
    top: 75px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26, 18, 11, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
    max-width: 90%;
    text-align: center;
    pointer-events: none;
    animation: fadeInHud 0.25s ease;
}
@keyframes fadeInHud {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
.voice-pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 8px #10B981;
    animation: pulse-dot 1.2s infinite;
    flex-shrink: 0;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.7); }
}
.cook-voice-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10005;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.cook-voice-modal-card {
    background: #FFFBF5;
    border-radius: 20px;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    border: 1px solid #EAD8C4;
    overflow: hidden;
    animation: modalScale 0.25s ease;
}
@keyframes modalScale {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.cook-voice-modal-head {
    background: linear-gradient(135deg, #D4A574, #A0722D);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cook-voice-modal-title { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.cook-voice-modal-close {
    background: rgba(255,255,255,0.25);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 800;
}
.cook-voice-modal-body {
    padding: 16px 20px;
    max-height: 70vh;
    overflow-y: auto;
    font-size: 14px;
    color: #2C1810;
}
.cook-voice-cmd-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #F3E5D4;
}
.cook-voice-cmd-row:last-child { border-bottom: none; }
.cook-voice-cmd-badge {
    background: #FEF3C7;
    color: #92400E;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
    white-space: nowrap;
    border: 1px solid #FDE68A;
}
.cook-voice-cmd-desc { font-size: 13px; color: #4B3320; line-height: 1.4; }
