@import url("watch-sections.css");

/* ===== Файловый менеджер ===== */

.file-manager {
    padding: 20px;
    color: rgba(255, 255, 255, 0.85);
    display: grid;
    gap: 12px;
}

.file-header {
    margin-bottom: 0;
}

.file-header-inner {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}

.file-header h2 {
    margin: 0;
    font-size: 21px;
    font-weight: 300;
    color: #fff;
}

.breadcrumbs {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.6;
}

.breadcrumbs a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover { color: #fff; }

/* Админ-инструменты */
.admin-tools {
    margin-bottom: 0;
}

.admin-tools-head {
    margin-bottom: 12px;
}

.admin-tools-head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.82);
}

.tool-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.form-container {
    padding: 16px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 12px;
}

.form-container form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    margin-bottom: 6px;
    display: block;
}

.form-label-like {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    margin-bottom: 8px;
    display: block;
}

.form-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: end;
}

#file-list,
#folder-file-list {
    margin-top: 10px;
}

/* Список файлов */
.file-browser-panel {
    overflow: hidden;
}

.file-list-header {
    display: grid;
    grid-template-columns: 1fr 100px 150px 200px;
    gap: 15px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.file-item {
    display: grid;
    grid-template-columns: 1fr 100px 150px 200px;
    gap: 15px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    align-items: center;
    transition: background 0.15s;
}

.file-item:last-child { border-bottom: none; }
.file-item:hover { background: rgba(255, 255, 255, 0.04); }

.file-item.folder {
    border-left: 2px solid rgba(255, 255, 255, 0.2);
}

.file-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-icon {
    font-size: 16px;
    width: 22px;
    text-align: center;
}

.file-name a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    word-break: break-all;
    font-size: 14px;
}

.file-name a:hover { color: #fff; }

.file-size,
.file-modified {
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
}

.file-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.empty-folder {
    padding: 40px 20px 28px;
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 14px;
}

/* Модальное окно предпросмотра */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    overflow: hidden;
}

.modal-content {
    position: relative;
    background: #0a0a0a;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.15s ease;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 32px;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.08);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    line-height: 1;
}

.close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

#preview-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.preview-header {
    padding: 18px 80px 18px 24px;
    background: rgba(0, 0, 0, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.preview-header h3 {
    margin: 0;
    color: #fff;
    font-size: 15px;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-header .file-icon { font-size: 20px; flex-shrink: 0; }

.file-info {
    margin-top: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    gap: 12px;
}

.preview-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    overflow: hidden;
    background: #000;
}

.media-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.preview-video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    background: #000;
}

.preview-audio {
    width: 100%;
    max-width: 450px;
    padding: 30px;
    text-align: center;
}

.preview-audio h4 {
    margin: 0 0 20px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    font-weight: 400;
}

.preview-audio audio {
    width: 100%;
    height: 44px;
}

.audio-filename {
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 13px;
}

.unsupported-file {
    text-align: center;
    padding: 40px;
    max-width: 360px;
}

.unsupported-file h3 {
    margin: 0 0 16px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    font-weight: 400;
}

.unsupported-file p {
    margin: 8px 0;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}

.preview-actions {
    padding: 20px 24px;
    background: rgba(0, 0, 0, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-shrink: 0;
}

.preview-actions .btn {
    min-width: 140px;
    padding: 10px 20px;
    font-size: 13px;
    justify-content: center;
}

.watch-message-stack:empty {
    display: none;
}

/* Скрываем скроллбар модалки */
.modal-content::-webkit-scrollbar { display: none; }
.modal-content { -ms-overflow-style: none; scrollbar-width: none; }

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Адаптивность */
@media (max-width: 768px) {
    .file-manager { padding: 10px; }

    .file-header-inner {
        flex-direction: column;
        align-items: start;
    }

    .file-list-header,
    .file-item {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 12px;
    }

    .file-list-header > div:not(:first-child),
    .file-item > div:not(:first-child) {
        padding-left: 30px;
    }

    .tool-buttons { flex-direction: column; }

    .form-container form {
        flex-direction: column;
        align-items: stretch;
    }

    .close { right: 12px; top: 12px; width: 40px; height: 40px; font-size: 28px; }
    .preview-header { padding: 12px 60px 12px 16px; }
    .preview-body { padding: 16px; }
    .preview-actions { padding: 16px; flex-direction: column; gap: 10px; }
    .preview-actions .btn { min-width: auto; width: 100%; }
}

@media (max-width: 480px) {
    .preview-header h3 { font-size: 14px; }
    .preview-body { padding: 10px; }
    .file-info { flex-direction: column; gap: 4px; font-size: 12px; }
}
