/**
 * Современный дизайн для Zhashtar.kg
 * Единый стиль для всех страниц - мобильно-ориентированный
 * Стиль: Instagram/TikTok - минималистичный и привлекательный
 */

:root {
    /* Цветовая палитра - кыргызская тема */
    --primary-red: #DC143C;
    --primary-gold: #FFD700;
    --gradient-primary: linear-gradient(135deg, #DC143C 0%, #FF4500 50%, #FFD700 100%);
    --gradient-soft: linear-gradient(135deg, #FFE4E1 0%, #FFF8DC 100%);
    
    /* Нейтральные цвета */
    --bg-primary: #FFFFFF;
    --bg-secondary: #FAFAFA;
    --bg-tertiary: #F5F5F5;
    --text-primary: #262626;
    --text-secondary: #8E8E8E;
    --text-tertiary: #C7C7C7;
    --border-color: #DBDBDB;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    
    /* Размеры */
    --header-height: 60px;
    --nav-height: 60px;
    --max-width: 614px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    
    /* Анимации */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ========== БАЗОВЫЕ СТИЛИ ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: 60px; /* Место для нижней навигации */
}

/* ========== ЗАГОЛОВОК (HEADER) ========== */
.modern-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: var(--shadow-sm);
}

.modern-header .logo {
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.modern-header .header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modern-header .header-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast);
    position: relative;
    color: var(--text-primary);
    font-size: 20px;
}

.modern-header .header-btn:hover {
    background: var(--bg-tertiary);
}

.modern-header .header-btn .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--primary-red);
    color: white;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ========== НИЖНЯЯ НАВИГАЦИЯ ========== */
.modern-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.modern-bottom-nav .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
    position: relative;
    min-height: 50px;
}

.modern-bottom-nav .nav-item i {
    font-size: 24px;
    margin-bottom: 4px;
}

.modern-bottom-nav .nav-item span {
    font-size: 11px;
    font-weight: 500;
}

.modern-bottom-nav .nav-item.active {
    color: var(--text-primary);
}

.modern-bottom-nav .nav-item.active i {
    color: var(--primary-red);
}

.modern-bottom-nav .nav-item .badge {
    position: absolute;
    top: 6px;
    right: 20%;
    background: var(--primary-red);
    color: white;
    border-radius: 10px;
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* ========== КОНТЕЙНЕР КОНТЕНТА ========== */
.modern-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: calc(var(--header-height) + 16px) 0 16px;
    width: 100%;
}

/* ========== КАРТОЧКА ПОСТА ========== */
.modern-post-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.modern-post-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

.modern-post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.modern-post-avatar:hover {
    transform: scale(1.05);
}

.modern-post-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.modern-post-user-info {
    flex: 1;
    min-width: 0;
}

.modern-post-username {
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modern-post-username:hover {
    color: var(--primary-red);
}

.modern-post-time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.modern-post-more {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 20px;
    transition: background var(--transition-fast);
}

.modern-post-more:hover {
    background: var(--bg-tertiary);
}

.modern-post-media {
    width: 100%;
    max-height: 600px;
    object-fit: cover;
    display: block;
    background: var(--bg-tertiary);
}

.modern-post-actions {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 16px;
}

.modern-post-action {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 24px;
    transition: transform var(--transition-fast), color var(--transition-fast);
    position: relative;
}

.modern-post-action:hover {
    transform: scale(1.1);
}

.modern-post-action.liked {
    color: var(--primary-red);
}

.modern-post-action.saved {
    color: var(--primary-gold);
}

.modern-post-action i {
    transition: transform var(--transition-fast);
}

.modern-post-action:active i {
    transform: scale(0.9);
}

.modern-post-stats {
    padding: 0 16px 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.modern-post-caption {
    padding: 0 16px 12px;
    font-size: 14px;
    line-height: 1.5;
}

.modern-post-caption .username {
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    margin-right: 4px;
}

.modern-post-caption .text {
    color: var(--text-primary);
}

.modern-post-caption .more-btn {
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    font-size: 14px;
}

.modern-post-comments-link {
    padding: 0 16px 12px;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
}

.modern-post-comments-link:hover {
    color: var(--text-primary);
}

/* ========== КНОПКИ ========== */
.modern-btn {
    padding: 10px 24px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.modern-btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.modern-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.modern-btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.modern-btn-secondary:hover {
    background: var(--bg-tertiary);
}

.modern-btn-outline {
    background: transparent;
    color: var(--primary-red);
    border: 1px solid var(--primary-red);
}

.modern-btn-outline:hover {
    background: var(--primary-red);
    color: white;
}

/* ========== ФОРМЫ ========== */
.modern-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
}

.modern-input:focus {
    outline: none;
    border-color: var(--primary-red);
}

.modern-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    transition: border-color var(--transition-fast);
}

.modern-textarea:focus {
    outline: none;
    border-color: var(--primary-red);
}

/* ========== МОДАЛЬНЫЕ ОКНА ========== */
.modern-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
}

