/* Галерея */
.gallery-header {
    margin-bottom: 30px;
    text-align: center;
}

.back-btn {
    display: inline-block;
    margin-bottom: 15px;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-btn:hover {
    color: #5568d3;
    transform: translateX(-3px);
}

.gallery-header h1 {
    margin-bottom: 10px;
}

.gallery-stats {
    color: #666;
    font-size: 14px;
}

/* Пустая галерея */
.empty-gallery {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 15px;
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.empty-gallery h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 24px;
}

.empty-gallery p {
    color: #666;
    margin-bottom: 25px;
}

/* Структура папок */
.gallery-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.year-section,
.month-section,
.day-section {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.folder-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.folder-header:hover {
    background: #f5f5f5;
}

.year-folder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.year-folder:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a4190 100%);
}

.month-folder {
    background: #f0f4ff;
    border-left: 4px solid #667eea;
}

.day-folder {
    background: #fafafa;
    border-left: 4px solid #a8b5f0;
}

.folder-icon {
    font-size: 24px;
}

.folder-name {
    font-weight: 600;
    font-size: 16px;
    flex: 1;
}

.folder-count {
    color: #888;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.05);
    padding: 4px 10px;
    border-radius: 12px;
}

.year-folder .folder-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.folder-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.folder-header.collapsed .folder-arrow {
    transform: rotate(-90deg);
}

.folder-content {
    padding: 0 15px 15px;
    animation: slideDown 0.3s ease;
}

.folder-content.collapsed {
    display: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Сетка изображений */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.image-card {
    background: white;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.image-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.15);
    transform: translateY(-3px);
}

.image-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px;
    background: #f9f9f9;
}

.preview-item {
    position: relative;
}

.preview-label {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 2;
}

.preview-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preview-item img:hover {
    transform: scale(1.05);
}

.image-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border-top: 1px solid #e8e8e8;
}

.btn-download-small {
    display: inline-block;
    padding: 6px 15px;
    background: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-download-small:hover {
    background: #218838;
    transform: translateY(-2px);
}

.image-time {
    color: #888;
    font-size: 12px;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-content {
    background: white;
    border-radius: 15px;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 30px;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 40px;
    color: #333;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.lightbox-close:hover {
    background: #f0f0f0;
    color: #000;
    transform: rotate(90deg);
}

.lightbox-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.lightbox-item h4 {
    margin-bottom: 10px;
    color: #333;
    font-size: 16px;
}

.lightbox-item img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.lightbox-actions {
    text-align: center;
}

/* Адаптивность */
@media (max-width: 768px) {
    .images-grid {
        grid-template-columns: 1fr;
    }
    
    .image-preview {
        grid-template-columns: 1fr;
    }
    
    .lightbox-images {
        grid-template-columns: 1fr;
    }
    
    .folder-header {
        padding: 12px 15px;
    }
    
    .folder-name {
        font-size: 14px;
    }
    
    .folder-count {
        font-size: 11px;
        padding: 3px 8px;
    }
}

/* Хлебные крошки */
.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.breadcrumb-item:hover {
    color: #5568d3;
    text-decoration: underline;
}

.breadcrumb-separator {
    color: #ccc;
}

/* Карточки папок */
.gallery-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.folder-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 25px;
    background: white;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.folder-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.15);
    transform: translateX(5px);
}

.year-card {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 100%);
    border-left: 5px solid #667eea;
}

.month-card {
    background: linear-gradient(135deg, #fff5f0 0%, #ffeee8 100%);
    border-left: 5px solid #ff8c42;
}

.day-card {
    background: linear-gradient(135deg, #f0fff4 0%, #e8ffe8 100%);
    border-left: 5px solid #28a745;
}

.folder-icon {
    font-size: 28px;
}

.folder-name {
    font-weight: 600;
    font-size: 16px;
    flex: 1;
    color: #333;
}

.folder-count {
    color: #888;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.05);
    padding: 5px 12px;
    border-radius: 12px;
}

.folder-arrow {
    color: #667eea;
    font-size: 18px;
}

/* Лоадер */
.loading-spinner {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ошибка */
.error-message {
    text-align: center;
    padding: 40px;
    background: #fff3f3;
    border: 2px solid #ff4444;
    border-radius: 10px;
    color: #cc0000;
}

/* Адаптивность */
@media (max-width: 768px) {
    .folder-card {
        padding: 15px 18px;
    }
    
    .folder-name {
        font-size: 14px;
    }
    
    .folder-count {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .breadcrumb {
        font-size: 13px;
    }
}

/* Хлебные крошки */
.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
    font-size: 14px;
}

.breadcrumb-item {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-item:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    color: #ccc;
}

/* Карточки папок */
.gallery-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.folder-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 25px;
    background: white;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.folder-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.15);
    transform: translateX(5px);
}

.year-card {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 100%);
    border-left: 5px solid #667eea;
}

.month-card {
    background: linear-gradient(135deg, #fff5f0 0%, #ffeee8 100%);
    border-left: 5px solid #ff8c42;
}

.day-card {
    background: linear-gradient(135deg, #f0fff4 0%, #e8ffe8 100%);
    border-left: 5px solid #28a745;
}

.folder-icon { font-size: 28px; }
.folder-name { font-weight: 600; font-size: 16px; flex: 1; color: #333; }
.folder-count {
    color: #888;
    font-size: 13px;
    background: rgba(0,0,0,0.05);
    padding: 5px 12px;
    border-radius: 12px;
}
.folder-arrow { color: #667eea; font-size: 18px; }

/* Пустая галерея */
.empty-gallery {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 15px;
}
.empty-icon { font-size: 60px; margin-bottom: 15px; }
.empty-gallery h3 { color: #333; margin-bottom: 10px; }
.empty-gallery p { color: #666; margin-bottom: 20px; }

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.lightbox-content {
    background: white;
    border-radius: 15px;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 30px;
}
.lightbox-close {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 40px;
    background: none;
    border: none;
    cursor: pointer;
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-close:hover { background: #f0f0f0; }
.lightbox-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}
.lightbox-item h4 { margin-bottom: 10px; color: #333; }
.lightbox-item img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.lightbox-actions { text-align: center; }

/* Адаптивность */
@media (max-width: 768px) {
    .lightbox-images { grid-template-columns: 1fr; }
    .folder-card { padding: 15px 18px; }
    .folder-name { font-size: 14px; }
    .breadcrumb { font-size: 13px; }
}