/* ============================================================================
   PASTLETTER COMMUNITY — МОРСКОЙ СТИЛЬ
   Палитра: песок, бирюза, закат, пена
   ============================================================================ */

:root {
    /* Основные цвета */
    --sand-light: #fdf6e3;
    --sand-medium: #f4e4bc;
    --sand-dark: #d4b896;
    --sand-deep: #a68a6c;
    
    --sea-light: #c8e6e6;
    --sea-medium: #7ec8c8;
    --sea-dark: #2c5f7c;
    --sea-deep: #1a3d5c;
    
    --foam: #ffffff;
    --driftwood: #8b7355;
    
    /* Акценты */
    --sunset-orange: #ff8c42;
    --sunset-pink: #ffb4a2;
    --coral: #ff6b6b;
    --pearl: #f8f9fa;
    --shell: #ffe8d6;
    
    /* Текст */
    --text-dark: #2c3e50;
    --text-medium: #5a6c7d;
    --text-light: #8b98a5;
    
    /* Тени */
    --shadow-soft: 0 4px 20px rgba(44, 95, 124, 0.08);
    --shadow-medium: 0 8px 30px rgba(44, 95, 124, 0.12);
    --shadow-strong: 0 12px 40px rgba(44, 95, 124, 0.18);
}

/* Шрифты */

body.community-page {
    font-family: 'Lora', Georgia, serif;
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-dark);
    background: linear-gradient(180deg, var(--sand-light) 0%, var(--foam) 100%);
    min-height: 100vh;
}

.community-page h1, 
.community-page h2, 
.community-page h3, 
.community-page h4 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--sea-deep);
    font-weight: 700;
}

.community-page .display-1,
.community-page .display-2,
.community-page .display-3,
.community-page .hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
}

/* ============================================================================
   НАВИГАЦИЯ
   ============================================================================ */
.community-navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--sand-medium);
    box-shadow: var(--shadow-soft);
}

.community-navbar .navbar-brand {
    font-family: 'Pacifico', cursive;
    color: var(--sea-dark) !important;
    font-size: 1.6rem;
}

.community-navbar .nav-link {
    color: var(--text-dark) !important;
    font-weight: 500;
    transition: color 0.3s ease;
}

.community-navbar .nav-link:hover {
    color: var(--sea-dark) !important;
}

/* ============================================================================
   HERO-СЕКЦИЯ
   ============================================================================ */
.community-hero {
    background: linear-gradient(135deg, var(--sea-dark) 0%, var(--sea-deep) 100%);
    color: var(--foam);
    padding: 100px 0 140px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.community-hero::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120'%3E%3Cpath d='M0,60 Q300,120 600,60 T1200,60 L1200,120 L0,120 Z' fill='%23fdf6e3'/%3E%3C/svg%3E") no-repeat bottom;
    background-size: cover;
}

.community-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 140, 66, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.community-hero .hero-content {
    position: relative;
    z-index: 2;
}

.community-hero h1 {
    color: var(--foam);
    font-size: 4rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.community-hero .lead {
    font-size: 1.4rem;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.community-hero .bottle-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-15px) rotate(5deg); }
}

/* ============================================================================
   КНОПКИ
   ============================================================================ */
.btn-community {
    background: linear-gradient(135deg, var(--sunset-orange) 0%, var(--coral) 100%);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    transition: all 0.3s ease;
}

.btn-community:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    color: white;
}

.btn-community-outline {
    background: transparent;
    color: var(--sea-dark);
    border: 2px solid var(--sea-dark);
    padding: 10px 30px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-community-outline:hover {
    background: var(--sea-dark);
    color: white;
}

/* ============================================================================
   КАРТОЧКИ ПИСЕМ
   ============================================================================ */
.letter-card {
    background: var(--foam);
    border: 1px solid var(--sand-medium);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.letter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--sea-medium) 0%, var(--sunset-orange) 100%);
}

.letter-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.letter-card .letter-author {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed var(--sand-medium);
}

.letter-card .author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sea-light) 0%, var(--sea-medium) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--sea-deep);
    font-size: 1.2rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.letter-card .author-info h5 {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.letter-card .author-info small {
    color: var(--text-light);
    font-size: 0.85rem;
}

.letter-card .letter-text {
    font-family: 'Lora', Georgia, serif;
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    min-height: 120px;
}

.letter-card .letter-text.blurred {
    filter: blur(5px);
    user-select: none;
    transition: filter 0.3s ease;
}

.letter-card .letter-text.blurred:hover {
    filter: blur(3px);
}

.letter-card .letter-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--sand-medium);
    font-size: 0.9rem;
    color: var(--text-light);
}

.letter-card .letter-stats {
    display: flex;
    gap: 1rem;
}

.letter-card .letter-stats span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.letter-card .btn-like {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
}

