/*
 * =========================================================
 * Название проекта: [«FRN OG-2.4.»]
 * Файл: styles.css
 * Автор: [FRN https://forum.ru.net/ ]
 * Дата создания: 24.04.2024
 * Последнее обновление: 05.05.2025
 * Версия: OG-2.4.0
 * 
 * Описание:
 * Основные стили для проекта [«FRN OG-2.4.»].
 * Содержит настройки оформления всех стилевых компонентов.
 * 
 * Copyright © 2025 [FRN]. Все права защищены.
 * =========================================================
 */

/* Основные стили */
:root {
    --primary-color: #4a76a8;
    --secondary-color: #6c757d;
    --accent-color: #28a745;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --danger-color: #dc3545;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
    --border-radius: 5px;
    --font-family: 'Roboto', Arial, sans-serif;
} * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f5f5f5;
}

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

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: darken(var(--primary-color), 10%);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color var(--transition-speed), transform var(--transition-speed);
    text-align: center;
    font-weight: 500;
}

.btn:hover {
    background-color: darken(var(--primary-color), 10%);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: var(--primary-color);
}

.btn-secondary {
    background-color: var(--secondary-color);
}

.btn-success {
    background-color: var(--success-color);
}

.btn-danger {
    background-color: var(--danger-color);
}

/* Оповещения */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
}

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

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

/* Шапка сайта */
.header {
    background-color: white;
    box-shadow: 0 2px 10px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo a {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.main-nav .menu {
    display: flex;
}

.main-nav .menu li {
    margin-left: 20px;
}

.main-nav .menu a {
    color: var(--dark-color);
    font-weight: 500;
    padding: 5px 0;
    position: relative;
}

.main-nav .menu a:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition-speed);
}

.main-nav .menu a:hover:after,
.main-nav .menu a.active:after {
    width: 100%;
}

.main-nav .menu a.active {
    color: var(--primary-color);
}

.burger-menu {
    display: none;
    cursor: pointer;
}

.burger-icon {
    width: 30px;
    height: 20px;
    position: relative;
}

.burger-icon span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background-color: var(--dark-color);
    border-radius: 3px;
    transition: all var(--transition-speed);
}

.burger-icon span:nth-child(1) {
    top: 0;
}

.burger-icon span:nth-child(2) {
    top: 8px;
}

.burger-icon span:nth-child(3) {
    top: 16px;
}

.burger-menu.active .burger-icon span:nth-child(1) {
    transform: rotate(45deg);
    top: 8px;
}

.burger-menu.active .burger-icon span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active .burger-icon span:nth-child(3) {
    transform: rotate(-45deg);
    top: 8px;
}

