/* webapp/css/style.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.5;
}

/* ============ ОСНОВНЫЕ СТИЛИ ============ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Шапка */
.header {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.header h1 {
    font-size: 2em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.header p {
    font-size: 1em;
    opacity: 0.95;
}

/* Категории продуктов */
.categories {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.category-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 30px;
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    white-space: nowrap;
}

.category-btn:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.category-btn.active {
    background: #667eea;
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Сетка продуктов */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.product-item {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.product-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.product-item.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
}

.product-item.selected::before {
    content: "✓";
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255,255,255,0.3);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.product-icon {
    font-size: 1.8em;
    display: block;
}

.product-name {
    font-weight: 500;
    font-size: 12px;
}

/* Кнопка отправки */
.send-btn {
    width: 100%;
    padding: 14px;
    font-size: 1.1em;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    margin-bottom: 10px;
}

.send-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.send-btn:disabled {
    background: #cbd5e1;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ============ ПОЛЕ ПОИСКА - СВЕТЛАЯ ТЕМА ============ */

#searchInput {
    background: white !important;
    border: 2px solid #e2e8f0 !important;
    color: #1e293b !important;
    flex: 1;
    padding: 12px 16px;
    border-radius: 30px;
    font-size: 16px;
    transition: all 0.3s ease;
}

#searchInput::placeholder {
    color: #94a3b8 !important;
}

#searchInput:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    outline: none;
}

#clearSearch {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: none !important;
    padding: 0 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease;
}

#clearSearch:hover {
    background: #e2e8f0 !important;
}

/* ============ КАРТОЧКИ РЕЦЕПТОВ ============ */

.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.recipe-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.recipe-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    color: white;
}

.recipe-info {
    padding: 16px;
}

.recipe-title {
    font-size: 1.1em;
    font-weight: 700;
    margin-bottom: 5px;
    color: #1e293b;
}

.recipe-category {
    display: inline-block;
    padding: 3px 10px;
    background: #f1f5f9;
    border-radius: 20px;
    font-size: 0.8em;
    color: #64748b;
    margin-bottom: 8px;
}

.recipe-ingredients {
    font-size: 0.9em;
    color: #64748b;
    margin-bottom: 10px;
    max-height: 45px;
    overflow: hidden;
}

.match-badge {
    color: white;
    padding: 3px 6px;
    border-radius: 20px;
    font-size: 0.8em;
    display: inline-block;
}

/* ============ ДЕТАЛЬНЫЙ РЕЦЕПТ ============ */

.recipe-detail {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    padding: 25px;
    max-width: 100%;
    word-wrap: break-word;
}

.recipe-detail-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 16px;
}

.recipe-detail-title {
    font-size: 2em;
    color: #1e293b;
    margin-bottom: 15px;
}

.recipe-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.meta-item {
    background: #f8fafc;
    padding: 8px 16px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 0.9em;
}

/* Ингредиенты - БОЛЕЕ КОМПАКТНЫЕ */
.ingredients-list {
    background: #f8fafc;
    border-radius: 16px;
    padding: 15px;
    margin: 15px 0;
    width: 100%;
    overflow: hidden;
}

.ingredients-list h3 {
    margin-bottom: 10px;
    color: #1e293b;
    font-size: 1.1em;
}

.ingredients-list ul {
    list-style: none;
    padding: 0;
}

.ingredients-list li {
    padding: 8px 12px;
    background: white;
    margin: 4px 0;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    word-break: break-word;
    font-size: 0.95em;
}

.ingredients-list li span:first-child {
    flex: 1;
    padding-right: 8px;
}

.ingredients-list li span:last-child {
    font-weight: 600;
    color: #667eea;
    white-space: nowrap;
    padding-left: 8px;
    font-size: 0.95em;
}

/* Инструкции */
.instructions {
    margin: 15px 0;
    width: 100%;
    overflow: hidden;
}

.instructions h3 {
    margin-bottom: 10px;
    color: #1e293b;
    font-size: 1.1em;
}

.instructions ol {
    list-style: none;
    padding-left: 0;
}

.instructions li {
    position: relative;
    padding-left: 40px;
    margin: 12px 0;
    min-height: 28px;
    word-break: break-word;
    line-height: 1.5;
    font-size: 0.95em;
}

.instructions .step-number {
    position: absolute;
    left: 0;
    top: 0;
    display: inline-block;
    width: 28px;
    height: 28px;
    background: #667eea;
    color: white;
    border-radius: 14px;
    text-align: center;
    line-height: 28px;
    font-weight: bold;
    font-size: 0.9em;
    flex-shrink: 0;
}