.letter-card .btn-like:hover {
    color: var(--coral);
    background: rgba(255, 107, 107, 0.1);
}

.letter-card .btn-like.liked {
    color: var(--coral);
}

.letter-card .btn-like.liked i {
    animation: heartBeat 0.6s ease;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* ============================================================================
   КАРУСЕЛЬ
   ============================================================================ */
.community-carousel {
    background: linear-gradient(135deg, var(--sand-light) 0%, var(--shell) 100%);
    padding: 5rem 0;
    position: relative;
}

.community-carousel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--sea-medium) 0%, var(--sunset-orange) 50%, var(--sea-medium) 100%);
}

.carousel-container {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 1rem 0 2rem;
    scrollbar-width: thin;
    scrollbar-color: var(--sea-medium) var(--sand-light);
}

.carousel-container::-webkit-scrollbar {
    height: 8px;
}

.carousel-container::-webkit-scrollbar-track {
    background: var(--sand-light);
    border-radius: 10px;
}

.carousel-container::-webkit-scrollbar-thumb {
    background: var(--sea-medium);
    border-radius: 10px;
}

.carousel-container .letter-card {
    min-width: 320px;
    max-width: 320px;
    flex-shrink: 0;
}

/* ============================================================================
   БЛОК "КАК ЭТО РАБОТАЕТ"
   ============================================================================ */
.how-it-works {
    padding: 5rem 0;
    background: var(--foam);
}

.step-card {
    text-align: center;
    padding: 2rem 1.5rem;
}

.step-number {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--sea-dark) 0%, var(--sea-deep) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Pacifico', cursive;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
    box-shadow: 0 8px 20px rgba(44, 95, 124, 0.25);
}

/* ============================================================================
   ЛЕНТА ПИСЕМ
   ============================================================================ */
.feed-container {
    padding: 3rem 0;
}

.feed-filters {
    background: var(--foam);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--sand-medium);
}

.feed-filters .form-select,
.feed-filters .form-control {
    border-radius: 10px;
    border: 1px solid var(--sand-dark);
}

.feed-filters .form-select:focus,
.feed-filters .form-control:focus {
    border-color: var(--sea-medium);
    box-shadow: 0 0 0 0.2rem rgba(126, 200, 200, 0.25);
}

/* ============================================================================
   СТРАНИЦА ПРОСМОТРА ПИСЬМА
   ============================================================================ */
.letter-view {
    background: var(--foam);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--shadow-medium);
    margin: 3rem 0;
    position: relative;
    border: 1px solid var(--sand-medium);
}

.letter-view::before {
    content: '"';
    position: absolute;
    top: -30px;
    left: 30px;
    font-family: 'Pacifico', cursive;
    font-size: 8rem;
    color: var(--sand-medium);
    line-height: 1;
}

.letter-view .letter-content {
    font-family: 'Lora', Georgia, serif;
    font-size: 1.3rem;
    line-height: 1.8;
    color: var(--text-dark);
    margin: 2rem 0;
    white-space: pre-wrap;
}

.letter-view .letter-footer {
    border-top: 2px dashed var(--sand-medium);
    padding-top: 1.5rem;
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ============================================================================
   ПАГИНАЦИЯ
   ============================================================================ */
.community-pagination .page-link {
    border: none;
    color: var(--sea-dark);
    margin: 0 3px;
    border-radius: 10px !important;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.community-pagination .page-link:hover {
    background: var(--sea-light);
    color: var(--sea-deep);
}

.community-pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--sea-dark) 0%, var(--sea-deep) 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(44, 95, 124, 0.3);
}

/* ============================================================================
   ФУТЕР
   ============================================================================ */
.community-footer {
    background: var(--sea-deep);
    color: rgba(255, 255, 255, 0.8);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.community-footer a {
    color: var(--sand-medium);
    text-decoration: none;
}

.community-footer a:hover {
    color: var(--foam);
}

/* ============================================================================
   АДАПТИВНОСТЬ
   ============================================================================ */
@media (max-width: 768px) {
    .community-hero {
        padding: 60px 0 100px;
    }
    
    .community-hero h1 {
        font-size: 2.5rem;
    }
    
    .community-hero .lead {
        font-size: 1.1rem;
    }
    
    .letter-card {
        padding: 1.5rem;
    }
    
    .letter-view {
        padding: 2rem 1.5rem;
    }
    
    .letter-view .letter-content {
        font-size: 1.2rem;
    }
    
    .carousel-container .letter-card {
        min-width: 280px;
        max-width: 280px;
    }
}

/* ============================================================================
   АНИМАЦИИ
   ============================================================================ */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.wave-divider {
    height: 60px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120'%3E%3Cpath d='M0,60 Q300,120 600,60 T1200,60 L1200,120 L0,120 Z' fill='%23fdf6e3'/%3E%3C/svg%3E") no-repeat center;
    background-size: cover;
}