/* ══════════════════════════════════════════════════════════════════════════════
   SmartScreen / ChatBox2 — File Storage Drawer (Выдвижная шторка хранилища 5 ГБ)
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Плавающая кнопка вызова хранилища на главной странице (Liquid Glass, справа внизу) ── */
.floating-storage-btn {
    position: fixed;
    bottom: 92px;
    right: 28px;
    left: auto;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 100%);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.8);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 85;
    text-decoration: none;
}

.floating-storage-btn:hover {
    transform: translateY(-3px) scale(1.05);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.18) 100%);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 255, 255, 0.35);
}

.floating-storage-btn:active {
    transform: scale(0.95);
}

.floating-storage-btn .storage-btn-tooltip {
    position: absolute;
    right: calc(100% + 12px);
    left: auto;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #f8fafc;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateX(10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.floating-storage-btn:hover .storage-btn-tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* ── Зона детектора Drag-over в нижней трети экрана ── */
.drag-bottom-zone-indicator {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 33.33vh;
    border-top: 2px dashed rgba(255, 255, 255, 0.6);
    background: linear-gradient(to top, rgba(59, 130, 246, 0.25) 0%, rgba(59, 130, 246, 0.0) 100%);
    backdrop-filter: blur(4px);
    pointer-events: none;
    z-index: 105;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.drag-bottom-zone-indicator.active {
    opacity: 1;
}

.drag-zone-badge {
    background: rgba(255, 255, 255, 0.95);
    color: #1e293b;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.drag-bottom-zone-indicator.active .drag-zone-badge {
    transform: translateY(0);
}

/* ── Оверлей шторки (Backdrop) ── */
.storage-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 110;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.storage-drawer-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* ── Сама шторка хранилища (White Drawer) ── */
.storage-drawer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    height: 78vh;
    background: #ffffff;
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.28), 0 -2px 10px rgba(0, 0, 0, 0.08);
    z-index: 120;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), height 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-radius 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Nunito Sans', 'Segoe UI', Roboto, sans-serif;
    color: #1e293b;
}

/* Состояния шторки */
.storage-drawer.open {
    transform: translateY(0);
}

/* Состояние приоткрытия на 1/3 (Peek Mode при Drag & Drop в нижнюю треть) */
.storage-drawer.peek {
    transform: translateY(0);
    height: 36vh;
    box-shadow: 0 -12px 48px rgba(59, 130, 246, 0.35);
}

/* Состояние на весь экран (Fullscreen) */
.storage-drawer.fullscreen {
    transform: translateY(0);
    height: 100vh;
    max-width: 100%;
    border-radius: 0;
}

/* Верхняя полоска перетаскивания (Drag Handle) */
.storage-drawer-handle {
    width: 100%;
    padding: 10px 0 4px;
    display: flex;
    justify-content: center;
    cursor: grab;
    user-select: none;
    flex-shrink: 0;
}

.storage-drawer-handle-bar {
    width: 44px;
    height: 5px;
    background: #cbd5e1;
    border-radius: 4px;
    transition: background 0.2s;
}

.storage-drawer-handle:hover .storage-drawer-handle-bar {
    background: #94a3b8;
}

/* ── Шапка шторки (Header) ── */
.storage-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 24px 14px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
    gap: 16px;
    flex-wrap: wrap;
}

.storage-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.storage-icon-badge {
    width: 38px;
    height: 38px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.storage-header-title-block h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.storage-quota-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
    font-size: 12px;
    color: #64748b;
}

.storage-quota-bar-wrap {
    width: 110px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.storage-quota-bar-fill {
    height: 100%;
    width: 0%;
    background: #3b82f6;
    border-radius: 4px;
    transition: width 0.4s ease, background 0.3s ease;
}

.storage-quota-bar-fill.warning {
    background: #f59e0b;
}

.storage-quota-bar-fill.danger {
    background: #ef4444;
}

/* Правые контролы шапки (Поиск, Создать, Загрузить, Fullscreen, Закрыть) */
.storage-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.storage-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.storage-search-box svg {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    pointer-events: none;
}

.storage-search-input {
    padding: 8px 12px 8px 36px;
    font-size: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #1e293b;
    outline: none;
    width: 180px;
    transition: all 0.2s ease;
}

.storage-search-input:focus {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    width: 230px;
}

.storage-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

.storage-btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.storage-btn-primary:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.storage-btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.storage-btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.storage-btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.storage-btn-icon:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* ── Навигационная панель (Breadcrumbs) ── */
.storage-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    background: #fafbfc;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.storage-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

.storage-breadcrumbs::-webkit-scrollbar {
    display: none;
}

.storage-breadcrumb-item {
    cursor: pointer;
    color: #2563eb;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}

.storage-breadcrumb-item:hover {
    background: #eff6ff;
}

.storage-breadcrumb-item.active {
    color: #0f172a;
    font-weight: 600;
    cursor: default;
}

.storage-breadcrumb-sep {
    color: #cbd5e1;
}

/* ── Основная рабочая область хранилища (Body & Dropzone) ── */
.storage-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 30px;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Drag & drop зона подсветки внутри шторки */
.storage-dropzone-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    border: 2.5px dashed #3b82f6;
    background: rgba(239, 246, 255, 0.92);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.25s ease;
}

.storage-dropzone-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.storage-dropzone-icon {
    width: 64px;
    height: 64px;
    background: #dbeafe;
    color: #2563eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounceSlow 1.5s infinite;
}

@keyframes bounceSlow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.storage-dropzone-text {
    font-size: 16px;
    font-weight: 600;
    color: #1e40af;
}

.storage-dropzone-subtext {
    font-size: 12px;
    color: #60a5fa;
}

/* ── Сетка файлов и папок (Grid) ── */
.storage-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.storage-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px;
}

