* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background: radial-gradient(circle at 50% 50%, #111218 0%, #06070a 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: #f3f4f6;
    overflow-y: auto;
}

/* ДОБАВЛЕНО: Главная обертка, которая центрирует карточку и прижимает футер вниз */
.page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 100vh;
    padding: 60px 20px 30px 20px;
}

.app-container {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 40px;
    border-radius: 32px;
    width: 100%;
    max-width: 620px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    position: relative;
    margin-top: auto;   /* МАГИЯ ЦЕНТРИРОВАНИЯ */
    margin-bottom: auto;/* МАГИЯ ЦЕНТРИРОВАНИЯ */
}

h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-align: center;
    background: linear-gradient(135deg, #ffffff 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.lead-text {
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.5;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

input[type="text"] {
    width: 100%;
    padding: 18px 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: all 0.3s;
    margin-bottom: 16px;
}
input[type="text"]:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.btn-main {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.25);
    transition: all 0.3s;
}
.btn-main:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.35);
}

/* БЛОК РЕЗУЛЬТАТА И СЕТКА КНОПОК */
.preview-box {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: none;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.4s ease forwards;
}

.meta-row {
    display: flex;
    gap: 16px;
    align-items: center;
    width: 100%;
}

.video-thumb {
    width: 140px;
    height: 85px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.video-title {
    font-size: 14px;
    font-weight: 700;
    color: #e2e8f0;
    line-height: 1.4;
}

.download-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.btn-download-item {
    width: 100%;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}
.btn-download-item:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: #6366f1;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}
.btn-download-item.audio-btn {
    border-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
}
.btn-download-item.audio-btn:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.format-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    color: #9ca3af;
}

/* НАСТРОЙКА КНОПКИ ДЛЯ ВНУТРЕННЕГО ПРОГРЕСС-БАРА */
.progress-btn-layout {
    position: relative;
    overflow: hidden !important; /* Чтобы ползунок не вылезал за скругления */
    background: rgba(255, 255, 255, 0.01) !important;
    transition: all 0.3s ease;
    opacity: 0.6;
}

/* Слой ползунка прогресса (Задний фон кнопки) */
.btn-progress-bg {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%; /* Управляется через JS */
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.05) 0%, rgba(99, 102, 241, 0.2) 100%);
    transition: width 0.4s ease;
    z-index: 1;
}

/* Отределенный цвет заливки для аудио-трека */
#btn-format-mp3 .btn-progress-bg {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.2) 100%);
}

/* Оболочка контента, чтобы текст парил НАД ползунком прогресса */
.btn-content-wrapper {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    z-index: 2; /* Поверх прогресс-бара */
}

/* Плавное зажигание кнопки при 100% готовности файла */
.ready-pulse {
    opacity: 1 !important;
    background: rgba(255, 255, 255, 0.04) !important;
    animation: pulse-glow-btn 2s ease-in-out;
}
.ready-pulse:hover {
    background: rgba(99, 102, 241, 0.15) !important;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}
#btn-format-mp3.ready-pulse:hover {
    background: rgba(16, 185, 129, 0.1) !important;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

@keyframes pulse-glow-btn {
    0% { transform: scale(1); }
    50% { transform: scale(1.01); filter: brightness(1.2); }
    100% { transform: scale(1); }
}

/* СТИЛЬ КНОПКИ РУЧНОГО СБРОСА СЕССИИ */
#btnReset {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #9ca3af !important;
    transition: all 0.2s ease;
}
#btnReset:hover {
    background: rgba(255, 255, 255, 0.07) !important;
    color: #fff !important;
    transform: translateY(0px) !important;
    box-shadow: none !important;
}

/* НАЙДИТЕ В САМОМ ВЕРХУ СЕКЦИЮ body И ОБНОВИТЕ ЕЁ: */
body {
    background: radial-gradient(circle at 50% 50%, #111218 0%, #06070a 100%);
    min-height: 100vh; /* Было height: 100vh */
    display: flex;
    flex-direction: column; /* Элементы выстраиваются сверху вниз */
    align-items: center;
    justify-content: space-between; /* Футер железно прижимается к низу */
    color: #f3f4f6;
    overflow-y: auto; /* Разрешаем плавный скролл вниз */
    padding: 40px 20px;
}

/* СТИЛИ ДЛЯ НАШЕГО НОВОГО ФУТЕРА */
.site-footer {
    width: 100%;
    max-width: 1000px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 13px;
    color: #6b7280;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 30px;
}

.footer-col h4 {
    color: #9ca3af;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.2px;
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col ul li a {
    color: #6b7280;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 600;
}

.footer-col ul li a:hover {
    color: #818cf8;
    text-shadow: 0 0 8px rgba(129, 140, 248, 0.4);
}

.footer-bottom {
    text-align: center;
    font-size: 12px;
    color: #4b5563;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.02);
}

/* Адаптивность для мобилок: на телефонах колонки встанут в один ряд */
@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; gap: 24px; text-align: center; }
    body { justify-content: flex-start; }
    .site-footer { margin-top: 40px; }
}


/* ПРОГРЕСС-БАР */
.progress-container { margin-top: 24px; display: none; text-align: left; }
.status-info { display: flex; justify-content: space-between; font-size: 13px; color: #9ca3af; margin-bottom: 6px; font-weight: 600; }
.progress-track { width: 100%; height: 5px; background: rgba(255, 255, 255, 0.05); border-radius: 10px; overflow: hidden; }
.progress-bar { width: 0%; height: 100%; background: linear-gradient(90deg, #6366f1, #a5b4fc); box-shadow: 0 0 10px rgba(99, 102, 241, 0.6); transition: width 0.3s ease; }
.pulse .progress-bar { animation: pulse-glow 1.5s infinite ease-in-out; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse-glow { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; filter: brightness(1.3); } }
/* АНИМАЦИЯ ВРАЩЕНИЯ ДЛЯ ЛОАДЕРА */
@keyframes rotate {
    100% { transform: rotate(360deg); }
}

/* ПАРЯЩИЙ МАТОВЫЙ КУКИ-БАННЕР */
.cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 650px;
    background: rgba(21, 22, 30, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 16px 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    z-index: 99999 !important;
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.cookie-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cookie-content p {
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.5;
    font-weight: 500;
}

.cookie-content p a {
    color: #818cf8;
    text-decoration: none;
    font-weight: 700;
}
.cookie-content p a:hover {
    text-decoration: underline;
}

/* Компактная неоновая кнопка принятия */
.btn-cookie-accept {
    padding: 10px 20px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}
.btn-cookie-accept:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

/* Анимация плавного выезда баннера снизу */
@keyframes slideUp {
    from { transform: translate(-50%, 100px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

/* Адаптивность для телефонов: текст и кнопка встанут друг под друга */
@media (max-width: 600px) {
    .cookie-content { flex-direction: column; text-align: center; gap: 14px; }
    .btn-cookie-accept { width: 100%; }
    .cookie-banner { bottom: 16px; padding: 20px; }
}

