* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: #2c3e50;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links a {
    margin-left: 1.5rem;
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.nav-links a:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: calc(100vh - 120px);
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.folder-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.folder-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.folder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.folder-card a {
    text-decoration: none;
    color: inherit;
}

.folder-card h3 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 1.3rem;
}

.folder-count {
    color: #666;
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: white;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.empty-state h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.folder-header {
    margin-bottom: 2rem;
    color: white;
}

.back-link {
    text-decoration: none;
    color: white;
    margin-bottom: 1rem;
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    transition: background 0.3s ease;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.3);
}

.photos-count {
    opacity: 0.9;
    font-size: 1.1rem;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.photo-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

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

.photo-link {
    display: block;
    position: relative;
    overflow: hidden;
}

.photo-link img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-link:hover .photo-overlay {
    opacity: 1;
}

.photo-link:hover img {
    transform: scale(1.1);
}

.view-text {
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
}

.photo-info {
    padding: 1rem;
    text-align: center;
}

.photo-name {
    font-size: 0.9rem;
    color: #666;
    word-break: break-all;
}

/* Стили для админ-панели с метаданными */
.photo-item {
    display: inline-block;
    margin: 10px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
    vertical-align: top;
    max-width: 250px;
    background: white;
}

.photo-thumb {
    max-width: 200px;
    max-height: 200px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.photo-author {
    color: #666;
    margin: 5px 0;
    font-size: 0.9em;
    font-weight: 500;
}

.photo-description {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
    min-height: 1rem;
    line-height: 1.4;
}

.photo-description.empty {
    min-height: 1rem;
    color: #999;
}

.photo-actions {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Админ-стили */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.login-form {
    background: rgba(255, 255, 255, 0.95);
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 450px;
    backdrop-filter: blur(10px);
}

.login-form h2 {
    text-align: center;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.login-description {
    text-align: center;
    margin-bottom: 2rem;
    color: #666;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.btn-warning {
    background: linear-gradient(45deg, #ffc107, #fd7e14);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.4);
}

.btn-danger {
    background: linear-gradient(45deg, #dc3545, #e83e8c);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #f5c6cb;
}

.login-note {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e5e9;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

.admin-header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.admin-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.admin-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.action-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.action-card h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    text-align: center;
}

.action-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.admin-section h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.folders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.folder-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.folder-item:hover {
    transform: translateX(5px);
}

.folder-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.folder-stats {
    color: #666;
    font-size: 0.9rem;
}

.folder-actions {
    display: flex;
    gap: 0.5rem;
}

.folder-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.folder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e1e5e9;
}

.photo-count {
    color: #666;
    font-size: 0.9rem;
}

.photos-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    min-height: 100px;
}

.loading-text {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
}

/* Стили для групповой загрузки */
.file-list-header {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 5px 0;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    font-size: 0.9rem;
}

.file-name {
    flex: 1;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    margin-right: 10px;
}

.file-size {
    color: #666;
    margin: 0 10px;
    font-size: 0.85em;
    white-space: nowrap;
}

.btn-remove-file {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.btn-remove-file:hover {
    background: #c82333;
}

.empty-file-list {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px dashed #dee2e6;
}

/* Прогресс-бар загрузки */
#upload-progress {
    margin: 1rem 0;
    display: none;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #28a745, #20c997);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    margin-top: 5px;
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

/* Сообщения о статусе */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid #c3e6cb;
}

.warning-message {
    background: #fff3cd;
    color: #856404;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid #ffeaa7;
}

/* Состояния загрузки */
.upload-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    background: #f8f9fa;
}

.status-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.status-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.footer {
    background: rgba(44, 62, 80, 0.9);
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 4rem;
    backdrop-filter: blur(10px);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer a {
    color: #667eea;
    text-decoration: none;
}

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

/* Адаптивность */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        display: flex;
        gap: 1rem;
    }
    
    .nav-links a {
        margin-left: 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .admin-actions {
        grid-template-columns: 1fr;
    }
    
    .folder-item {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .folder-actions {
        justify-content: center;
    }
    
    .folder-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .photo-item {
        margin: 5px;
        padding: 10px;
        max-width: calc(50% - 10px);
    }
    
    .photo-thumb {
        max-width: 100%;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .file-name {
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    .photo-item {
        max-width: 100%;
        margin: 5px 0;
    }
    
    .photos-grid {
        grid-template-columns: 1fr;
    }
    
    .action-card {
        padding: 1rem;
    }
    
    .login-form {
        padding: 2rem 1rem;
    }
}