/* css/video.css */

/* ==========================================================================
   1. СЕТКА ВИДЕО И КАРТОЧКИ
   ========================================================================== */
#video-grid {
    display: grid;
    /* Для мобильных: уменьшаем с 110px до 90px, чтобы влезало по 3-4 штуки */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    padding-bottom: 80px;
    width: 100%;
}

@media (min-width: 768px) {
    #video-grid {
        /* Для ПК: уменьшаем с 140px до 110px. 
           Теперь карточки будут компактнее, и в ряду их поместится больше. */
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 10px; /* Чуть уменьшил отступ для плотности */
    }
}

.video-card {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; /* Карточка всегда квадратная */
    background-color: var(--bg-card, #141414);
    border-radius: 12px; /* Чуть меньше радиус для маленьких карт */
    overflow: hidden;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.video-card:hover {
    border-color: var(--primary, #FABF3C);
    box-shadow: 0 0 15px rgba(250, 191, 60, 0.2);
    transform: translateY(-2px);
    z-index: 2;
}

.video-card video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* Кнопка Play по центру (УМЕНЬШЕНА под новые размеры) */
.video-play-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 32px; /* Было 48px */
    height: 32px; /* Было 48px */
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s ease;
    z-index: 10; pointer-events: none;
}

.video-play-icon svg {
    width: 16px; /* Иконка внутри тоже меньше */
    height: 16px;
}

.video-card:hover .video-play-icon {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(255, 215, 0, 0.9);
    border-color: transparent;
}
.video-card:hover .video-play-icon svg { fill: #000; }

/* Бейдж "VIDEO" (Уменьшен шрифт) */
.video-card-badge {
    position: absolute; top: 6px; left: 6px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 3px 6px; border-radius: 4px;
    font-size: 9px; font-weight: 700; /* Шрифт меньше */
    letter-spacing: 0.5px; text-transform: uppercase;
    z-index: 10; display: flex; align-items: center; gap: 4px;
}

/* Кнопка удаления */
.video-delete-btn {
    position: absolute; top: 6px; right: 6px;
    width: 24px; height: 24px; /* Чуть меньше */
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%; color: #fff;
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: 0.2s; z-index: 20;
}
.video-delete-btn svg { width: 12px; height: 12px; }

.video-card:hover .video-delete-btn { opacity: 1; }
.video-delete-btn:hover { background: #dc3545; transform: scale(1.1); }

@media (max-width: 768px) {
    .video-delete-btn { opacity: 1; background: rgba(0, 0, 0, 0.7); }
}
========================================================================== */

/* ==========================================================================
   2. ИНТЕРФЕЙС VEO (НОВЫЕ СТИЛИ)
   ========================================================================== */

/* Контейнер панели Veo */
.veo-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 20px;
}

/* Контейнер для слотов */
.veo-slots-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

/* Слоты загрузки (квадратики) */
.veo-upload-slot {
    flex: 1; /* Растягиваем на всю ширину равномерно */
    
    /* === ГЛАВНОЕ: ДЕЛАЕМ КВАДРАТ === */
    aspect-ratio: 1 / 1; 
    /* ============================================ */
    
    background: linear-gradient(145deg, #1e2126, #15171a);
    border: 1px dashed var(--border-color, #444);
    border-radius: 16px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    
    display: flex;
    align-items: center;
    justify-content: center;
}

.veo-upload-slot:hover {
    border-color: var(--primary, #FABF3C);
    background: #25282d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Контент внутри пустого слота */
.slot-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    pointer-events: none;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.veo-upload-slot:hover .slot-content {
    opacity: 1;
    color: var(--primary, #FABF3C);
}

.slot-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.slot-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.veo-upload-slot .placeholder {
    color: var(--text-secondary, #666);
    font-size: 24px; font-weight: 300; pointer-events: none;
}

/* Превью картинки */
.veo-upload-slot .preview-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 1;
    border-radius: 15px; /* Чуть меньше, чем контейнер */
}

/* Кнопка удаления */
.veo-upload-slot .remove-btn {
    position: absolute;
    top: 5px; right: 5px;
    width: 24px; height: 24px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 50%;
    
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; line-height: 1;
    z-index: 2;
    transition: all 0.2s;
}
.veo-upload-slot .remove-btn:hover {
    background: #dc3545;
    border-color: #dc3545;
    transform: scale(1.1);
}

/* --- ИНФОРМАЦИОННЫЙ БЛОК --- */
.veo-info-block {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.badge-number {
    background: var(--primary, #FABF3C);
    color: #000;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
    margin-top: 2px;
}

.info-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.info-text strong {
    font-size: 13px;
    color: var(--text-main, #fff);
    margin-bottom: 2px;
}

.info-text small {
    font-size: 11px;
    color: var(--text-secondary, #888);
}

/* Кнопки переключения модели (Fast/Quality) */
.veo-type-btn {
    border: none;
    color: var(--text-secondary, #aaa);
    font-weight: 600;
    padding: 8px;
    border-radius: 10px !important; /* Важно для перебивания бутстрапа */
    transition: all 0.2s;
}

.btn-check:checked + .veo-type-btn {
    background-color: var(--bg-card, #2b2f36) !important;
    color: var(--primary, #fff) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border: 1px solid var(--border-color, #555);
}

/* Кнопки аспекта */
.aspect-btn {
    border-color: var(--border-color, #444);
    color: #ccc;
    font-size: 13px;
}
.btn-check:checked + .aspect-btn {
    background-color: var(--primary, #FABF3C) !important;
    border-color: var(--primary, #FABF3C) !important;
    color: #000 !important;
    font-weight: 700;
}

/* Стили для радио-кнопок (Veo Models & Aspect Ratio) */
/* Адаптируем Bootstrap классы под ваш дизайн */
.btn-check:checked + .btn-outline-primary,
.btn-check:checked + .btn-outline-secondary {
    background-color: var(--primary, #FABF3C) !important;
    border-color: var(--primary, #FABF3C) !important;
    color: #000 !important; /* Черный текст на активной кнопке */
    box-shadow: 0 4px 12px rgba(250, 191, 60, 0.3);
}

.btn-outline-primary, .btn-outline-secondary {
    border-color: var(--border-color, #444);
    color: var(--text-secondary, #ccc);
    background: transparent;
}

.btn-outline-primary:hover, .btn-outline-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: #666;
    color: #fff;
}

/* Поле ввода сида */
#veo-seed {
    background: var(--bg-input, #1a1a1a) !important;
    border: 1px solid var(--border-color, #333) !important;
    color: var(--text-main, #fff) !important;
}
#veo-seed::placeholder { color: #666; }
#veo-seed:focus { border-color: var(--primary, #FABF3C) !important; box-shadow: none; }


/* ==========================================================================
   3. ИНТЕРФЕЙС GROK (СУЩЕСТВУЮЩИЕ СТИЛИ)
   ========================================================================== */

/* Переключатель режимов (Текст/Фото) */
.video-mode-switcher {
    position: relative; display: flex; width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px; padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px; user-select: none;
}

.video-mode-switcher input[type="radio"] { display: none; }

.video-mode-switcher label {
    flex: 1; text-align: center; padding: 10px 0;
    cursor: pointer; z-index: 2;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600; font-size: 0.95rem;
    transition: color 0.3s ease;
}

.switcher-bg {
    position: absolute; top: 4px; left: 4px;
    width: calc(50% - 4px); height: calc(100% - 8px);
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-radius: 8px;
    transition: transform 0.3s cubic-bezier(0.45, 0.05, 0.55, 0.95);
    z-index: 1; box-shadow: 0 2px 10px rgba(255, 215, 0, 0.2);
}

#vmode-text:checked ~ .switcher-bg { transform: translateX(0); }
#vmode-text:checked + label { color: #000; }
#vmode-image:checked ~ .switcher-bg { transform: translateX(100%); }
#vmode-image:checked + label { color: #000; }

/* Область загрузки (Grok) */
.upload-drop-zone { /* Можно использовать .upload-area из main.css если есть */
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px; min-height: 100px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center; cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.2s ease;
}
.upload-drop-zone:hover { border-color: var(--primary, #FABF3C); background: rgba(250, 191, 60, 0.05); }

/* Кнопка генерации */
#generate-video-button {
    display: flex; align-items: center; justify-content: center;
    width: 100%; padding: 12px;
    font-size: 1rem; font-weight: bold;
    text-transform: uppercase; letter-spacing: 0.5px;
    background-color: var(--primary, #FABF3C);
    color: #000; border: none; border-radius: 12px;
    transition: all 0.3s ease;
}
#generate-video-button:hover {
    background-color: #ffca5c;
    box-shadow: 0 0 15px rgba(250, 191, 60, 0.4);
    transform: translateY(-2px);
}
#generate-video-button:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

/* Выпадающий список (Аспект) */
.custom-select {
    background-color: var(--bg-input, #1a1a1a);
    color: var(--text-main, #fff);
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
    border-radius: 10px; padding: 10px 12px;
    font-size: 14px; width: 100%; cursor: pointer;
}
.custom-select:focus { border-color: var(--primary, #FABF3C); outline: none; }