/* ==================== ПРОФИЛЬ (полные стили) ==================== */

/* ---------- Контейнеры ---------- */
.profileContainer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.post-time {
    color: #8b8fa3;
    font-size: 0.85em;
    margin-left: 8px;
    white-space: nowrap;
}

.profileCard {
    display: flex;
    gap: 24px;
    background-color: white;
    border-radius: 20px 20px 0 0;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
}

.profileCardInfo {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

/* ---------- Аватар ---------- */
.profileAvatar {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background-color: #eef1f8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profileAvatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profileAvatar .accountAvatarPlaceholder {
    font-size: 2rem;
    font-weight: 600;
    color: #4a4f63;
}

/* ---------- Имя и статус ---------- */
.profileName {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f2f5;
}

.profileNameText {
    font-size: 1.6rem;
    color: black;
    letter-spacing: -0.5px;
}

.profileStatus {
    font-size: 0.85rem;
    font-weight: 500;
    color: #10b981;
    background: #ecfdf5;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ---------- Био ---------- */
.bio {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bioItem {
    display: flex;
    gap: 10px;
    font-size: 1em;
    line-height: 2.2;
}

.bioIcon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    flex-shrink: 0;
    margin-top: 2px;
}

.bioIcon svg {
    width: 18px;
    height: 18px;
    display: block;
    margin: 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bioLabel {
    color: #8b8fa3;
    font-weight: 500;
    min-width: 130px;
    flex-shrink: 0;
}

.bioValue {
    color: #1e1e2f;
    font-weight: 500;
    flex: 1;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ---------- Навигация профиля ---------- */
.profileNavigation {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    width: fit-content;
    margin: 24px auto;
}

.profileNavigation__btn {
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #5a6072;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.profileNavigation__btn--active {
    background: #3b5dd3;
    color: white;
}

.profileContent {
    display: flex;
    justify-content: center;
    flex-direction: column;
}

.profileNavigationWrapper {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.profileNavigationWrapper::-webkit-scrollbar {
    display: none;
}

/* ---------- Постинг ---------- */
.postingSection {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 600px;
    margin: 20px auto 0;
    background: white;
    border-radius: 20px;
    padding: 10px 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
}

.postingRow {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.profilePinButton,
.sendButton {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.postingRow .profilePinButton,
.postingRow .sendButton {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: background 0.2s;
}

#profilePostingInput {
    flex: 1;
    min-height: 36px;
    max-height: 100px;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    padding: 8px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    background-color: #fafafa;
    transition: border-color 0.2s;
    outline: none;
    overflow-y: auto;
    scrollbar-width: none;
}

#profilePostingInput::-webkit-scrollbar {
    display: none;
}

#profilePostingInput:focus {
    border-color: #7c3aed;
    background-color: #fff;
}

/* ---------- Фотоальбомы ---------- */
.facebookSection {
    background-color: #ffffff;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
    max-width: 800px;
    width: 100%;
    margin-bottom: 24px;
}

.facebookLabel {
    display: flex;
    align-items: center;
    margin-top: 10px;
    margin-left: 25px;
    margin-right: 25px;
    margin-bottom: 16px;
}

.facebookLabel p {
    font-size: 2em;
    font-weight: 500;
    color: #1e1e2f;
    margin: 0;
    padding: 0;
}

.facebook {
    display: flex;
    justify-content: center;
    padding-bottom: 20px;
}

.facebook img {
    border: none;
}

.facebookPicture {
    width: 250px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
}

/* ---------- Кнопка "Больше" и раскрытие био ---------- */
.btn--more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #3b5dd3;
    transition: all 0.2s;
    margin-left: 12px;
}

.btn--more:hover {
    background: #f0f4ff;
    border-color: #3b5dd3;
}

.bio-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.bio-wrapper.open {
    max-height: 100%;
}

/* ---------- Десктоп: информация видна сразу ---------- */
@media (min-width: 1025px) {
    .bio-wrapper {
        max-height: none !important;
        overflow: visible;
    }
    .btn--more {
        display: none;
    }
}

/* Скрываем скроллбар у навигации */
.profileNavigationWrapper {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.profileNavigationWrapper::-webkit-scrollbar {
    display: none;
}

/* --- Дополнительные статусы (из user.php) --- */
.profileStatus--online { 
    background: #ecfdf5; 
    color: #10b981; 
}
.profileStatus--recent { 
    background: #fff7ed; 
    color: #ea580c; 
}
.profileStatus--offline { 
    background: #f3f4f6; 
    color: #6b7280; 
}

/* --- Список друзей (из user.php) --- */
#section-friends .friends-grid { 
    display: flex; 
    flex-direction: column; 
    gap: 0; 
}
#section-friends .friend-card { 
    border-bottom: 1px solid #eef0f5; 
    margin: 0; 
    border-radius: 0; 
    background: #fff; 
    padding: 10px 12px; 
}
#section-friends .friend-card:last-child { 
    border-bottom: none; 
}

/* ---------- Счётчик символов (280 лимит) ---------- */
.char-counter {
    text-align: right;
    font-size: 0.85em;
    color: #8b8fa3;
    margin-top: 8px;
    padding: 0 12px;
    transition: color 0.2s ease;
    font-weight: 500;
}

.char-counter.warning {
    color: #f59e0b;
}

.char-counter.danger {
    color: #dc2626;
    font-weight: 600;
}

/* =====================================================================
   INFINITE SCROLL
   Skeleton loader, end message, retry button
   ===================================================================== */

/* ---------- Sentinel ---------- */
.infinite-scroll-sentinel {
    height: 1px;
    width: 100%;
}

/* ---------- Skeleton Loader ---------- */
.infinite-scroll-skeleton {
    max-width: 600px;
    width: 100%;
    margin: 20px auto;
    padding: 0 16px;
    box-sizing: border-box;
}

.skeleton-post {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

/* Аватар + имя */
.skeleton-post::before {
    content: '';
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 48px;
    margin-bottom: 16px;
    background:
        /* Круглый аватар */
        radial-gradient(circle at 24px 24px, #e0e0e0 20px, transparent 21px),
        /* Две строки "имени" */
        linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 48px 48px, 200% 100%;
    background-position: 0 0, 60px 8px;
    background-repeat: no-repeat, repeat;
    border-radius: 8px;
    animation: shimmer 1.5s infinite;
}

/* Медиа блок */
.skeleton-post__media {
    height: 300px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 12px;
    margin-bottom: 12px;
}

/* Строки текста */
.skeleton-post__text-line {
    height: 14px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-post__text-line:nth-child(2) { width: 85%; }
.skeleton-post__text-line:nth-child(3) { width: 70%; }

/* Footer (кнопки реакций) */
.skeleton-post__footer {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #f0f2f5;
}

.skeleton-post__footer-item {
    width: 60px;
    height: 32px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .skeleton-post::before,
    .skeleton-post__media,
    .skeleton-post__text-line,
    .skeleton-post__footer-item {
        animation: none;
        background: #e0e0e0;
    }
}

/* ---------- End Message ---------- */
.infinite-scroll-end-message {
    text-align: center;
    padding: 48px 20px;
    margin: 24px auto;
    max-width: 600px;
    animation: fadeInUp 0.4s ease-out;
}

.infinite-scroll-end-message__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #f0f4ff;
    color: #3b5dd3;
    margin-bottom: 16px;
}

.infinite-scroll-end-message__text {
    color: #8b8fa3;
    font-size: 0.95rem;
    margin: 0;
    font-weight: 500;
}

/* ---------- Retry Button ---------- */
.infinite-scroll-retry {
    text-align: center;
    padding: 32px 20px;
    margin: 24px auto;
    max-width: 600px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
    animation: fadeInUp 0.4s ease-out;
}

.infinite-scroll-retry__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fef2f2;
    color: #dc2626;
    margin-bottom: 16px;
}

.infinite-scroll-retry__text {
    color: #4b5563;
    font-size: 0.95rem;
    margin: 0 0 16px;
    font-weight: 500;
}

.infinite-scroll-retry__btn {
    padding: 10px 28px !important;
    border-radius: 12px !important;
    background: #3b5dd3 !important;
    color: #fff !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    transition: background 0.2s ease, transform 0.1s ease !important;
}

.infinite-scroll-retry__btn:hover {
    background: #2d4ba8 !important;
}

.infinite-scroll-retry__btn:active {
    transform: scale(0.98);
}

/* ---------- Shared Animations ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .infinite-scroll-end-message,
    .infinite-scroll-retry {
        animation: none;
    }
}

/* =====================================================================
   VIDEO POLLER — Спиннер и стили для обрабатываемых видео
   ===================================================================== */

@keyframes video-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.video-spinner {
    display: inline-block;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: video-spin 1s linear infinite;
}

/* Тёмный вариант спиннера (для светлого фона) */
.video-spinner--dark {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: #3b5dd3;
}

/* Плавный переход при замене placeholder на плеер */
.video-poller {
    transition: opacity 0.3s ease;
    position: relative;
    overflow: hidden;
}

.video-ready {
    animation: videoFadeIn 0.3s ease-out;
}

@keyframes videoFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .video-spinner {
        animation: none;
        border: 3px solid #3b5dd3;
        border-top-color: transparent;
    }

    .video-ready {
        animation: none;
    }
}

/* =====================================================================
   МОДАЛЬНОЕ ОКНО ДЛЯ ПОЛНОЭКРАННОГО ПРОСМОТРА ФОТО
   ===================================================================== */
.media-fullscreen-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.media-fullscreen-modal.is-active {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.media-fullscreen-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.92) !important;
    cursor: pointer !important;
}