/* Навигация */
.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.nav-links {
    display: flex;
    gap: 10px;
}

.nav-link {
    padding: 6px 12px;
    color: #64748b;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.nav-link:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.nav-link.active {
    background: #667eea;
    color: white;
}

/* ============ АНИМАЦИИ ============ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============ ЗАГРУЗКА ============ */

.loading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

/* ============ УВЕДОМЛЕНИЯ ============ */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.notification.success {
    border-left: 4px solid #22c55e;
}

.notification.error {
    border-left: 4px solid #ef4444;
}

/* ============ ФИКСИРОВАННАЯ НИЖНЯЯ ПАНЕЛЬ ============ */

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px 0 20px;
    scroll-behavior: smooth;
}

.content::-webkit-scrollbar {
    width: 4px;
}

.content::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.content::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

.footer-bar {
    background: white;
    border-top: 2px solid #e2e8f0;
    padding: 15px 20px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
    border-radius: 20px 20px 0 0;
    margin-top: 10px;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    will-change: transform, opacity, visibility;
}

.footer-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-btn {
    padding: 12px 15px;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.footer-btn.primary,
.footer-btn.secondary {
    flex: 1 1 calc(50% - 5px);
    min-width: 120px;
}

.footer-btn.danger {
    flex: 1 1 100%;
    width: 100%;
    margin-top: 5px;
}

.footer-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.footer-btn.primary:disabled {
    background: #cbd5e1;
    box-shadow: none;
    opacity: 0.5;
    cursor: not-allowed;
}

.footer-btn.secondary {
    background: #f1f5f9;
    color: #475569;
}

.footer-btn.danger {
    background: #fee2e2;
    color: #ef4444;
}

.footer-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.footer-btn:active {
    transform: scale(0.98);
}

.selected-count {
    text-align: center;
    color: #64748b;
    font-size: 13px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}

/* ============ СТРАНИЦА РЕЗУЛЬТАТОВ ============ */

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.back-btn {
    background: #f1f5f9;
    border: none;
    border-radius: 30px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #475569;
    font-weight: 500;
}

.back-btn:hover {
    background: #e2e8f0;
}

.filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 0;
    margin-bottom: 15px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    background: #f1f5f9;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #475569;
}

.filter-chip.active {
    background: #667eea;
    color: white;
}

.filter-chip:hover {
    background: #e2e8f0;
}

.filter-chip.active:hover {
    background: #5a67d8;
}

/* ============ ФИЛЬТРЫ С ГОРИЗОНТАЛЬНЫМ СКРОЛЛОМ ============ */

.filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 0 15px 0;
    margin-bottom: 15px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    cursor: grab;
}

.filter-chips:active {
    cursor: grabbing;
}

.filter-chips::-webkit-scrollbar {
    height: 4px;
}

.filter-chips::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.filter-chips::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

.filter-chips::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.filter-chip {
    background: #f1f5f9;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #475569;
    display: inline-block;
    user-select: none;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.filter-chip:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.filter-chip.active {
    background: #667eea !important;
    color: white !important;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

/* Темная тема для фильтров */
.dark-theme .filter-chips::-webkit-scrollbar-track {
    background: #2d2d2d;
}

.dark-theme .filter-chips::-webkit-scrollbar-thumb {
    background: #4a4a4a;
}

.dark-theme .filter-chips::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}

.dark-theme .filter-chip {
    background: #3d3d3d !important;
    color: #e0e0e0 !important;
}

.dark-theme .filter-chip:hover {
    background: #4a4a4a !important;
}

.dark-theme .filter-chip.active {
    background: #8b9eff !important;
    color: white !important;
    box-shadow: 0 4px 10px rgba(139, 158, 255, 0.3);
}

/* Статистика */
.stats-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
    color: #64748b;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 30px;
}

/* Сообщение о конце списка */
.end-message {
    text-align: center;
    padding: 20px;
    color: #64748b;
    font-size: 13px;
}

/* Модальные окна */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 20px;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

/* ============ РЕЖИМ ПОИСКА - СКРЫТИЕ ФУТЕРА ============ */

body.search-mode .footer-bar {
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ============ АДАПТАЦИЯ ============ */

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }
    
    .recipe-detail {
        padding: 15px;
    }
    
    .recipe-detail-title {
        font-size: 1.6em;
    }
    
    .categories {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
        flex-wrap: nowrap;
    }
    
    .ingredients-list li {
        padding: 8px 10px;
    }
    
    .instructions li {
        padding-left: 35px;
    }
}