.modern-modal.active {
    opacity: 1;
    visibility: visible;
}

.modern-modal-content {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    max-width: 400px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform var(--transition-base);
}

.modern-modal.active .modern-modal-content {
    transform: scale(1);
}

.modern-modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modern-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modern-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 20px;
    transition: background var(--transition-fast);
}

.modern-modal-close:hover {
    background: var(--bg-tertiary);
}

.modern-modal-body {
    padding: 16px;
}

/* ========== ИСТОРИИ (STORIES) ========== */
.modern-stories {
    display: flex;
    gap: 12px;
    padding: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 24px;
}

.modern-stories::-webkit-scrollbar {
    display: none;
}

.modern-story-item {
    flex-shrink: 0;
    width: 80px;
    text-align: center;
    cursor: pointer;
}

.modern-story-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-red);
    padding: 3px;
    background: var(--bg-primary);
    margin-bottom: 8px;
}

.modern-story-username {
    font-size: 12px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========== ПРОФИЛЬ ========== */
.modern-profile-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 16px;
    margin-bottom: 24px;
}

.modern-profile-info {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.modern-profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
}

.modern-profile-stats {
    flex: 1;
    display: flex;
    gap: 20px;
    text-align: center;
}

.modern-profile-stat {
    flex: 1;
}

.modern-profile-stat-number {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

.modern-profile-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.modern-profile-bio {
    margin-top: 16px;
}

.modern-profile-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.modern-profile-bio-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

.modern-profile-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.modern-profile-actions .modern-btn {
    flex: 1;
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (min-width: 768px) {
    .modern-container {
        padding: calc(var(--header-height) + 24px) 24px 24px;
    }
    
    .modern-bottom-nav {
        display: none;
    }
    
    body {
        padding-bottom: 0;
    }
}

@media (max-width: 767px) {
    .modern-header {
        padding: 0 12px;
    }
    
    .modern-container {
        padding: calc(var(--header-height) + 12px) 0 12px;
    }
    
    .modern-post-card {
        border-left: none;
        border-right: none;
        border-radius: 0;
        margin-bottom: 0;
    }
    
    .modern-stories {
        padding: 12px;
    }
}

/* ========== АНИМАЦИИ ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modern-fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.modern-pulse {
    animation: pulse 0.6s ease;
}

/* ========== УТИЛИТЫ ========== */
.modern-text-center {
    text-align: center;
}

.modern-mt-1 { margin-top: 8px; }
.modern-mt-2 { margin-top: 16px; }
.modern-mt-3 { margin-top: 24px; }
.modern-mb-1 { margin-bottom: 8px; }
.modern-mb-2 { margin-bottom: 16px; }
.modern-mb-3 { margin-bottom: 24px; }

.modern-hidden {
    display: none !important;
}

.modern-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.modern-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

