* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Стили для боковой навигации */
.sidebar {
    width: 220px;
    background: white;
    border-right: 1px solid #eee;
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
}

.logo {
    font-size: 28px;
    padding: 0 20px 20px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 20px;
    color: #333;
}

.nav-menu {
    list-style: none;
    flex: 1;
}

.nav-link {
    display: block;
    padding: 12px 20px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: #f8f8f8;
    color: #000;
}

.nav-link.active {
    background: #f0f0f0;
    color: #000;
    border-left-color: #000;
    font-weight: 600;
}

.nav-footer {
    padding: 20px;
    font-size: 12px;
    color: #999;
    border-top: 1px solid #f0f0f0;
}

/* Основной контент */
.content {
    flex: 1;
    margin-left: 220px;
    min-height: 100vh;
    padding: 32px;
}

/* Стили для index.php (загрузка) */
.box {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
    text-align: center;
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: url('https://cdn-icons-png.flaticon.com/512/126/126477.png') no-repeat center;
    background-size: contain;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.upload-icon:hover {
    opacity: 1;
}

h1 {
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #111;
}

.small {
    color: #666;
    font-size: 13px;
    margin-bottom: 28px;
}

/* Стили для кастомного file input */
.file-wrapper {
    margin-bottom: 16px;
    position: relative;
}

#fileInput {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 18px;
    border: 2px dashed #ddd;
    border-radius: 12px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s;
}

.file-label:hover {
    border-color: #999;
    background: #f5f5f5;
}

.file-text {
    color: #333;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.file-text::before {
    content: "📁 ";
    font-size: 16px;
    margin-right: 4px;
}

#fileInput:valid + .file-label {
    border-color: #4CAF50;
    background: #f0f9f0;
}

#fileInput:valid + .file-label .file-text::after {
    content: " ✓";
    color: #4CAF50;
    font-weight: bold;
}

input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #eee;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 20px;
    outline: none;
    transition: border 0.2s;
}

input[type="text"]:focus {
    border-color: #999;
}

input[type="text"]::placeholder {
    color: #aaa;
}

button {
    width: 100%;
    background: #111;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover {
    background: #000;
}

button:active {
    transform: scale(0.98);
}

/* ===== СТИЛИ ДЛЯ MYFILES.PHP ===== */
.files-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.files-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 0 4px;
}

.files-header h2 {
    font-size: 20px;
    font-weight: 500;
    color: #111;
}

.file-count {
    font-size: 13px;
    color: #888;
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 20px;
}

/* Сетка карточек */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

/* Обертка карточки */
.file-card-wrapper {
    position: relative;
}

/* Ссылка на файл */
.file-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Карточка файла */
.file-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #f0f0f0;
    transition: all 0.2s;
}

.file-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.04);
    border-color: #ddd;
}

/* Кнопки действий (появляются при наведении) */
.card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s;
}

.file-card-wrapper:hover .card-actions {
    opacity: 1;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: white;
    border: 1px solid #eee;
    color: #d32f2f;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.action-btn:hover {
    background: #ffebee;
    border-color: #d32f2f;
}

/* Иконка файла */
.file-icon {
    width: 40px;
    height: 40px;
    background: #f8f8f8;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 20px;
    color: #555;
}

/* Название файла */
.file-name {
    font-size: 14px;
    font-weight: 500;
    color: #111;
    margin-bottom: 8px;
    line-height: 1.4;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Мета-информация (тип и размер) */
.file-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.file-type {
    font-size: 11px;
    color: #888;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.file-size {
    font-size: 11px;
    color: #999;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: static;
        border-right: none;
        border-bottom: 1px solid #eee;
        padding: 16px;
    }
    
    .logo {
        padding: 0 0 16px;
        margin-bottom: 16px;
    }
    
    .nav-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .nav-link {
        padding: 8px 16px;
        border-left: none;
        border-radius: 20px;
        background: #f5f5f5;
    }
    
    .nav-link.active {
        background: #000;
        color: white;
        border-left: none;
    }
    
    .content {
        margin-left: 0;
        padding: 20px;
    }
    
    .nav-footer {
        display: none;
    }
    
    .files-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }
    
    .file-card {
        padding: 12px;
    }
    
    .file-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .files-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .files-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