@media (max-width: 480px) {
    .footer-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .footer-btn.primary,
    .footer-btn.secondary {
        flex: 1 1 calc(50% - 5px);
        min-width: 0;
        padding: 10px 5px;
        font-size: 13px;
    }
    
    .footer-btn.danger {
        flex: 1 1 100%;
        margin-top: 8px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    }
    
    .product-icon {
        font-size: 1.3em;
    }
    
    .product-name {
        font-size: 10px;
    }
    
    .category-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .header h1 {
        font-size: 1.5em;
    }
    
    .header p {
        font-size: 0.9em;
    }
    
    .footer-bar {
        position: sticky;
        bottom: 0;
        background: white;
        z-index: 100;
    }
    
    #searchInput {
        font-size: 16px;
    }
    
    .ingredients-list li {
        flex-direction: row;
        align-items: center;
        gap: 5px;
    }
    
    .ingredients-list li span:first-child {
        padding-right: 5px;
        font-size: 0.9em;
    }
    
    .ingredients-list li span:last-child {
        padding-left: 5px;
        font-size: 0.9em;
    }
    
    .ingredients-list {
        padding: 12px;
    }
    
    .instructions li {
        padding-left: 32px;
        font-size: 0.9em;
    }
    
    .instructions .step-number {
        width: 24px;
        height: 24px;
        line-height: 24px;
        font-size: 0.85em;
    }
}

/* ============ ТЕМНАЯ ТЕМА ============ */

body.dark-theme,
body.dark-theme * {
    border-color: #404040 !important;
}

body.dark-theme {
    background: #1a1a1a !important;
}

body.dark-theme .header {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%) !important;
}

body.dark-theme .category-btn {
    background: #3d3d3d !important;
    color: #e0e0e0 !important;
}

body.dark-theme .category-btn.active {
    background: #8b9eff !important;
    color: white !important;
}

body.dark-theme .product-item {
    background: #2d2d2d !important;
    border-color: #404040 !important;
    color: white !important;
}

body.dark-theme .product-item.selected {
    background: linear-gradient(135deg, #8b9eff 0%, #9f7aea 100%) !important;
}

body.dark-theme .footer-bar {
    background: #2d2d2d !important;
    border-top-color: #404040 !important;
}

body.dark-theme .footer-btn.secondary {
    background: #3d3d3d !important;
    color: #e0e0e0 !important;
}

body.dark-theme .footer-btn.danger {
    background: #4a2a2a !important;
    color: #ff8a8a !important;
}

body.dark-theme .footer-btn.primary {
    background: linear-gradient(135deg, #8b9eff 0%, #9f7aea 100%) !important;
}

body.dark-theme #searchInput,
body.dark-theme #clearSearch {
    background: #3d3d3d !important;
    border-color: #404040 !important;
    color: white !important;
}

body.dark-theme #searchInput::placeholder {
    color: #a0a0a0 !important;
}

body.dark-theme .stats-bar {
    background: #3d3d3d !important;
    color: #e0e0e0 !important;
}

body.dark-theme .recipe-card {
    background: #2d2d2d !important;
}

body.dark-theme .recipe-title {
    color: white !important;
}

body.dark-theme .recipe-category {
    background: #3d3d3d !important;
    color: #a0a0a0 !important;
}

body.dark-theme .back-btn,
body.dark-theme .filter-chip {
    background: #3d3d3d !important;
    color: #e0e0e0 !important;
}

body.dark-theme .filter-chip.active {
    background: #8b9eff !important;
    color: white !important;
}

body.dark-theme .selected-count {
    color: #a0a0a0 !important;
    border-top-color: #404040 !important;
}

/* ДЕТАЛЬНЫЙ РЕЦЕПТ - ТЕМНАЯ ТЕМА */

body.dark-theme .recipe-detail {
    background: #2d2d2d !important;
}

body.dark-theme .recipe-detail h1,
body.dark-theme .recipe-detail h3 {
    color: white !important;
}

body.dark-theme .ingredients-list {
    background: #3d3d3d !important;
}

body.dark-theme .ingredients-list li {
    background: #2d2d2d !important;
    color: white !important;
    border: 1px solid #404040 !important;
}

body.dark-theme .ingredients-list li span:last-child {
    color: #8b9eff !important;
}

body.dark-theme .meta-item {
    background: #3d3d3d !important;
    color: #e0e0e0 !important;
}

