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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.app-container {
    display: flex;
    min-height: 100vh;
    background: rgba(255, 255, 255, 0.95);
}

/* Боковое меню */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #2c3e50 0%, #3498db 100%);
    color: white;
    transition: all 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
}

.sidebar-header {
    padding: 30px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.sidebar-nav ul {
    list-style: none;
    padding: 20px 0;
}

.nav-item {
    margin: 5px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: #f39c12;
}

.nav-icon {
    font-size: 20px;
    margin-right: 12px;
}

.nav-text {
    font-size: 16px;
    font-weight: 500;
}

/* Основной контент */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.content-header {
    background: white;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    margin-right: 15px;
    color: #333;
}

.content-header h1 {
    font-size: 28px;
    color: #333;
}

.content-body {
    flex: 1;
    padding: 30px;
    background: #f8f9fa;
    overflow-y: auto;
}

/* Страницы */
.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

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

/* Галерея */
.gallery-header {
    text-align: center;
    margin-bottom: 30px;
}

.gallery-header h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 10px;
}

.gallery-description {
    color: #666;
    font-size: 14px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.photo-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

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

.photo-card-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: #f0f0f0;
}

.photo-card-info {
    padding: 15px;
}

.photo-card-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-card-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
}

.loading-spinner {
    text-align: center;
    padding: 50px;
    color: #666;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
}

.btn-pagination {
    padding: 10px 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-pagination:hover:not(:disabled) {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.btn-pagination:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    color: #666;
    font-size: 14px;
}

/* Загрузка фото */
.upload-section {
    max-width: 600px;
    margin: 0 auto;
}

.upload-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.upload-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area.drag-over {
    border-color: #3498db;
    background: #e3f2fd;
}

.upload-preview {
    text-align: center;
    margin-bottom: 20px;
}

.preview-placeholder {
    padding: 40px;
    color: #999;
}

.upload-icon-large {
    font-size: 64px;
    display: block;
    margin-bottom: 15px;
}

#previewImage {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.btn-upload {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-upload:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.upload-info {
    margin-top: 20px;
}

.upload-progress {
    width: 100%;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.upload-message {
    text-align: center;
    font-size: 14px;
    color: #666;
}

.upload-message.success {
    color: #27ae60;
}

.upload-message.error {
    color: #e74c3c;
}

/* О галерее */
.about-section {
    max-width: 800px;
    margin: 0 auto;
}

.about-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.about-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.about-card h3 {
    margin-bottom: 15px;
    color: #3498db;
}

.tech-list {
    list-style: none;
    padding: 0;
}

.tech-list li {
    padding: 8px 0;
    color: #666;
    border-bottom: 1px solid #f0f0f0;
}

.stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.stat-item {
    flex: 1;
}

.stat-value {
    display: block;
    font-size: 32px;
    font-weight: bold;
    color: #3498db;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    margin: auto;
    padding: 20px;
    width: 90%;
    max-width: 1200px;
    top: 50%;
    transform: translateY(-50%);
}

.modal-large {
    max-width: 90%;
}

.modal-close {
    position: absolute;
    right: 25px;
    top: 10px;
    font-size: 40px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    z-index: 1001;
}

.modal-close:hover {
    color: #999;
}

.modal-body {
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

#modalImage {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    background: black;
}

.modal-info {
    padding: 20px;
}

.modal-info h3 {
    margin-bottom: 10px;
    color: #333;
}

.modal-info p {
    color: #666;
    margin: 5px 0;
}

/* Адаптивный дизайн */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100%;
        z-index: 20;
        transition: left 0.3s ease;
    }

    .sidebar.active {
        left: 0;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .content-body {
        padding: 20px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }

    .stats {
        flex-direction: column;
        gap: 20px;
    }

    .modal-content {
        width: 95%;
    }
}

/* Стили для скроллбара */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
