* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ========== ЭКРАН АВТОРИЗАЦИИ ========== */
.auth-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    margin-bottom: 30px;
}

.logo i {
    font-size: 48px;
    color: #667eea;
}

.logo h1 {
    font-size: 32px;
    color: #333;
    font-weight: 600;
}

.auth-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

/* Вкладки */
.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: #f0f0f0;
    padding: 5px;
    border-radius: 50px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Формы */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s;
    background: #f8f9fa;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input:hover {
    border-color: #999;
}

/* Кнопка авторизации */
.auth-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Сообщение об ошибке */
.error-message {
    background: #fee;
    color: #e53e3e;
    padding: 14px;
    border-radius: 12px;
    margin-top: 20px;
    font-size: 14px;
    text-align: center;
    border-left: 4px solid #e53e3e;
    animation: shake 0.3s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* Информация под формой */
.auth-info {
    margin-top: 20px;
    text-align: center;
    color: #666;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 50px;
}

.auth-info i {
    color: #48bb78;
}

/* ========== ОСНОВНОЕ ПРИЛОЖЕНИЕ ========== */
.app {
    display: flex;
    height: 100vh;
    background: #fff;
}

/* Мобильное меню */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1001;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    align-items: center;
    justify-content: center;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Боковая панель */
.sidebar {
    width: 280px;
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    padding: 20px;
    transition: transform 0.3s ease;
}

.sidebar .logo {
    justify-content: flex-start;
    margin-bottom: 30px;
}

.sidebar .logo i {
    font-size: 32px;
}

.sidebar .logo span {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.user-info i {
    font-size: 40px;
    color: #667eea;
}

.user-name {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.user-email {
    font-size: 12px;
    color: #666;
    word-break: break-all;
}

.new-btn {
    background: #c2e7ff;
    border: none;
    border-radius: 16px;
    padding: 14px;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    color: #001d35;
    cursor: pointer;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    transition: all 0.3s;
}

.new-btn:hover {
    background: #b0d9f5;
}

.new-menu {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.new-menu.show {
    display: flex;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.new-menu button {
    padding: 14px;
    border: none;
    background: white;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    transition: background 0.3s;
}

.new-menu button:hover {
    background: #f1f3f4;
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: #3c4043;
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.3s;
}

.nav-menu a:hover {
    background: #f1f3f4;
}

.nav-menu a.active {
    background: #e8f0fe;
    color: #1967d2;
}

.storage-info {
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
    margin-top: auto;
}

.storage-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.storage-used {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s;
}

.storage-text {
    font-size: 13px;
    color: #5f6368;
}

.logout-btn {
    padding: 12px;
    background: #f56565;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: #e53e3e;
}

/* Основной контент */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
}

.toolbar {
    padding: 16px 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
}

.breadcrumb {
    font-size: 18px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
    cursor: pointer;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: #5f6368;
}

.toolbar-actions {
    display: flex;
    gap: 8px;
}

.toolbar-actions button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #5f6368;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.toolbar-actions button:hover {
    background: #f1f3f4;
}

/* Информационный badge */
.info-badge {
    background: #e8f0fe;
    color: #1a73e8;
    padding: 10px 20px;
    margin: 0 24px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 14px;
    flex-wrap: wrap;
}

/* Drag & Drop зона */
.drop-zone {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.1);
    border: 3px dashed #667eea;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 1000;
    pointer-events: none;
}

.drop-zone.show {
    display: flex;
}

.drop-zone i {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 16px;
}

.drop-zone p {
    font-size: 18px;
    color: #667eea;
    text-align: center;
    padding: 0 20px;
}

/* Таблица файлов */
.files-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px;
    -webkit-overflow-scrolling: touch;
}

.files-table {
    width: 100%;
    border-collapse: collapse;
}

.files-table th {
    text-align: left;
    padding: 12px 8px;
    font-size: 13px;
    color: #5f6368;
    border-bottom: 1px solid #e0e0e0;
}

.files-table td {
    padding: 12px 8px;
    font-size: 14px;
    border-bottom: 1px solid #f1f3f4;
}

.files-table tbody tr {
    cursor: pointer;
    transition: background 0.2s;
}

.files-table tbody tr:hover {
    background: #f1f3f4;
}

.files-table tbody tr:active {
    background: #e8f0fe;
}

.file-icon {
    font-size: 20px;
    margin-right: 12px;
    vertical-align: middle;
}

.file-actions {
    white-space: nowrap;
}

.file-actions button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #5f6368;
    cursor: pointer;
    font-size: 14px;
    margin: 0 2px;
    transition: all 0.3s;
}

.file-actions button:hover {
    background: #e0e0e0;
}

.file-actions button:active {
    background: #d0d0d0;
}

.loading {
    text-align: center;
    padding: 48px;
    color: #5f6368;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 24px;
    padding: 30px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 24px;
}