.storage-section-header .storage-section-title {
    margin: 0;
}

/* ── Панель сортировки файлов ── */
.storage-sort-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.storage-sort-label {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-right: 2px;
}

.storage-sort-btn-group {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 10px;
    gap: 2px;
    border: 1px solid #e2e8f0;
}

.storage-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.storage-sort-btn svg {
    color: inherit;
    flex-shrink: 0;
}

.storage-sort-btn:hover {
    color: #1e293b;
    background: rgba(255, 255, 255, 0.6);
}

.storage-sort-btn.active {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(37, 99, 235, 0.1);
}

.storage-sort-arrow {
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
    color: #2563eb;
}

.storage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

/* Карточка папки */
.storage-folder-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.storage-folder-card:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.storage-folder-card.drag-target {
    background: #dbeafe !important;
    border-color: #2563eb !important;
    transform: scale(1.04) translateY(-2px);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35), 0 8px 24px rgba(37, 99, 235, 0.25) !important;
    animation: folder-target-glow 1s infinite alternate ease-in-out;
}

@keyframes folder-target-glow {
    0% { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3); }
    100% { border-color: #1d4ed8; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.45), 0 10px 28px rgba(37, 99, 235, 0.3); }
}

.storage-folder-icon {
    color: #f59e0b;
    flex-shrink: 0;
}

.storage-folder-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* Карточка файла */
.storage-file-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.storage-file-card:hover {
    border-color: #93c5fd;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* ── Карточка в процессе загрузки (Uploading state) ── */
.storage-file-card.is-uploading {
    border-color: #93c5fd;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25), 0 8px 24px rgba(59, 130, 246, 0.15);
    animation: pulse-upload-card 2s infinite ease-in-out;
}

@keyframes pulse-upload-card {
    0%, 100% { transform: translateY(0); border-color: #93c5fd; }
    50% { transform: translateY(-2px); border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35), 0 10px 28px rgba(59, 130, 246, 0.22); }
}

.storage-card-upload-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 10;
    border-radius: 15px;
    padding: 10px;
    text-align: center;
}

.storage-card-upload-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.storage-card-upload-percent {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    font-variant-numeric: tabular-nums;
}

