* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Canvas для анимированного фона */
#bgCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 1; /* Полная видимость */
    transition: none; /* Без переходов */
}

/* Основные стили body */
body {
    margin: 0;
    padding: 1.5rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: transparent; /* Прозрачный фон, чтобы canvas был виден */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.glass-card {
    background: rgba(255, 255, 255, 0.85); /* Немного увеличили непрозрачность */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 42px;
    box-shadow: 
        0 20px 40px -10px rgba(0, 20, 30, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 0.8),
        0 10px 20px -8px rgba(0, 0, 0, 0.05);
    padding: 2.5rem 2.2rem;
    width: 100%;
    max-width: 680px;
    border: 1px solid rgba(255,255,255,0.5);
}

h1 {
    font-size: 2.4rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #1f2b3c, #2c3e50);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

h1 i {
    background: #ffffffcc;
    padding: 12px;
    border-radius: 32px;
    font-size: 1.6rem;
    color: #2c3e50;
    box-shadow: 0 6px 14px rgba(0,20,30,0.08);
}

.subhead {
    color: #4f5a6b;
    font-size: 1rem;
    font-weight: 400;
    margin-left: 8px;
    margin-bottom: 2rem;
    border-left: 3px solid #9aa9bb;
    padding-left: 1rem;
}

.subhead i {
    color: #657786;
    margin-right: 6px;
}

/* Поле ввода */
.url-input-area {
    background: rgba(255,255,255,0.6);
    border-radius: 60px;
    padding: 0.5rem 0.5rem 0.5rem 1.8rem;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02), inset 0 1px 4px #ffffff;
    border: 1px solid rgba(255,255,255,0.9);
    margin-bottom: 1.8rem;
    transition: box-shadow 0.2s;
}

.url-input-area:focus-within {
    box-shadow: 0 8px 22px rgba(80, 140, 200, 0.15), inset 0 1px 4px white;
    border-color: #b0c8e0;
}

.url-input-area i {
    color: #7b8ba0;
    font-size: 1.2rem;
}

#urlInput {
    border: none;
    background: transparent;
    padding: 1rem 1rem;
    font-size: 1.1rem;
    width: 100%;
    outline: none;
    color: #1d2a3a;
    font-weight: 450;
}

#urlInput::placeholder {
    color: #9aabbe;
    font-weight: 300;
    letter-spacing: -0.01em;
}

/* Форматы */
.format-row {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    background: rgba(255,255,255,0.3);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    backdrop-filter: blur(4px);
}

.format-label {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 0.5rem 1.2rem;
    border-radius: 40px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid #ffffff;
}

.format-label.selected {
    background: #e2eaf8;
    border-color: #c1d4ec;
    box-shadow: 0 4px 12px rgba(65, 105, 155, 0.12);
}

.format-label:hover {
    background: #f0f5fe;
    transform: translateY(-1px);
}

.hidden-radio {
    display: none;
}

/* Селектор качества */
.quality-selector {
    background: rgba(255,255,255,0.5);
    border-radius: 30px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255,255,255,0.7);
    backdrop-filter: blur(4px);
    transition: opacity 0.3s, transform 0.3s;
}

.quality-title {
    color: #2f4057;
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quality-options {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.quality-option {
    background: white;
    padding: 0.4rem 1rem;
    border-radius: 30px;
    cursor: pointer;
    border: 1px solid #d5e2f0;
    transition: all 0.15s;
    font-size: 0.9rem;
}

.quality-option.selected {
    background: #d4e3fc;
    border-color: #90b0db;
    font-weight: 500;
}

.quality-option:hover {
    background: #e9f0fa;
    transform: translateY(-1px);
}

/* Кнопка */
.download-btn {
    background: #1d2b3c;
    border: none;
    padding: 1rem 2.2rem;
    border-radius: 50px;
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 15px 25px -8px rgba(20, 50, 70, 0.3);
    transition: all 0.2s cubic-bezier(0.2,0.9,0.3,1.1);
    border: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 1.8rem;
    letter-spacing: 0.3px;
}

.download-btn:not(:disabled):hover {
    background: #243649;
    transform: scale(1.01);
    box-shadow: 0 22px 30px -10px #1d2f40;
    gap: 18px;
}

.download-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: 0 8px 12px -6px #bacde0;
}

/* Статус панель */
.status-panel {
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(8px);
    border-radius: 32px;
    padding: 1.4rem 1.8rem;
    border: 1px solid rgba(255,255,255,0.8);
    color: #1d2a3a;
    font-size: 0.95rem;
    box-shadow: inset 0 1px 5px white;
}

.status-header {
    display: flex;
    gap: 12px;
    align-items: center;
}

#statusIcon {
    color: #4f6f9f;
    transition: color 0.2s;
}