.modal-content input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.modal-content input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-actions button {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
}

.modal-actions button.cancel {
    background: #f0f0f0;
    color: #333;
}

.modal-actions button.cancel:hover {
    background: #e0e0e0;
}

.modal-actions button.create {
    background: #667eea;
    color: white;
}

.modal-actions button.create:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

/* Модальное окно подтверждения */
.verify-icon {
    font-size: 70px;
    color: #48bb78;
    margin-bottom: 20px;
    display: block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Проверка авторизации */
.auth-check {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 3000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========== МОБИЛЬНАЯ АДАПТАЦИЯ ========== */

/* Планшеты */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }

    .files-table th:nth-child(3),
    .files-table td:nth-child(3) {
        display: none;
    }
}

/* Мобильные устройства */
@media (max-width: 768px) {

    /* Страница авторизации */
    .auth-card {
        padding: 30px 20px;
    }

    .logo h1 {
        font-size: 28px;
    }

    .auth-subtitle {
        font-size: 14px;
    }

    .tab-btn {
        padding: 10px;
        font-size: 14px;
    }

    .form-group input {
        padding: 12px 14px;
        font-size: 14px;
    }

    .auth-btn {
        padding: 14px;
        font-size: 15px;
    }

    .auth-info {
        font-size: 12px;
        padding: 8px;
    }

    /* Мобильное меню */
    .mobile-menu-btn {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1000;
        transform: translateX(-100%);
        width: 280px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-menu-overlay.show {
        display: block;
    }

    /* Основной контент */
    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .toolbar {
        padding: 12px 16px;
        padding-left: 70px;
    }

    .breadcrumb {
        font-size: 16px;
    }

    .toolbar-actions button {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .info-badge {
        margin: 0 16px 16px;
        padding: 8px 16px;
        font-size: 12px;
        gap: 8px;
    }

    .files-container {
        padding: 0 12px;
    }

    .files-table th:nth-child(3),
    .files-table td:nth-child(3) {
        display: none;
    }

    .files-table th:nth-child(4),
    .files-table td:nth-child(4) {
        display: none;
    }

    .files-table th,
    .files-table td {
        padding: 10px 4px;
        font-size: 14px;
    }

    .file-icon {
        font-size: 18px;
        margin-right: 8px;
    }

    .file-actions button {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .drop-zone.show {
        background: rgba(102, 126, 234, 0.95);
    }

    .drop-zone i {
        font-size: 40px;
    }

    .drop-zone p {
        font-size: 16px;
    }

    .modal-content {
        padding: 20px;
        max-width: 90%;
    }

    .modal-content h3 {
        font-size: 20px;
    }

    .modal-actions button {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Маленькие телефоны */
@media (max-width: 480px) {

    /* Страница авторизации */
    .auth-card {
        padding: 25px 15px;
    }

    .logo i {
        font-size: 40px;
    }

    .logo h1 {
        font-size: 24px;
    }

    .auth-tabs {
        gap: 5px;
    }

    .tab-btn {
        padding: 8px;
        font-size: 13px;
    }

    .form-group label {
        font-size: 13px;
    }

    .form-group input {
        padding: 10px 12px;
        font-size: 13px;
    }

    .auth-btn {
        padding: 12px;
        font-size: 14px;
    }

    .auth-info {
        font-size: 11px;
        flex-wrap: wrap;
    }

    /* Основное приложение */
    .toolbar {
        padding: 10px 12px;
        padding-left: 60px;
    }

    .breadcrumb {
        font-size: 14px;
    }

    .breadcrumb a {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .toolbar-actions button {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .files-table th,
    .files-table td {
        padding: 8px 4px;
        font-size: 13px;
    }

    .file-icon {
        font-size: 16px;
        margin-right: 6px;
    }

    .file-actions button {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    .info-badge {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        font-size: 11px;
    }

    .modal-content {
        padding: 15px;
    }

    .modal-content h3 {
        font-size: 18px;
    }

    .modal-content input {
        padding: 10px;
        font-size: 14px;
    }
}

/* Альбомная ориентация на телефонах */
@media (max-width: 896px) and (orientation: landscape) {
    .auth-card {
        max-width: 600px;
        padding: 20px 30px;
    }

    .sidebar {
        width: 240px;
    }

    .user-info {
        padding: 10px;
    }

    .user-info i {
        font-size: 30px;
    }

    .files-table th:nth-child(4),
    .files-table td:nth-child(4) {
        display: table-cell;
    }
}

/* Темная тема для модальных окон */
@media (prefers-color-scheme: dark) {
    .modal-content {
        background: #2d2d2d;
        color: #fff;
    }

    .modal-content h3 {
        color: #fff;
    }

    .modal-content input {
        background: #3d3d3d;
        border-color: #4d4d4d;
        color: #fff;
    }

    .modal-actions button.cancel {
        background: #3d3d3d;
        color: #fff;
    }
}