.storage-card-upload-status {
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ── Плавающая панель прогресса загрузки файлов (Liquid Glass Float Card) ── */
.storage-upload-progress-panel {
    position: fixed;
    bottom: 24px;
    right: 28px;
    width: 360px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 16px 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(59, 130, 246, 0.15);
    z-index: 2000;
    transform: translateY(140%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.storage-upload-progress-panel.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.storage-upload-progress-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.storage-upload-spinner-box {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(59, 130, 246, 0.1) 100%);
    border: 1px solid rgba(59, 130, 246, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #2563eb;
}

.storage-upload-spinner-box svg.spinning {
    animation: spin 1s linear infinite;
}

.storage-upload-info {
    flex: 1;
    overflow: hidden;
}

.storage-upload-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.storage-upload-subtitle {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

.storage-upload-percent-badge {
    font-size: 14px;
    font-weight: 800;
    color: #2563eb;
    font-variant-numeric: tabular-nums;
    padding: 3px 8px;
    background: rgba(37, 99, 235, 0.08);
    border-radius: 8px;
}

.storage-upload-progressbar-track {
    width: 100%;
    height: 7px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.storage-upload-progressbar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2563eb, #3b82f6, #60a5fa);
    background-size: 200% 100%;
    border-radius: 999px;
    transition: width 0.2s ease;
    animation: shimmer-progress 2s linear infinite;
}

@keyframes shimmer-progress {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.storage-upload-files-preview {
    margin-top: 10px;
    font-size: 11px;
    color: #64748b;
    max-height: 48px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.storage-upload-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 0;
}

.storage-upload-file-item span.name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
    font-weight: 500;
}

.storage-upload-file-item span.size {
    font-variant-numeric: tabular-nums;
    color: #94a3b8;
}

/* Превью область файла */
.storage-file-thumb {
    width: 100%;
    height: 96px;
    border-radius: 10px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    overflow: hidden;
    position: relative;
}

.storage-file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.storage-file-card:hover .storage-file-thumb img {
    transform: scale(1.06);
}

/* ── Бейджи и градиенты фона для всех категорий файлов ── */
.storage-file-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 5px;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.3px;
    z-index: 5;
}

.storage-file-thumb.type-image {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    border: 1px solid rgba(236, 72, 153, 0.15);
}
.storage-file-badge.badge-image { background: linear-gradient(135deg, #ec4899, #db2777); }

.storage-file-thumb.type-video {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border: 1px solid rgba(139, 92, 246, 0.15);
}
.storage-file-badge.badge-video { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

.storage-file-thumb.type-audio {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid rgba(245, 158, 11, 0.15);
}
.storage-file-badge.badge-audio { background: linear-gradient(135deg, #f59e0b, #d97706); }

.storage-file-thumb.type-pdf {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid rgba(239, 68, 68, 0.15);
}
.storage-file-badge.badge-pdf { background: linear-gradient(135deg, #ef4444, #dc2626); }

.storage-file-thumb.type-word {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid rgba(37, 99, 235, 0.15);
}
.storage-file-badge.badge-word { background: linear-gradient(135deg, #3b82f6, #2563eb); }

.storage-file-thumb.type-excel {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid rgba(22, 163, 74, 0.15);
}
.storage-file-badge.badge-excel { background: linear-gradient(135deg, #22c55e, #16a34a); }

.storage-file-thumb.type-powerpoint {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid rgba(234, 88, 12, 0.15);
}
.storage-file-badge.badge-powerpoint { background: linear-gradient(135deg, #f97316, #ea580c); }

.storage-file-thumb.type-archive {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border: 1px solid rgba(79, 70, 229, 0.15);
}
.storage-file-badge.badge-archive { background: linear-gradient(135deg, #6366f1, #4f46e5); }

.storage-file-thumb.type-code {
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
    border: 1px solid rgba(13, 148, 136, 0.15);
}
.storage-file-badge.badge-code { background: linear-gradient(135deg, #14b8a6, #0d9488); }

.storage-file-thumb.type-text {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid rgba(100, 116, 139, 0.15);
}
.storage-file-badge.badge-text { background: linear-gradient(135deg, #64748b, #475569); }

.storage-file-thumb.type-app {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border: 1px solid rgba(147, 51, 234, 0.15);
}
.storage-file-badge.badge-app { background: linear-gradient(135deg, #a855f7, #9333ea); }

.storage-file-thumb.type-other {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid rgba(148, 163, 184, 0.2);
}
.storage-file-badge.badge-other { background: linear-gradient(135deg, #94a3b8, #64748b); }

.storage-file-icon-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    transition: transform 0.25s ease;
}

.storage-file-card:hover .storage-file-icon-placeholder {
    transform: scale(1.08);
}

.storage-file-meta {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.storage-file-name {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.storage-file-size {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

/* Кнопка контекстного меню файла/папки */
.storage-card-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    gap: 4px;
    z-index: 10;
}

.storage-file-card:hover .storage-card-actions,
.storage-folder-card:hover .storage-card-actions {
    opacity: 1;
}

.storage-action-icon-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e2e8f0;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.storage-action-icon-btn:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

.storage-action-icon-btn.download-btn:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

/* Пустое состояние (Empty state) */
.storage-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #94a3b8;
}

.storage-empty-icon {
    width: 72px;
    height: 72px;
    background: #f8fafc;
    color: #cbd5e1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.storage-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.storage-empty-desc {
    font-size: 13px;
    color: #94a3b8;
    max-width: 320px;
}

/* ── Модальное окно предпросмотра (Preview Modal) ── */
.storage-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 150;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.storage-preview-modal.active {
    opacity: 1;
    visibility: visible;
}

.storage-preview-header {
    position: absolute;
    top: 20px;
    left: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    z-index: 160;
}

.storage-preview-title {
    font-size: 16px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.storage-preview-content {
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.storage-preview-content img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.storage-preview-content video {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    outline: none;
}

.storage-preview-content iframe {
    width: 80vw;
    height: 75vh;
    border: none;
    border-radius: 12px;
    background: #fff;
}

.storage-preview-text {
    width: 80vw;
    max-width: 800px;
    max-height: 70vh;
    overflow-y: auto;
    background: #1e293b;
    color: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    font-family: monospace;
    font-size: 13px;
    white-space: pre-wrap;
}

/* ── Универсальный оверлей для модальных окон хранилища (Liquid Glass) ── */
.storage-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(16px) saturate(1.5);
    -webkit-backdrop-filter: blur(16px) saturate(1.5);
    z-index: 1500;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.storage-modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .storage-drawer {
        height: 88vh;
        border-radius: 20px 20px 0 0;
    }
    
    .storage-drawer.peek {
        height: 45vh;
    }

    .storage-drawer-header {
        padding: 8px 16px 12px;
        gap: 10px;
    }

    .storage-search-input {
        width: 130px;
    }
    .storage-search-input:focus {
        width: 170px;
    }

    .storage-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }

    .floating-storage-btn {
        bottom: 20px;
        left: 16px;
        width: 44px;
        height: 44px;
    }
}
