/*
Theme Name: FE2 — Feel Energy to sing
Theme URI: https://fe2.ru
Author: FE2
Description: Тема для сервиса удаления вокала и караоке FE2.
Version: 1.0
Text Domain: fe2
*/

/* --- Базовые стили и переменные --- */
:root {
    --bg-dark: #0a0a16;
    --bg-card: rgba(255, 255, 255, 0.03);
    --primary: #ff3366;
    --primary-hover: #ff5c85;
    --secondary: #7000ff;
    --text-main: #ffffff;
    --text-muted: #9ba1b0;
    --border: rgba(255, 255, 255, 0.08);
    --success: #00e676;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(112, 0, 255, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(255, 51, 102, 0.15), transparent 25%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    padding: 2rem 1rem;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* --- Шапка --- */
header {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInDown 0.8s ease-out;
}

.logo {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* --- Карточки --- */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 2.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

/* --- Заголовки и тексты --- */
.seo-h1 {
    font-size: 2.2rem;
    text-align: center;
    margin: 1.5rem 0 1rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
}

.seo-text {
    color: var(--text-muted);
    font-size: 1.05rem;
    text-align: center;
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Блок "Как это работает" --- */
.how-it-works {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.step-num {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.step-text h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.step-text p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- Зона загрузки --- */
.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.2);
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(255, 51, 102, 0.05);
    transform: scale(1.02);
}

.drop-zone-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

.drop-zone p {
    font-size: 1.1rem;
    font-weight: 500;
}

.drop-zone .hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    font-weight: 400;
}

input[type="file"] {
    display: none;
}

#audioFileName {
    margin-top: 1.5rem;
    color: var(--primary);
    font-weight: 600;
    word-break: break-all;
    padding: 0.5rem 1rem;
    background: rgba(255, 51, 102, 0.1);
    border-radius: 8px;
    display: inline-block;
}

/* --- Кнопки --- */
.btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    border: none;
    padding: 1.2rem 2rem;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 4px 15px rgba(255, 51, 102, 0.3);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 51, 102, 0.5);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(100%);
}

.btn-karaoke {
    background: linear-gradient(135deg, #00e676 0%, #00b0ff 100%);
    box-shadow: 0 4px 15px rgba(0, 230, 118, 0.3);
    margin-top: 1rem;
}

.btn-karaoke:hover:not(:disabled) {
    box-shadow: 0 8px 25px rgba(0, 230, 118, 0.5);
}

/* --- Прогресс --- */
.progress-container {
    margin-top: 2rem;
}

.progress-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 10px;
}

.status {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: center;
    font-weight: 500;
}

/* --- Статистика --- */
.stats-row {
    display: flex;
    justify-content: space-around;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.2rem;
}

/* --- Логи --- */
.status-detail {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    font-family: monospace;
    font-size: 0.85rem;
    max-height: 150px;
    overflow-y: auto;
    display: none;
    border: 1px solid var(--border);
}

.status-detail.visible {
    display: block;
}

.status-detail .log-line {
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.status-detail .log-line:last-child {
    border-bottom: none;
}

.status-detail .log-time {
    color: var(--primary);
    margin-right: 0.5rem;
}

.status-detail .log-phase {
    color: #ffc864;
    margin-right: 0.5rem;
    font-weight: bold;
}

/* --- Бейджи --- */
.info-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--border);
}

.webgpu-status {
    text-align: center;
    margin-bottom: 1.5rem;
}

/* --- Системные требования --- */
.sys-req {
    background: rgba(255, 200, 100, 0.05);
    border: 1px solid rgba(255, 200, 100, 0.2);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.sys-req h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffc864;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sys-req ul {
    list-style: none;
}

.sys-req li {
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.sys-req li::before {
    content: "•";
    color: #ffc864;
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1;
}

/* --- Поле ввода текста --- */
.lyrics-input-container {
    margin-top: 1.5rem;
    text-align: left;
}

.lyrics-input-container label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #fff;
}

.lyrics-textarea {
    width: 100%;
    height: 120px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s;
}

.lyrics-textarea:focus {
    border-color: var(--primary);
}

.lyrics-textarea::placeholder {
    color: var(--text-muted);
}

/* --- Результаты --- */
.results {
    display: none;
}

.results.visible {
    display: block;
    animation: fadeInUp 0.6s ease-out;
}

.results h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
}

.karaoke-banner {
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.1) 0%, rgba(0, 176, 255, 0.1) 100%);
    border: 1px solid rgba(0, 230, 118, 0.3);
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    text-align: center;
}

.karaoke-banner p {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

/* --- Дорожки --- */
.track {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    margin-bottom: 0.8rem;
    gap: 1rem;
    border: 1px solid var(--border);
    transition: background 0.2s;
}

.track:hover {
    background: rgba(255, 255, 255, 0.05);
}

.track-name {
    font-weight: 600;
    font-size: 1.1rem;
    min-width: 100px;
}

.track-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.track-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.track-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

audio {
    outline: none;
}

audio::-webkit-media-controls-panel {
    background-color: rgba(255, 255, 255, 0.1);
}

/* --- Подвал --- */
.footer-note {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 3rem;
    padding-bottom: 2rem;
}

/* --- Cookie-баннер --- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 15, 25, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 800px;
}

.cookie-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s;
}

.cookie-btn:hover {
    background: var(--primary-hover);
}

/* --- Караоке-экран --- */
#karaokeScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

#karaokeScreen.visible {
    display: flex;
}

#visualizerCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.karaoke-lyrics-display {
    position: absolute;
    top: 15%;
    left: 5%;
    width: 90%;
    z-index: 2;
    text-align: center;
    pointer-events: none;
}

.karaoke-lyrics-display p {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.3;
    color: #fff;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 40px rgba(255, 51, 102, 0.5);
    white-space: pre-wrap;
}

.karaoke-controls {
    position: relative;
    z-index: 2;
    margin-top: auto;
    padding: 3rem;
    display: flex;
    justify-content: center;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
}

.karaoke-btn {
    background: rgba(255, 51, 102, 0.2);
    border: 2px solid var(--primary);
    color: #fff;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-family: inherit;
}

.karaoke-btn:hover {
    background: var(--primary);
    transform: scale(1.05);
}

.mic-status {
    position: absolute;
    top: 2rem;
    left: 2rem;
    z-index: 2;
    color: #fff;
    font-weight: 600;
    display: none;
    align-items: center;
    gap: 0.8rem;
    background: rgba(255, 51, 102, 0.2);
    border: 1px solid var(--primary);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    backdrop-filter: blur(10px);
}

.mic-status.active {
    display: flex;
}

.mic-dot {
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

/* --- Анимации --- */
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 51, 102, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(255, 51, 102, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 51, 102, 0); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Мобильная адаптация --- */
@media (max-width: 600px) {
    .logo { font-size: 2.5rem; }
    .seo-h1 { font-size: 1.6rem; }
    .card { padding: 1.5rem; }
    .drop-zone { padding: 2.5rem 1rem; }
    .track { flex-direction: column; align-items: flex-start; }
    .track-controls { width: 100%; justify-content: space-between; }
    .stats-row { flex-wrap: wrap; gap: 1rem; }
    .stat-item { flex: 1 1 40%; }
    .karaoke-lyrics-display p { font-size: 1.8rem; }
    .cookie-banner { padding: 1rem; }
}