/* Современный дизайн файлового менеджера */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8f9fa;
    color: #2c3e50;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.header-left {
    flex-shrink: 0;
}

.header-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
}

.header-center {
    flex: 1;
    min-width: 200px;
}

.header-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}

.header-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.login-btn {
    background: white;
    color: #667eea;
}

.login-btn:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.admin-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.admin-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Search Box */
.search-box {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    background: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 1.2rem;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 12px;
    }
    
    .header-left {
        width: 100%;
    }
    
    .header-title {
        font-size: 1.4rem;
    }
    
    .header-center {
        width: 100%;
    }
    
    .header-right {
        width: 100%;
        justify-content: center;
    }
    
    .user-info {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Navigation */
.nav-panel {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 6px 12px;
    background: #007bff;
    border: none;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.8rem;
}

.nav-btn:hover {
    background: #0056b3;
}

/* File Browser */
.browser-container {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    min-height: 400px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.file-list {
    padding: 8px;
}

.file-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 4px 10px;
    margin-bottom: 1px;
    background: white;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    min-height: 32px;
}

.file-item > .file-content {
    display: flex;
    align-items: center;
    width: 100%;
}

.file-item:hover {
    background: #f8f9fa;
    border-color: #e9ecef;
}

.file-item.folder {
    background: #f8f9fa;
    border-left: 3px solid #007bff;
}

.file-item.folder:hover {
    background: #e3f2fd;
    border-color: #007bff;
}

.file-content {
    display: flex;
    align-items: center;
    width: 100%;
}

.file-indent {
    min-width: 16px;
    font-family: monospace;
    color: #adb5bd;
    font-size: 0.7rem;
}

.expand-btn {
    cursor: pointer;
    margin-right: 6px;
    font-size: 0.9rem;
    user-select: none;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
}

.expand-btn:hover {
    background: #e9ecef;
}

.file-spacer {
    width: 16px;
    margin-right: 6px;
}

.file-icon {
    display: flex;
    align-items: center;
    margin-right: 8px;
    min-width: 24px;
    justify-content: center;
}

.folder-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 3px;
    border: 1px solid #e9ecef;
    background: white;
    padding: 1px;
}

.file-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
    color: #2c3e50;
}

.file-item.folder .file-name {
    font-weight: 600;
    color: #007bff;
}

.file-size {
    color: #6c757d;
    font-size: 0.75rem;
    margin-left: 10px;
    min-width: 60px;
    text-align: right;
    font-family: monospace;
}

.file-date {
    color: #6c757d;
    font-size: 0.75rem;
    margin-left: 10px;
    min-width: 100px;
    text-align: right;
}

.file-path-info {
    font-size: 0.7rem;
    color: #999;
    margin-left: 40px;
    margin-top: 2px;
    font-family: monospace;
    word-break: break-all;
    max-width: 100%;
}

/* Status Bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 0.9rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.label {
    color: #495057;
    font-weight: 600;
}

/* Анимации для раскрытия папок */
.file-item[data-level="1"] {
    margin-left: 12px;
    border-left: 1px solid #e9ecef;
    padding-left: 12px;
    font-size: 0.9rem;
    min-height: 30px;
}

.file-item[data-level="2"] {
    margin-left: 24px;
    border-left: 1px solid #dee2e6;
    padding-left: 12px;
    font-size: 0.85rem;
    min-height: 28px;
}

.file-item[data-level="3"] {
    margin-left: 36px;
    border-left: 1px solid #ced4da;
    padding-left: 12px;
    font-size: 0.8rem;
    min-height: 26px;
}

.file-item[data-level="4"] {
    margin-left: 48px;
    border-left: 1px solid #adb5bd;
    padding-left: 12px;
    font-size: 0.75rem;
    min-height: 24px;
}

.file-item[data-level="5"] {
    margin-left: 60px;
    border-left: 1px solid #6c757d;
    padding-left: 12px;
    font-size: 0.7rem;
    min-height: 22px;
}

.file-item[data-level="6"] {
    margin-left: 72px;
    border-left: 1px solid #495057;
    padding-left: 12px;
    font-size: 0.65rem;
    min-height: 20px;
}

/* Убраны анимации для стабильности */

/* Стили для файлов */
.file-item.file {
    background: white;
    border-left: 3px solid #28a745;
}

.file-item.file:hover {
    background: #f8fff9;
    border-color: #28a745;
}

/* Иконки файлов */
.file-icon .file-icon-emoji {
    font-size: 1.5rem;
}

.clickable-icon {
    cursor: pointer;
    padding: 2px;
    border-radius: 3px;
}

.clickable-icon:hover {
    background: #e9ecef;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .search-panel {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-box {
        width: 100%;
    }
    
    .auth-section {
        align-self: flex-end;
    }
    
    .nav-panel {
        justify-content: center;
    }
    
    .nav-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 15px;
    }
    
    .file-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .file-size, .file-date {
        margin-left: 0;
        text-align: left;
    }
    
    .status-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .file-item[data-level] {
        margin-left: 10px !important;
        font-size: 1rem !important;
        min-height: 32px !important;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Модальное окно авторизации */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.login-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    min-width: 350px;
    max-width: 450px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.login-content h3 {
    margin-bottom: 25px;
    text-align: center;
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Error message styling */
.auth-error {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.auth-error .error-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.auth-error .error-text {
    flex: 1;
}

/* Form group styling */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #495057;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    background: #f8f9ff;
}

.form-group input::placeholder {
    color: #adb5bd;
}

/* Form actions */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.btn-login,
.btn-cancel {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-login {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

.btn-login:hover {
    background: linear-gradient(135deg, #0056b3 0%, #003d82 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-cancel {
    background: #e9ecef;
    color: #495057;
}

.btn-cancel:hover {
    background: #dee2e6;
    transform: translateY(-2px);
}

.btn-cancel:active {
    transform: translateY(0);
}

/* Дополнительные стили для красоты */
.file-list {
    background: #ffffff;
}

.browser-container {
    background: #ffffff;
}

/* Эффект при наведении на папки */
.file-item.folder:hover .file-name {
    color: #0056b3;
}

.file-item.folder:hover .expand-btn {
    background: #007bff;
    color: white;
}

/* Стили для пустого состояния */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state .file-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state .file-name {
    font-size: 1.2rem;
    font-weight: 500;
}