/* Основные стили */
* {
    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-color: #f8f9fa;
}

/* Контейнер - ВСЕ по центру */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

/* Заголовки */
h1, h2, h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

h1 {
    font-size: 28px;
    font-weight: 600;
}

h2 {
    font-size: 22px;
    font-weight: 500;
}

/* Шапка админки */
.admin-header {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    text-align: center;
}

.admin-header h1 {
    margin-bottom: 10px;
    color: #3498db;
}

.user-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

/* Карточки проектов */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.project-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.project-card-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 20px;
}

.project-card-header h3 {
    color: white;
    margin: 0;
    font-size: 20px;
}

.project-id {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    margin-top: 8px;
}

.project-card-body {
    padding: 20px;
}

.project-card-body p {
    margin-bottom: 10px;
}

.badge {
    display: inline-block;
    background: #e8f4fc;
    color: #3498db;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 5px;
    margin-top: 5px;
}

.project-card-actions {
    padding: 15px 20px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
}

.btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.btn-primary {
    background-color: #2ecc71;
}

.btn-primary:hover {
    background-color: #27ae60;
}

.btn-secondary {
    background-color: #95a5a6;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-view {
    background-color: #3498db;
}

.btn-edit {
    background-color: #9b59b6;
}

.btn-public {
    background-color: #1abc9c;
}

/* Формы */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="password"],
.form-group textarea,
.form-group input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Карточки */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 25px;
    overflow: hidden;
}

.card-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.card-header h3 {
    margin: 0;
    font-size: 18px;
}

.card-body {
    padding: 25px;
}

/* Фотографии */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.photo-item {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    transition: transform 0.3s;
}

.photo-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.photo-thumb img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
}

.photo-info p {
    margin: 5px 0;
    font-size: 13px;
    color: #555;
}

.photo-actions {
    margin-top: 15px;
    display: flex;
    gap: 8px;
}

/* Публичная ссылка */
.copy-container {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.copy-container input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f9f9f9;
    font-family: monospace;
    font-size: 14px;
}

/* Публичная страница */
.public-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.public-header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    text-align: center;
}

.public-header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 16px;
}

.photo-public-item {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.photo-number {
    background: #3498db;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
}

.photo-public-preview {
    flex-shrink: 0;
}

.photo-public-preview img {
    width: 250px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.filename {
    text-align: center;
    margin-top: 10px;
    font-size: 12px;
    color: #666;
}

.photo-public-fields {
    flex: 1;
}

/* Алерты */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert.success {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.alert.error {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* Хедеры страниц */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.header h1 {
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .photo-public-item {
        flex-direction: column;
    }
    
    .photo-public-preview img {
        width: 100%;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .copy-container {
        flex-direction: column;
    }
}

/* Поля ввода для публичной страницы */
.auto-save {
    border: 2px solid #e0e0e0;
    transition: border-color 0.3s;
}

.auto-save:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Статус сохранения */
.save-status {
    display: none;
    background: #2ecc71;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    margin-top: 15px;
    text-align: center;
    animation: fadeIn 0.3s;
}

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

/* Проект информация */
.project-info-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 25px;
}

.project-info-card p {
    margin: 8px 0;
    color: #555;
}

/* Действия */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: center;
}
.no-thumb {
    width: 100%;
    height: 180px;
    background: #f0f0f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}
/* Стили для унифицированного дизайна */

/* Контейнер публичной ссылки */
.public-url-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Контейнер для копирования */
.copy-container {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.copy-container input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-family: monospace;
    font-size: 14px;
}

/* Иконки в кнопках */
.copy-icon {
    margin-right: 8px;
}

/* Элемент фото в режиме редактирования (как в публичном) */
.photo-edit-item {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.photo-preview {
    flex-shrink: 0;
}

.photo-preview img {
    width: 250px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.photo-fields {
    flex: 1;
}

/* Номер фото */
.photo-number {
    background: #3498db;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
}

/* Заголовок страницы */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.header-left {
    flex: 1;
}

.project-meta {
    margin-top: 10px;
}

.project-meta .badge {
    margin-right: 8px;
    margin-bottom: 5px;
}

/* Контейнер для кнопок действий внизу */
.action-buttons-container {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Форма настроек проекта */
.project-settings-form {
    max-width: 600px;
}

.checkbox-group {
    margin: 10px 0;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

/* Бейджи */
.badge {
    display: inline-block;
    padding: 4px 10px;
    background: #e8f4fc;
    color: #3498db;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Публичная страница */
.public-link-container {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Адаптивность */
@media (max-width: 768px) {
    .photo-edit-item {
        flex-direction: column;
    }
    
    .photo-preview img {
        width: 100%;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .copy-container {
        flex-direction: column;
    }
}

/* Нет миниатюры */
.no-thumb {
    width: 250px;
    height: 250px;
    background: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

/* Отступы */
.mb-3 {
    margin-bottom: 20px !important;
}
/* Подвал админки */
.admin-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
    color: #666;
    font-size: 13px;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.copyright {
    margin-top: 10px;
    font-size: 12px;
    color: #999;
}

.copyright a {
    color: #3498db;
    text-decoration: none;
}

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

/* Текущая дата */
.current-date {
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

/* Адаптивные стили для заголовка */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header-left h1 {
    margin-bottom: 5px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        align-self: flex-end;
    }
    
    .projects-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .projects-actions {
        width: 100%;
    }
    
    .projects-actions .btn {
        width: 100%;
    }
}
/* Стили для прогресс-бара сжатия */
.compress-progress {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 10000;
    min-width: 300px;
    max-width: 400px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.compress-progress h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.compress-progress-bar {
    width: 100%;
    height: 10px;
    background: #f0f0f0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.compress-progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #2ecc71, #27ae60);
    transition: width 0.3s;
}

.compress-progress-text {
    font-size: 12px;
    color: #666;
    text-align: center;
}

.compress-result {
    font-size: 12px;
    color: #333;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-line;
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

/* Стили для футера public_project.php */
.public-footer {
    margin-top: 50px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    border-radius: 15px 15px 0 0;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.public-footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #2ecc71, #9b59b6);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: bold;
    color: white;
}

.footer-logo-icon {
    font-size: 32px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.footer-info {
    text-align: center;
    flex: 1;
}

.footer-copyright {
    font-size: 14px;
    color: #bdc3c7;
    margin: 0;
    padding: 10px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-tagline {
    font-size: 12px;
    color: #95a5a6;
    margin-top: 5px;
    font-style: italic;
}

.footer-stats {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #ecf0f1;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.1);
    padding: 5px 10px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

.footer-actions {
    display: flex;
    gap: 10px;
}

.footer-btn {
    padding: 8px 15px;
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

.footer-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* Декоративные элементы футера */
.footer-decoration {
    position: absolute;
    opacity: 0.1;
}

.footer-decoration.camera {
    right: 20px;
    bottom: 20px;
    font-size: 60px;
    transform: rotate(15deg);
}

.footer-decoration.heart {
    left: 20px;
    bottom: 30px;
    font-size: 40px;
    color: #e74c3c;
}

/* Адаптивность */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .footer-stats {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .footer-actions {
        justify-content: center;
    }
    
    .public-footer {
        padding: 25px 15px;
    }
}