/* === ОСНОВНЫЕ ПЕРЕМЕННЫЕ === */
:root {
    --index: calc(1vw + 1.2vh);
    --transition: 1.5s cubic-bezier(.05, .5, 0, 1);
    --glass-bg: rgba(0, 0, 0, 0.55);
    --glass-border: rgba(255, 255, 255, 0.15);
    --text-color: #ffffff;
    --accent: #a5d8ff;
    --accent2: #4dabf7;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

@font-face {
    font-family: 'kamerik-3d';
    src: url('../fonts/kamerik205-heavy.woff2') format('woff2');
    font-weight: 900;
}
@font-face {
    font-family: 'merriweather-italic';
    src: url('../fonts/merriweather-regular-italic.woff2') format('woff2');
}

body {
    background-color: #000;
    color: var(--text-color);
    font-family: 'merriweather-italic', serif;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    -webkit-font-smoothing: antialiased;
}

/* === 3D СЦЕНА (ФОН) === */
.layers {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    perspective: 1000px;
    overflow: hidden;
}
.layers__container {
    height: 100vh;
    transform-style: preserve-3d;
    transform: rotateX(var(--move-y, 0deg)) rotateY(var(--move-x, 0deg));
    will-change: transform;
    transition: transform var(--transition);
}
.layers__item {
    position: absolute;
    inset: -5vw;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
.layer-1 { transform: translateZ(-55px) scale(1.06); }
.layer-2 { transform: translateZ(80px) scale(0.88); }
.layer-4 { transform: translateZ(190px) scale(0.9); }
.layer-5 { transform: translateZ(300px) scale(0.9); }
.layer-6 { transform: translateZ(380px); }

canvas.rain {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

/* === ОСНОВНОЙ КОНТЕЙНЕР === */
.main-content {
    width: 100%;
    max-width: 700px;
    z-index: 1;
}
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-radius: calc(var(--index) * 1.8);
    border: 1px solid var(--glass-border);
    padding: calc(var(--index) * 2);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

/* === ШАПКА === */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: calc(var(--index) * 2);
}
.header h1 {
    font-family: 'kamerik-3d', sans-serif;
    color: var(--accent);
    font-size: calc(var(--index) * 2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 0.6rem 1.8rem;
    border-radius: 30px;
    font-weight: bold;
    font-size: calc(var(--index) * 0.7);
    transition: 0.3s;
    text-decoration: none;
}
.back-btn:hover {
    background: var(--accent);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* === ЗОНА ЗАГРУЗКИ === */
.upload-area {
    border: 2px dashed var(--accent2);
    border-radius: 24px;
    text-align: center;
    padding: calc(var(--index) * 2.5) 1.5rem;
    cursor: pointer;
    transition: 0.2s;
    background: rgba(255,255,255,0.05);
    margin-bottom: calc(var(--index) * 1.5);
}
.upload-area i {
    font-size: calc(var(--index) * 2.5);
    color: var(--accent);
    margin-bottom: 0.8rem;
}
.upload-area p {
    color: #e2e8f0;
    font-size: calc(var(--index) * 0.75);
}
.browse-link {
    color: var(--accent);
    font-weight: bold;
    cursor: pointer;
    text-decoration: underline;
}
.drag-over {
    border-color: #facc15;
    background: rgba(255,255,255,0.1);
}
.file-info {
    margin-top: 1rem;
    color: #a5f3c3;
    font-weight: bold;
    font-size: calc(var(--index) * 0.7);
}

/* === ВЫБОР ФОРМАТОВ === */
.format-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: calc(var(--index) * 1.5);
    flex-wrap: wrap;
}
.format-group {
    flex: 1;
    min-width: 180px;
}
.format-group label {
    display: block;
    font-size: calc(var(--index) * 0.6);
    color: #cbd5e1;
    margin-bottom: 0.5rem;
}
.format-group input,
.format-group select {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 30px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: calc(var(--index) * 0.7);
    outline: none;
    font-family: inherit;
}
.format-group select option {
    background: #1e293b;
    color: white;
}

/* === КНОПКА КОНВЕРТАЦИИ === */
.convert-btn {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 60px;
    font-weight: bold;
    font-size: calc(var(--index) * 0.9);
    color: white;
    cursor: pointer;
    transition: 0.2s;
    font-family: 'kamerik-3d', sans-serif;
    letter-spacing: 0.05em;
}
.convert-btn:disabled {
    background: rgba(255,255,255,0.15);
    cursor: not-allowed;
    color: rgba(255,255,255,0.5);
}

/* === СТАТУС === */
.status-area {
    margin-top: 1.5rem;
    text-align: center;
    font-weight: bold;
    min-height: 2.5rem;
    font-size: calc(var(--index) * 0.7);
}
.success { color: #86efac; }
.error { color: #fca5a5; }
.info { color: #facc15; }

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 768px) {
    :root {
        --index: calc(0.9vw + 0.9vh);
    }
    body {
        padding: 0.4rem;
    }
    .glass-card {
        padding: calc(var(--index) * 1.8);
    }
    .header {
        flex-direction: column;
    }
    .back-btn {
        width: 100%;
        justify-content: center;
        font-size: clamp(12px, calc(var(--index) * 0.7), 18px);
    }
    .header h1 {
        font-size: clamp(16px, calc(var(--index) * 2.4), 32px);
    }
    .upload-area {
        padding: calc(var(--index) * 2) 1rem;
    }
    .upload-area i {
        font-size: calc(var(--index) * 2.5);
    }
    .upload-area p {
        font-size: clamp(12px, calc(var(--index) * 0.75), 18px);
    }
    .format-row {
        flex-direction: column;
        gap: 0.8rem;
    }
    .format-group {
        min-width: 100%;
    }
    .format-group label {
        font-size: clamp(12px, calc(var(--index) * 0.6), 14px);
    }
    .format-group input,
    .format-group select {
        font-size: clamp(12px, calc(var(--index) * 0.7), 18px);
    }
    .convert-btn {
        font-size: clamp(14px, calc(var(--index) * 0.9), 22px);
        padding: 0.8rem;
    }
    .status-area {
        font-size: clamp(12px, calc(var(--index) * 0.7), 18px);
    }
}
@media (max-width: 480px) {
    :root {
        --index: calc(1vw + 1.5vh);
    }
    .glass-card {
        padding: calc(var(--index) * 1.6);
    }
}