/* Базовые стили */
body {
    font-family: 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    color: #333;
    background-color: #fafafa;
}

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

a {
    text-decoration: none;
    color: inherit;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #0095f6;
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: #0077cc;
}

.btn-secondary {
    background-color: #efefef;
    color: #333;
    border: none;
}

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

.btn-danger {
    background-color: #ed4956;
    color: white;
    border: none;
}

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

.alert {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
}

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

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

/* Шапка */
.main-header {
    background-color: white;
    border-bottom: 1px solid #dbdbdb;
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.logo img {
    height: 30px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.main-nav a {
    display: flex;
    align-items: center;
    gap: 5px;
}

.notification-icon {
    position: relative;
}

.notification-icon .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ed4956;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.avatar-small {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

/* Основной контент */
.main-content {
    padding: 20px 0;
}

.page-title {
    font-size: 24px;
    margin-bottom: 20px;
}

/* Посты */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.post-card {
    background-color: white;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    overflow: hidden;
}

.post-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px;
}

.post-media {
    width: 100%;
    max-height: 600px;
    object-fit: contain;
    background-color: black;
}

video.post-media {
    background-color: black;
}

.post-actions {
    padding: 10px;
    display: flex;
    gap: 15px;
}

.post-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0;
}

.post-actions .like-btn.liked i {
    color: #ed4956;
}

.post-caption {
    padding: 0 10px 10px;
    line-height: 1.4;
}

/* Страница профиля */
.profile-page {
    max-width: 800px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    gap: 30px;
    padding: 30px 0;
}

.profile-avatar img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-stats {
    display: flex;
    gap: 20px;
    margin: 15px 0;
}

.profile-stats div {
    text-align: center;
}

.profile-stats strong {
    display: block;
    font-size: 18px;
}

.profile-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.profile-posts {
    border-top: 1px solid #dbdbdb;
    padding-top: 20px;
}

.post-thumbnail {
    position: relative;
    display: block;
    aspect-ratio: 1;
    background-color: black;
}

.post-thumbnail img,
.post-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-thumbnail .video-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
}

.post-stats {
    position: absolute;
    bottom: 5px;
    left: 5px;
    color: white;
    display: flex;
    gap: 10px;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

/* Формы */
.auth-page {
    max-width: 400px;
    margin: 40px auto;
    padding: 20px;
    background-color: white;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    padding: 8px 12px;
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    font-size: 16px;
}

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

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

/* Адаптивность */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .profile-stats {
        justify-content: center;
    }
    
    .profile-actions {
        justify-content: center;
    }
}