/* Прогресс-бар */
.progress-bar-bg {
    background: #d9e2ef;
    height: 10px;
    border-radius: 30px;
    margin: 14px 0 10px;
    overflow: hidden;
    width: 100%;
    display: none; /* Скрыт по умолчанию */
}

.progress-fill {
    height: 10px;
    width: 0%;
    background: linear-gradient(90deg, #4f91d2, #2b5f9e);
    border-radius: 30px;
    transition: width 0.2s ease;
    box-shadow: 0 0 10px #9dc3f0;
}

/* Сообщение о процессе - скрыто по умолчанию */
.processing-note {
    color: #596f88;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

.status-processing {
    color: #d98c2e;
}

.status-success {
    color: #2a8a5e;
}

.status-error {
    color: #c05a4b;
}

/* Размер файла в таблице */
.file-size {
    font-family: monospace;
    font-size: 0.8rem;
    color: #5f738e;
}

/* Дополнительная информация о времени */
.expiry-timer {
    font-size: 0.75rem;
    color: #5f738e;
    display: flex;
    align-items: center;
    gap: 4px;
}

.expiry-timer i {
    font-size: 0.65rem;
    color: #8f9fb2;
}

/* Результат */
.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.file-link {
    background: #ffffffdd;
    border-radius: 40px;
    padding: 0.5rem 1.4rem;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #1d2b3c;
    text-decoration: none;
    font-weight: 500;
    border: 1px solid #cddef5;
    transition: 0.1s;
    backdrop-filter: blur(4px);
}

.file-link:hover {
    background: white;
    border-color: #9bb9de;
    box-shadow: 0 6px 12px #cddef580;
}

.error-message {
    background: #ffebe6;
    border-radius: 60px;
    padding: 0.8rem 1.5rem;
    color: #b3402a;
    border: 1px solid #ffc5b3;
    margin-top: 1rem;
    font-weight: 450;
    display: flex;
    align-items: center;
    gap: 10px;
}

footer {
    margin-top: 28px;
    opacity: 0.7;
    font-size: 0.85rem;
    text-align: center;
    color: #5e738e;
}


/* Стили для раздела "Мои загрузки" */
.user-downloads-section {
    margin-top: 2rem;
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 1.5rem;
}

.section-title {
    font-size: 1.2rem;
    color: #1d2a3a;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.section-title i {
    color: #4f6f9f;
}

/* Контейнер таблицы с фиксированной шириной */
.downloads-table-container {
    background: rgba(255,255,255,0.4);
    border-radius: 24px;
    padding: 0.5rem;
    backdrop-filter: blur(4px);
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #b0c4de #e9f0f5;
    width: 100%;
}

.downloads-table-container::-webkit-scrollbar {
    width: 8px;
}

.downloads-table-container::-webkit-scrollbar-track {
    background: #e9f0f5;
    border-radius: 10px;
}

.downloads-table-container::-webkit-scrollbar-thumb {
    background: #b0c4de;
    border-radius: 10px;
}

/* Таблица с фиксированной шириной */
.downloads-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: fixed;
}

/* Распределение ширины колонок с вертикальными разделителями */
.downloads-table th:nth-child(1) { width: 12%; }  /* ID */
.downloads-table th:nth-child(2) { width: 38%; }  /* Название */
.downloads-table th:nth-child(3) { width: 12%; }  /* Формат */
.downloads-table th:nth-child(4) { width: 12%; }  /* Размер */
.downloads-table th:nth-child(5) { width: 18%; }  /* Осталось */
.downloads-table th:nth-child(6) { width: 8%; }   /* Действие (кнопка) */

.downloads-table th {
    text-align: left;
    padding: 0.8rem 0.5rem;
    color: #4a5a72;
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(79, 111, 159, 0.2);
    white-space: nowrap;
    position: relative;
}

/* Вертикальные разделители между заголовками */
.downloads-table th:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(79, 111, 159, 0.3) 20%, 
        rgba(79, 111, 159, 0.3) 80%, 
        transparent 100%
    );
}

.downloads-table td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    color: #2a3b4f;
    word-wrap: break-word;
    position: relative;
}

/* Вертикальные разделители для ячеек */
.downloads-table td:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 15%;
    height: 70%;
    width: 1px;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(150, 170, 200, 0.15) 30%, 
        rgba(150, 170, 200, 0.15) 70%, 
        transparent 100%
    );
}

/* ID ячейка */
.download-id {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.7rem;
    color: #6b7f9a;
    background: rgba(255,255,255,0.5);
    padding: 0.2rem 0.4rem;
    border-radius: 12px;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Название видео - компактное */
.video-title {
    color: #1d2b3c;
    font-weight: 450;
    display: block;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 0.85rem;
}

/* Формат - компактный бейдж */
.format-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    max-width: 100%;
    white-space: nowrap;
}

