/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 {
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #ecf0f1;
    color: #2c3e50;
    border: 2px solid transparent;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

/* Home page styles */
.home-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.home-container {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    max-width: 500px;
    width: 100%;
    animation: homeFadeInUp 0.8s ease-out;
}

@keyframes homeFadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.home-logo {
    font-size: 4rem;
    margin-bottom: 20px;
}

.home-title {
    color: #2c3e50;
    font-size: 2.2rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.home-description {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-bottom: 30px;
    line-height: 1.6;
}

.home-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.home-btn {
    justify-content: center;
    padding: 15px;
    font-size: 16px;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    text-decoration: none;
}

.home-btn:hover {
    background: linear-gradient(135deg, #8e44ad, #7d3c98);
}

/* Auth pages */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    max-width: 400px;
    width: 100%;
    animation: authSlideIn 0.6s ease-out;
}

@keyframes authSlideIn {
    from {
        opacity: 0;
        transform: translateY(-25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-logo {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 20px;
}

.auth-title {
    text-align: center;
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 30px;
    font-weight: 600;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group textarea {
    padding: 12px 15px;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.auth-btn {
    justify-content: center;
    padding: 15px;
    font-size: 16px;
    margin-top: 10px;
}

.auth-links {
    text-align: center;
    margin-top: 25px;
    color: #7f8c8d;
}

.auth-links a {
    color: #3498db;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* File browser */
.controls-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: center;
}

.breadcrumbs {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.breadcrumbs a {
    color: #3498db;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

/* Login prompt */
.login-prompt {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.login-prompt h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.login-prompt p {
    color: #7f8c8d;
    margin-bottom: 25px;
}

/* МОДАЛЬНЫЕ ОКНА - ИСПРАВЛЕННЫЕ СТИЛИ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);

}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.modal-input,
.modal-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 15px;
    resize: vertical;
}

.modal-textarea {
    min-height: 100px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.warning-text {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 12px;
    margin-bottom: 15px;
    line-height: 1.4;
}

/* File editor */
.editor-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.editor-header {
    background: #34495e;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.editor-tabs {
    display: flex;
    gap: 10px;
}

.tab {
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.tab.active {
    background: #3498db;
    color: white;
}

.tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.2);
}

.editor-content {
    padding: 0;
}

#textEditor {
    width: 100%;
    height: 500px;
    padding: 20px;
    border: none;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    background: #f8f9fa;
}

#textEditor:focus {
    background: white;
}

#binaryView {
    padding: 50px 20px;
    text-align: center;
    color: #7f8c8d;
    background: #f8f9fa;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-bar {
    background: #ecf0f1;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #7f8c8d;
    border-top: 1px solid #dde4e6;
}

.status-info {
    display: flex;
    gap: 20px;
}

.status-position {
    font-family: 'Courier New', monospace;
}

/* Messages */
.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: none;
}

.success {
    background: #d1edff;
    border: 1px solid #b3d9ff;
    color: #004085;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: none;
}

/* User info */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-email {
    color: #2c3e50;
    font-weight: 500;
}

/* File browser specific styles */
.file-list {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    overflow: hidden;
    margin-top: 20px;
}

.file-header {
    display: grid;
    grid-template-columns: minmax(250px, 2fr) 90px 120px 80px 200px;
    gap: 15px;
    padding: 12px 20px;
    background: #34495e;
    color: white;
    font-weight: 600;
    font-size: 14px;
    align-items: center;
}

.file-item {
    display: grid;
    grid-template-columns: minmax(250px, 2fr) 90px 120px 80px 200px;
    gap: 15px;
    padding: 10px 20px;
    border-bottom: 1px solid #ecf0f1;
    align-items: center;
    transition: background-color 0.2s ease;
    font-size: 14px;
    min-height: 50px;
}

.file-item:hover {
    background: #f8f9fa;
}

.file-item:last-child {
    border-bottom: none;
}

.file-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    overflow: hidden;
}

.file-name a {
    color: #2980b9;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-name a:hover {
    text-decoration: underline;
}

.file-name span {
    cursor: pointer;
    text-decoration: underline;
    color: #2980b9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-type, .file-size, .file-storage {
    color: #7f8c8d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

/* Кнопки действий файлов */
.file-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow: visible;
}

.btn-icon-only {
    min-width: 26px;
    width: 26px;
    height: 26px;
    padding: 0;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #95a5a6;
    color: white;
}

.btn-icon-only:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.download-btn { background: #27ae60; }
.edit-btn { background: #3498db; }
.view-btn { background: #9b59b6; }
.open-btn { background: #3498db; }
.rename-btn { background: #f39c12; }
.delete-btn { background: #e74c3c; }

.download-btn:hover { background: #219653; }
.edit-btn:hover { background: #2980b9; }
.view-btn:hover { background: #8e44ad; }
.open-btn:hover { background: #2980b9; }
.rename-btn:hover { background: #e67e22; }
.delete-btn:hover { background: #c0392b; }

/* Стили для корневых хранилищ */
.storage-root {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white;
}

.storage-root .file-name a {
    color: white !important;
    font-weight: 600;
}

.storage-root .file-type,
.storage-root .file-size,
.storage-root .file-storage {
    color: rgba(255, 255, 255, 0.9) !important;
}

.storage-link {
    font-weight: 600;
    font-size: 15px;
}

/* Search */
.search-wrapper {
    margin-left: auto;
}

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

.search-input {
    padding: 8px 15px 8px 35px;
    border: 2px solid #ecf0f1;
    border-radius: 20px;
    width: 250px;
    font-size: 13px;
    transition: all 0.3s ease;
    background: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237f8c8d' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cpath d='m21 21-4.3-4.3'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-input::placeholder {
    color: #95a5a6;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
        padding: 15px 20px;
    }

    .controls-row {
        justify-content: center;
    }

    .search-wrapper {
        margin-left: 0;
        width: 100%;
        order: -1;
    }

    .search-input {
        width: 100%;
    }

    .file-header {
        display: none;
    }

    .file-item {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 15px;
        border: 1px solid #ecf0f1;
        border-radius: 8px;
        margin-bottom: 10px;
        min-height: auto;
    }

    .file-item > div {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 3px 0;
    }

    .file-item > div::before {
        content: attr(data-label);
        font-weight: 600;
        color: #2c3e50;
        margin-right: 10px;
        min-width: 80px;
    }

    .file-actions {
        justify-content: center;
        margin-top: 10px;
        gap: 6px;
    }

    .file-name {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }

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

    .home-btn {
        width: 100%;
        justify-content: center;
    }
}
/* common.css - ДОБАВЬТЕ ЭТОТ КОД */

/* АБСОЛЮТНОЕ ЦЕНТРИРОВАНИЕ МОДАЛЬНЫХ ОКОН */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;

    /* АБСОЛЮТНОЕ ЦЕНТРИРОВАНИЕ */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* УБЕДИТЕСЬ ЧТО НЕТ КОНФЛИКТУЮЩИХ СТИЛЕЙ */
.modal {
    /* УДАЛИТЕ ЕСЛИ ЕСТЬ: */
    /* display: flex; */
    /* align-items: center; */
    /* justify-content: center; */
    /* padding: 20px; */
}