body.dark-theme .instructions {
    color: #e0e0e0 !important;
}

body.dark-theme .instructions .step-number {
    background: #8b9eff !important;
}

body.dark-theme p[style*="color: #ef4444"] {
    background: #4a2a2a !important;
    color: #ff8a8a !important;
}

body.dark-theme p[style*="color: #22c55e"] {
    background: #22c55e !important;
    color: white !important;
}

body.dark-theme span[style*="color: #667eea"] {
    color: #8b9eff !important;
}

/* ============ ИСПРАВЛЕНИЯ ДЛЯ ПОИСКА В РЕЦЕПТАХ ============ */

/* Поле поиска в светлой теме */
#recipeSearchInput {
    background: white !important;
    border: 2px solid #e2e8f0 !important;
    color: #1e293b !important;
    flex: 1;
    padding: 12px 16px;
    border-radius: 30px;
    font-size: 16px;
    transition: all 0.3s ease;
}

#recipeSearchInput::placeholder {
    color: #94a3b8 !important;
}

#recipeSearchInput:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    outline: none;
}

/* Кнопка очистки в светлой теме */
#clearRecipeSearch {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: none !important;
    padding: 0 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease;
}

#clearRecipeSearch:hover {
    background: #e2e8f0 !important;
}

/* Тёмная тема для поиска в рецептах */
.dark-theme #recipeSearchInput {
    background: #3d3d3d !important;
    border-color: #404040 !important;
    color: white !important;
}

.dark-theme #recipeSearchInput::placeholder {
    color: #a0a0a0 !important;
}

.dark-theme #clearRecipeSearch {
    background: #3d3d3d !important;
    color: #e0e0e0 !important;
}

.dark-theme #clearRecipeSearch:hover {
    background: #4a4a4a !important;
}

/* ============ УБИРАЕМ КНОПКУ НАЗАД ВО "ВСЕХ РЕЦЕПТАХ" ============ */

/* Скрываем кнопку назад на странице со всеми рецептами */
.recipes-page .back-btn {
    display: none !important;
}

/* Альтернативный вариант - скрываем через URL параметр */
body[data-page="all-recipes"] .back-btn {
    display: none !important;
}

/* Центрируем заголовок когда нет кнопки назад */
.recipes-page .results-header span {
    margin: 0 auto !important;
}

/* ============ PREMIUM MODAL ============ */
.premium-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.premium-modal-content {
    background: white;
    border-radius: 30px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.4s ease;
    box-shadow: 0 30px 60px rgba(102, 126, 234, 0.3);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 18px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: #e2e8f0;
    transform: scale(1.1);
}

.premium-header {
    text-align: center;
    margin-bottom: 20px;
}

.premium-emoji {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.premium-header h2 {
    font-size: 28px;
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.premium-features {
    margin: 25px 0;
}

.feature {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.feature-check {
    font-size: 24px;
    min-width: 32px;
}

.feature strong {
    font-size: 16px;
    display: block;
    margin-bottom: 4px;
    color: #1e293b;
}

.feature p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

.premium-price {
    text-align: center;
    margin: 30px 0 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 20px;
}

.price-tag {
    font-size: 36px;
    font-weight: 700;
    color: #1e293b;
}

.stars {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.period {
    font-size: 16px;
    color: #64748b;
    font-weight: normal;
}

.price-note {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 8px;
}

.premium-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.buy-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.buy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
}

.cancel-button {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: #64748b;
    border: 2px solid #e2e8f0;
    border-radius: 30px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-button:hover {
    background: #f1f5f9;
}

/* Премиум-бейдж на карточках */
.premium-badge {
    animation: glow 2s ease-in-out infinite;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

@keyframes glow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.02); }
}

/* Затемнённые премиум-карточки */
.recipe-card.premium-locked {
    cursor: default;
}

.recipe-card.premium-locked:hover {
    transform: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Счётчик Premium в хедере */
.premium-counter {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.9; }
}

/* Тёмная тема */
body.dark-theme .premium-modal-content {
    background: #2d2d2d;
}

body.dark-theme .feature strong {
    color: white;
}

body.dark-theme .feature p {
    color: #a0a0a0;
}

body.dark-theme .premium-price {
    background: #3d3d3d;
}

body.dark-theme .price-tag {
    color: white;
}

body.dark-theme .close-modal {
    background: #3d3d3d;
    color: #e0e0e0;
}

body.dark-theme .close-modal:hover {
    background: #4a4a4a;
}