.format-mp4 {
    background: #d4e3fc;
    color: #2b4a7a;
    border: 1px solid #a0b9da;
}

.format-mp3 {
    background: #e0d9fc;
    color: #4f3b7a;
    border: 1px solid #b7a6e0;
}

.format-photo {
    background: #fce4d6;
    color: #8b5a3c;
    border: 1px solid #e6b8a2;
}

/* Размер файла */
.file-size {
    font-family: monospace;
    font-size: 0.75rem;
    color: #5f738e;
}

/* Таймер */
.expiry-timer {
    font-size: 0.75rem;
    color: #5f738e;
    display: flex;
    align-items: center; /* Выравнивание по центру */
    justify-content: flex-start;
    gap: 6px;
    white-space: nowrap;
    font-family: 'Courier New', monospace;
    line-height: 1; /* Убираем лишний межстрочный интервал */
}

.expiry-timer i {
    font-size: 0.7rem; /* Чуть больше, чтобы соответствовало тексту */
    color: #8f9fb2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%; /* Занимает всю высоту родителя */
    margin-top: 0; /* Сбрасываем возможные отступы */
    line-height: 1; /* Убираем лишний межстрочный интервал */
}

/* Кнопка скачивания - компактная */
.download-table-btn {
    background: #ffffffdd;
    border-radius: 30px;
    padding: 0.2rem 0.6rem;
    color: #1d2b3c;
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    border: 1px solid #cbd9ec;
    transition: all 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    backdrop-filter: blur(4px);
    white-space: nowrap;
}

.download-table-btn i {
    font-size: 0.65rem;
}

.download-table-btn:hover {
    background: white;
    border-color: #4f7ab3;
    color: #1d3d6b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(79, 111, 159, 0.15);
}

/* Пустой список */
.empty-downloads {
    text-align: center;
    padding: 2rem;
    color: #7a8aa0;
    font-style: italic;
    background: rgba(255,255,255,0.3);
    border-radius: 20px;
}

/* Адаптация для мобильных */
@media (max-width: 600px) {
    .downloads-table th:nth-child(1) { width: 15%; }
    .downloads-table th:nth-child(2) { width: 30%; }
    .downloads-table th:nth-child(3) { width: 12%; }
    .downloads-table th:nth-child(4) { width: 15%; }
    .downloads-table th:nth-child(5) { width: 28%; }
    
    .download-table-btn {
        padding: 0.15rem 0.4rem;
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .downloads-table th:nth-child(1) { width: 20%; }
    .downloads-table th:nth-child(2) { width: 40%; }
    .downloads-table th:nth-child(3) { width: 40%; }
    
    .downloads-table th:nth-child(4),
    .downloads-table td:nth-child(4) {
        display: none;
    }
}

/* Уведомления */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Плавающая кнопка звука */
.sound-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.sound-float:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
    border-color: rgba(255, 255, 255, 0.6);
}

.sound-float:active {
    transform: scale(0.95);
}

#soundIcon {
    font-size: 28px;
    color: white;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.sound-float:hover #soundIcon {
    transform: scale(1.1);
}

/* Анимация пульсации для привлечения внимания (можно убрать если не нужно) */
@keyframes soundPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

.sound-float {
    animation: soundPulse 2s infinite;
}

/* Отключаем пульсацию при наведении */
.sound-float:hover {
    animation: none;
}

/* Добавьте в style.css */

.preview-table-btn {
    background: #ffffffdd;
    border-radius: 30px;
    padding: 0.2rem 0.6rem;
    color: #1d2b3c;
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    border: 1px solid #cbd9ec;
    transition: all 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    backdrop-filter: blur(4px);
    white-space: nowrap;
    cursor: pointer;
}

.preview-table-btn i {
    font-size: 0.65rem;
}

.preview-table-btn:hover {
    background: white;
    border-color: #667eea;
    color: #4f6f9f;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(79, 111, 159, 0.15);
}

.preview-table-btn:active {
    transform: translateY(0);
}

/* Стили для валидации URL */
.url-input-area {
    position: relative;
}

.url-hint {
    position: absolute;
    bottom: -30px;
    left: 20px;
    font-size: 0.8rem;
    display: none;
    animation: slideDown 0.3s ease;
    white-space: nowrap;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 15px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    backdrop-filter: blur(4px);
    z-index: 10;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Анимация пульсации для валидной ссылки */
@keyframes validPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

.url-input-area.valid-pulse {
    animation: validPulse 1s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}