/* Стили для электронного меню на Smart TV - ПОЛНОЭКРАННАЯ ВЕРСИЯ */

/* =============== ОСНОВНЫЕ СТИЛИ =============== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    color: #ffffff;
}

/* Отключаем выделение текста для TV */
body, body * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    cursor: default;
}

/* =============== LAYOUT =============== */
.tv-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    position: relative;
}

.tv-header {
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
    color: #000000;
    padding: 8px 20px; /* Уменьшено с 15px */
    height: 50px; /* Уменьшено с 70px */
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.tv-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.tv-logo h1 {
    font-size: clamp(20px, 2.5vw, 28px); /* Уменьшено с 32px */
    font-weight: bold;
    margin: 0;
}

.tv-time {
    text-align: right;
    font-weight: bold;
}

.tv-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 15px; /* Уменьшено с 20px */
    height: calc(100vh - 90px); /* Обновлено под новые размеры шапки/подвала */
}

.tv-footer {
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    padding: 6px 20px; /* Уменьшено с 10px */
    height: 40px; /* Уменьшено с 50px */
    border-top: 2px solid #d4af37;
    z-index: 100;
}

.tv-footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: clamp(12px, 1.2vw, 16px); /* Уменьшено */
}

/* =============== ЭКРАН ОБЩЕГО ОБЗОРА МЕНЮ =============== */
.menu-overview-screen {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Изменяем на 3 равные колонки */
    gap: 20px;
    height: 100%;
    overflow: hidden;
}

