/* css/style.css */

/* Сброс стилей и базовые настройки */
* {
    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;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Шапка */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 300;
}

header p {
    opacity: 0.9;
    font-size: 1.1em;
}

/* Основной контент */
main {
    padding: 40px;
}

/* Форма загрузки */
.upload-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    border: 2px dashed #dee2e6;
    text-align: center;
    margin-bottom: 40px;
    transition: all 0.3s ease;
}

.upload-form:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.upload-form h2 {
    margin-bottom: 20px;
    color: #495057;
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
    margin: 20px 0;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-label {
    display: inline-block;
    padding: 15px 30px;
    background: #667eea;
    color: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.file-input-label:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.submit-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.submit-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

.file-info {
    margin-top: 15px;
    color: #6c757d;
    font-size: 0.9em;
}

/* Галерея */
.gallery-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #495057;
    font-weight: 300;
}

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

.image-card {
    position: relative;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

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

.image-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.image-info {
    padding: 15px;
}

.image-name {
    font-weight: 500;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: #6c757d;
}

.views-count {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Страница просмотра */
.image-view-container {
    text-align: center;
    padding: 40px;
}

.image-meta-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.image-meta-info h1 {
    font-size: 1.8em;
    margin-bottom: 15px;
    color: #495057;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.meta-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.meta-item .label {
    font-weight: 600;
    color: #667eea;
    font-size: 0.9em;
}

.image-display {
    max-width: 800px;
    margin: 0 auto 30px;
}

.image-display img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Уведомления и сообщения */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

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

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

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 10px;
    }
    
    main {
        padding: 20px;
    }
    
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .image-card img {
        height: 150px;
    }
    
    .actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    header h1 {
        font-size: 2em;
    }
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* Иконки */
.views-count::before {
    content: "👁️";
}

/* Специфические стили для страниц */
.upload-page .gallery-section {
    display: block;
}

.view-page .upload-form {
    display: none;
}

/* Кастомный скроллбар */
::-webkit-scrollbar {
    width: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}
/* Стили для авторизации */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-page .container {
    max-width: 400px;
}

.auth-form {
    padding: 40px;
}

.auth-form h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #495057;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

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

.auth-links {
    text-align: center;
    margin-top: 20px;
}

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

.auth-links a:hover {
    text-decoration: underline;
}

/* Стили для профиля */
.profile-info {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 30px;
    align-items: start;
    margin-bottom: 40px;
}

.user-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
}

.user-card h2 {
    margin-bottom: 15px;
    color: #495057;
}

.user-card p {
    margin: 8px 0;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #495057;
}

/* Кнопки действий для изображений */
.image-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

.btn-small.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-small.btn-danger:hover {
    background: #c82333;
}

/* Навигация в шапке */
.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: rgba(255,255,255,0.1);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

.user-menu a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 20px;
    transition: background 0.3s ease;
}

.user-menu a:hover {
    background: rgba(255,255,255,0.2);
}

/* Адаптивность для профиля */
@media (max-width: 768px) {
    .profile-info {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .profile-actions {
        flex-direction: row;
        justify-content: center;
    }
    
    .header-nav {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}