/* Баннер */
.banner {
    background: linear-gradient(135deg, var(--primary-color), #2c3e50);
    color: white;
    padding: 80px 0;
    text-align: center;
    margin-bottom: 40px;
}

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

.banner h1 {
    font-size: 48px;
    margin-bottom: 20px;
    font-weight: 700;
}

.banner-description {
    font-size: 18px;
    margin-bottom: 30px;
}

/* Анимации для заголовка и текста */
.animate-title {
    animation: fadeInUp 1s ease-out;
}

.animate-text {
    animation: fadeInUp 1s ease-out 0.3s both;
}

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

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

.section-title {
    font-size: 28px;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 10px;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
}

/* Форма комментариев */
.comment-form-section {
    background-color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px var(--shadow-color);
    margin-bottom: 40px;
}

.comment-form {
    display: grid;
    gap: 20px;
}

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

.form-group label {
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    transition: border-color var(--transition-speed);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.captcha-group {
    margin-top: 10px;
}

/* Список комментариев */
.comments-section {
    background-color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px var(--shadow-color);
}

.comments-list {
    display: grid;
    gap: 20px;
}

.comment-item {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    transition: transform var(--transition-speed);
    animation: fadeIn 0.5s ease-out;
}

.comment-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.comment-author {
    font-weight: 700;
    color: var(--primary-color);
}

.comment-date {
    color: var(--secondary-color);
    font-size: 14px;
}

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

.no-comments {
    text-align: center;
    padding: 30px;
    color: var(--secondary-color);
    font-style: italic;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Подвал сайта */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 40px 0;
    margin-top: 60px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.footer-logo {
    margin-bottom: 20px;
}

.footer-logo a {
    color: white;
    font-size: 24px;
    font-weight: 700;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    transition: background-color var(--transition-speed), transform var(--transition-speed);
}

.social-link:hover {
    background-color: var(--primary-color);
    transform: translateY(-5px);
}

.copyright {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* Кнопка прокрутки вверх */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed), visibility var(--transition-speed), background-color var(--transition-speed);
    box-shadow: 0 2px 10px var(--shadow-color);
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background-color: darken(var(--primary-color), 10%);
}

/* Адаптивность */
@media (max-width: 992px) {
    .banner h1 {
        font-size: 36px;
    }
    
    .banner-description {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: white;
        box-shadow: 0 5px 10px var(--shadow-color);
    }
    
    .main-nav.active {
        display: block;
    }
    
    .main-nav .menu {
        flex-direction: column;
        padding: 20px;
    }
    
    .main-nav .menu li {
        margin: 0;
        margin-bottom: 15px;
    }
    
    .burger-menu {
        display: block;
    }
    
    .banner {
        padding: 60px 0;
    }
    
    .banner h1 {
        font-size: 32px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .comment-header {
        flex-direction: column;
    }
    
    .comment-date {
        margin-top: 5px;
    }
}

@media (max-width: 576px) {
    .banner {
        padding: 40px 0;
    }
    
    .banner h1 {
        font-size: 28px;
    }
    
    .banner-description {
        font-size: 14px;
    }
    
    .comment-form-section,
    .comments-section {
        padding: 20px;
    }
    
    .scroll-to-top {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
    }
}

/* Стили для секции комментариев */
.comments-section {
    margin-top: 40px;
    padding: 20px 0;
}

.comments-section h2 {
    margin-bottom: 30px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

/* Контейнер для комментариев */
.comments-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

/* Стили для отдельного комментария (карточки) */
.comment {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

/* Заголовок комментария с информацией о пользователе */
.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

/* Блок с информацией о пользователе */
.user-info {
    display: flex;
    align-items: center;
    width: 100%;
}

/* Аватар пользователя */
.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #4a76a8;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

/* Информация о пользователе (имя и дата) */
.user-details {
    flex-grow: 1;
}

.user-details h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* Стиль для даты комментария */
.comment-date {
    font-size: 12px;
    color: #777;
    display: block;
    margin-top: 3px;
}

.comment-date i {
    margin-right: 5px;
}

/* Тело комментария */
.comment-body {
    flex-grow: 1;
    font-size: 14px;
    line-height: 1.6;
    color: #444;
    word-wrap: break-word;
}

.comment-body p {
    margin: 0;
}

/* Стили для сообщения об отсутствии комментариев */
.no-comments {
    text-align: center;
    padding: 40px 0;
    color: #777;
}

.no-comments i {
    font-size: 50px;
    margin-bottom: 15px;
    color: #ccc;
}

.no-comments p {
    font-size: 18px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .comments-container {
        grid-template-columns: 1fr;
    }
    
    .comment {
        margin-bottom: 15px;
    }
}

/* Случайные цвета для аватаров */
.avatar:nth-child(5n+1) {
    background-color: #4a76a8;
}

.avatar:nth-child(5n+2) {
    background-color: #5fb053;
}

.avatar:nth-child(5n+3) {
    background-color: #f57c00;
}

.avatar:nth-child(5n+4) {
    background-color: #7b1fa2;
}

.avatar:nth-child(5n+5) {
    background-color: #d32f2f;
}