.menu-overview-column {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.overview-section {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    padding: 15px; /* Уменьшено с 20px */
    border: 2px solid rgba(212, 175, 55, 0.5);
    margin-bottom: 15px;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.overview-section h3 {
    color: #d4af37;
    font-size: clamp(16px, 2vw, 24px); /* Уменьшено */
    margin-bottom: 10px; /* Уменьшено */
    border-bottom: 2px solid rgba(212, 175, 55, 0.5);
    padding-bottom: 5px;
    flex-shrink: 0;
}

.overview-categories, .overview-dishes {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px; /* Уменьшено */
}

.overview-category-header {
    color: #d4af37;
    font-size: clamp(14px, 1.5vw, 18px);
    font-weight: bold;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.overview-dish-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 8px 12px; /* Уменьшено */
    border: 1px solid rgba(212, 175, 55, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: clamp(11px, 1.2vw, 14px); /* Уменьшено */
    line-height: 1.2;
}

.overview-dish-name {
    flex: 1;
    margin-right: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overview-dish-price {
    color: #d4af37;
    font-weight: bold;
    font-size: clamp(12px, 1.3vw, 16px);
    flex-shrink: 0;
}

/* =============== ЭКРАН КАТЕГОРИИ =============== */
.category-screen {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.category-header {
    margin-bottom: 15px; /* Уменьшено */
    text-align: center;
    flex-shrink: 0;
}

.category-title {
    font-size: clamp(24px, 3.5vw, 42px); /* Уменьшено */
    color: #d4af37;
    margin-bottom: 8px; /* Уменьшено */
    font-weight: bold;
}

.category-description {
    font-size: clamp(14px, 1.8vw, 20px); /* Уменьшено */
    color: #cccccc;
}

.category-dishes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Уменьшено с 320px */
    gap: 15px; /* Уменьшено */
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}

.category-dish-card {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid rgba(212, 175, 55, 0.3);
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 280px; /* Ограничиваем высоту карточек */
}

.category-dish-image {
    height: 120px; /* Уменьшено со 150px */
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.category-dish-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-dish-content {
    padding: 12px; /* Уменьшено с 15px */
    flex: 1;
    display: flex;
    flex-direction: column;
}

.category-dish-name {
    font-size: clamp(14px, 1.8vw, 20px); /* Уменьшено */
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 6px; /* Уменьшено */
    line-height: 1.2;
}

.category-dish-description {
    font-size: clamp(11px, 1.3vw, 14px); /* Уменьшено */
    color: #cccccc;
    margin-bottom: 8px; /* Уменьшено */
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

.category-dish-details {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
}

.category-dish-info {
    font-size: clamp(10px, 1.1vw, 12px); /* Уменьшено */
    color: #999999;
}

.category-dish-info div {
    margin-bottom: 2px;
}

.category-dish-price {
    font-size: clamp(16px, 2.2vw, 24px); /* Уменьшено */
    font-weight: bold;
    color: #d4af37;
}

/* =============== ЭКРАН БЛЮДА =============== */
.dish-screen {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px; /* Уменьшено */
    height: 100%;
    overflow: hidden;
}

.dish-left {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Уменьшено */
}

.dish-image-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    border: 2px solid rgba(212, 175, 55, 0.5);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px; /* Уменьшено */
    flex: 1;
}

.dish-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dish-quick-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px; /* Уменьшено */
}

.dish-info-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px; /* Уменьшено */
    padding: 12px; /* Уменьшено */
    text-align: center;
    border: 2px solid rgba(212, 175, 55, 0.3);
}

.dish-info-title {
    font-size: clamp(12px, 1.3vw, 16px); /* Уменьшено */
    color: #d4af37;
    margin-bottom: 6px; /* Уменьшено */
    font-weight: bold;
}

.dish-info-value {
    font-size: clamp(16px, 2vw, 22px); /* Уменьшено */
    font-weight: bold;
    color: #ffffff;
}

.dish-right {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dish-header {
    margin-bottom: 15px; /* Уменьшено */
    flex-shrink: 0;
}

.dish-name {
    font-size: clamp(22px, 3.2vw, 36px); /* Уменьшено */
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 8px; /* Уменьшено */
    line-height: 1.2;
}

.dish-description {
    font-size: clamp(14px, 1.6vw, 18px); /* Уменьшено */
    color: #cccccc;
    line-height: 1.3;
}

.dish-details {
    flex: 1;
    overflow: auto;
    padding-right: 10px;
}

.dish-section {
    margin-bottom: 18px; /* Уменьшено */
}

.dish-section-title {
    font-size: clamp(16px, 2vw, 22px); /* Уменьшено */
    color: #d4af37;
    margin-bottom: 10px; /* Уменьшено */
    border-bottom: 2px solid rgba(212, 175, 55, 0.5);
    padding-bottom: 4px; /* Уменьшено */
}

.dish-nutrition-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px; /* Уменьшено */
    margin-bottom: 15px; /* Уменьшено */
}

.dish-ingredients-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px; /* Уменьшено */
}

.dish-ingredient-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px; /* Уменьшено */
    padding: 8px; /* Уменьшено */
    border: 1px solid rgba(212, 175, 55, 0.3);
    font-size: clamp(12px, 1.3vw, 14px); /* Уменьшено */
}

.dish-instructions {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px; /* Уменьшено */
    padding: 15px; /* Уменьшено */
    border: 2px solid rgba(212, 175, 55, 0.3);
    font-size: clamp(13px, 1.5vw, 16px); /* Уменьшено */
    line-height: 1.4;
    max-height: 150px; /* Уменьшено */
    overflow-y: auto;
}

/* =============== АНИМАЦИИ =============== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-transition {
    animation: fadeInUp 0.5s ease-out;
}

/* =============== АДАПТИВНОСТЬ =============== */
@media (max-width: 1366px) and (max-height: 768px) {
    .tv-header {
        padding: 6px 15px;
        height: 45px;
    }
    
    .tv-main {
        padding: 12px;
        height: calc(100vh - 80px);
    }
    
    .tv-footer {
        padding: 5px 15px;
        height: 35px;
    }
    
    .menu-overview-screen {
        gap: 15px;
    }
    
    .category-dishes-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 12px;
    }
    
    .dish-screen {
        gap: 25px;
    }
    
    .overview-section {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .category-dish-card {
        max-height: 250px;
    }
    
    .category-dish-image {
        height: 100px;
    }
}

@media (max-width: 1024px) {
    .menu-overview-screen {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .category-dishes-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .dish-screen {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .dish-quick-info {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .menu-overview-column {
        max-height: 300px;
    }
}

/* Скрытие прокрутки */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ffd700 0%, #d4af37 100%);
}

/* Состояние загрузки */
.loading-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: clamp(24px, 3vw, 36px);
    color: #d4af37;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    border-top-color: #d4af37;
    animation: spin 1s ease-in-out infinite;
    margin-right: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
} 