.result-box {
    margin-top: 20px;
    padding: 16px;
    background: #f8f8f8;
    border-radius: 10px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.result-label {
    color: #4CAF50;
    font-weight: 500;
}

.result-link {
    color: #0066cc;
    text-decoration: none;
    word-break: break-all;
    flex: 1;
}

.result-link:hover {
    text-decoration: underline;
}

.copy-small {
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
}
/* ===== STYLES FOR SEARCH.PHP ===== */
.search-container {
    max-width: 700px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.search-title {
    font-size: 24px;
    font-weight: 500;
    color: #111;
    margin-bottom: 28px;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.search-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #eee;
    border-radius: 10px;
    font-size: 14px;
    transition: border 0.2s;
}

.search-input:focus {
    border-color: #999;
    outline: none;
}

.filter-group, .date-group, .size-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.file-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    background: #f8f8f8;
    padding: 16px;
    border-radius: 12px;
}

.type-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #444;
}

.type-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.type-label {
    user-select: none;
}

.date-options {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    background: #f8f8f8;
    padding: 16px;
    border-radius: 12px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #444;
}

.radio-label input[type="radio"] {
    cursor: pointer;
}

.size-select {
    padding: 10px 12px;
    border: 1px solid #eee;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background: white;
    cursor: pointer;
    max-width: 200px;
}

.size-select:focus {
    border-color: #999;
    outline: none;
}

.search-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.search-btn {
    flex: 2;
    background: #111;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.search-btn:hover {
    background: #000;
}

.reset-btn {
    flex: 1;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    padding: 14px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
    transition: background 0.2s;
}

.reset-btn:hover {
    background: #e8e8e8;
}

/* Адаптивность */
@media (max-width: 768px) {
    .search-container {
        padding: 20px;
    }
    
    .file-types-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .date-options {
        flex-direction: column;
        gap: 8px;
    }
    
    .search-actions {
        flex-direction: column;
    }
}
/* ===== EDITABLE CARDS STYLES ===== */
.edit-form {
    display: contents;
}

.file-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #f0f0f0;
    transition: all 0.2s;
    position: relative;
}

.file-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.04);
    border-color: #ddd;
}

/* Поле ввода имени */
.edit-name-input {
    width: 100%;
    padding: 8px 10px;
    margin: 8px 0;
    border: 1px solid #eee;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #111;
    background: #fafafa;
    transition: all 0.2s;
}

.edit-name-input:focus {
    border-color: #999;
    background: white;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.02);
}

.edit-name-input:hover {
    border-color: #ccc;
    background: white;
}

/* Кнопки действий */
.card-actions {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    justify-content: flex-end;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #eee;
    background: white;
    color: #555;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.save-btn {
    color: #4CAF50;
}

.save-btn:hover {
    background: #e8f5e9;
    border-color: #4CAF50;
}

.delete-btn {
    color: #d32f2f;
}

.delete-btn:hover {
    background: #ffebee;
    border-color: #d32f2f;
}

/* Иконка файла */
.file-icon {
    width: 48px;
    height: 48px;
    background: #f8f8f8;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 24px;
    color: #555;
}

/* Мета информация */
.file-meta {
    display: flex;
    gap: 8px;
    margin: 8px 0;
}

.file-type {
    font-size: 11px;
    color: #888;
    background: #f5f5f5;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.file-size {
    font-size: 11px;
    color: #999;
    background: #f5f5f5;
    padding: 3px 8px;
    border-radius: 4px;
}

.no-results {
    text-align: center;
    padding: 48px;
    background: white;
    border-radius: 12px;
    color: #999;
    font-size: 14px;
}
/* Кнопки действий - делаем всегда видимыми */
.card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    opacity: 1 !important;  /* Принудительно видима */
    display: block !important;
}

/* Убираем hover-эффект */
.file-card-wrapper:hover .card-actions {
    opacity: 1 !important;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: white;
    border: 1px solid #eee;
    color: #d32f2f;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.action-btn:hover {
    background: #ffebee;
    border-color: #d32f2f;
}
/* Круглая кнопка с домиком */
.home-button {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    background: white;
    border: 1px solid #eee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #333;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 1000;
    transition: all 0.2s ease;
}

.home-button:hover {
    background: #f5f5f5;
    border-color: #ccc;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.home-button:active {
    transform: scale(0.95);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .home-button {
        width: 50px;
        height: 50px;
        font-size: 28px;
        top: 15px;
        left: 15px;
    }
}