.media-fullscreen-content {
    position: relative !important;
    max-width: 90vw !important;
    max-height: 90vh !important;
    z-index: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.media-fullscreen-close {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: none !important;
    color: white !important;
    cursor: pointer !important;
    padding: 12px !important;
    border-radius: 50% !important;
    transition: background 0.2s !important;
    z-index: 100000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.media-fullscreen-close:hover {
    background: rgba(255, 255, 255, 0.25) !important;
}

.media-fullscreen-body {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.media-fullscreen-body img {
    max-width: 90vw !important;
    max-height: 90vh !important;
    object-fit: contain !important;
    display: block !important;
    border-radius: 4px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
}

body.media-modal-open {
    overflow: hidden !important;
}

/* ✅ Lazy loading для видео */
video.lazy-video {
    background: #000 url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect fill="%23333" width="100" height="100"/><path fill="%23fff" d="M40 30 L70 50 L40 70 Z"/></svg>') center/60px no-repeat;
    cursor: pointer;
    min-height: 300px;
}

video.lazy-video[data-loaded="true"] {
    background: #000;
}







/* ✅ Видео: controls скрыты по умолчанию */
video.lazy-video::-webkit-media-controls {
    display: none !important;
}

video.lazy-video::-webkit-media-controls-enclosure {
    display: none !important;
}

video.lazy-video::-webkit-media-controls-panel {
    display: none !important;
}

/* Когда controls активированы — показываем */
video.lazy-video[data-controls-active="true"]::-webkit-media-controls {
    display: flex !important;
}

video.lazy-video[data-controls-active="true"]::-webkit-media-controls-enclosure {
    display: flex !important;
}

video.lazy-video[data-controls-active="true"]::-webkit-media-controls-panel {
    display: flex !important;
}

/* Overlay с иконкой звука (появляется при наведении) */
.video-sound-overlay {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
    color: white;
    font-size: 18px;
}

.video-sound-overlay:hover {
    background: rgba(0,0,0,0.8);
}

/* Контейнер для видео должен быть relative */
.carousel-slide[data-video-slide="true"] {
    position: relative;
}
