/* story-detail.css — вынесено из инлайн <style> в templates/stories/story_detail.html
   (страница /stories/<slug>/, ~237 страниц рассказов). */

/* Стили для плейлистов в сайдбаре */
.playlist-item {
    transition: all 0.2s ease;
}

.playlist-item:hover {
    background-color: #f8f9fa;
    transform: translateX(2px);
}

.playlist-checkbox {
    cursor: pointer;
}

.playlist-details:hover {
    color: var(--orthodox-blue, #2B5AA0);
}

.playlist-actions button {
    opacity: 0.7;
    transition: all 0.2s ease;
}

.playlist-item:hover .playlist-actions button {
    opacity: 1;
    transform: scale(1.1);
}

.watch-later-btn .btn-text,
.favorites-btn .btn-text {
    color: #2d3748 !important; /* Темный текст для читаемости */
}

.watch-later-btn:hover,
.favorites-btn:hover {
    transform: translateX(2px);
    transition: transform 0.2s ease;
}

.watch-later-btn.active {
    background-color: #e3f2fd;
    border-color: #2196f3;
    color: #1976d2 !important;
}

.watch-later-btn.active .btn-text {
    color: #1976d2 !important;
}

.favorites-btn.active {
    background-color: #ffebee;
    border-color: #f44336;
    color: #d32f2f !important;
}

.favorites-btn.active .btn-text {
    color: #d32f2f !important;
}

.system-playlists .btn-link {
    color: #6c757d;
    padding: 8px 16px;
}

.system-playlists .btn-link:hover {
    color: #495057;
    background-color: #f8f9fa;
}

.quick-actions .btn {
    border-radius: 0;
    border-bottom: 1px solid #dee2e6;
    color: #495057 !important; /* Базовый темный цвет */
    font-weight: 500;
}

.quick-actions .btn:hover {
    background-color: #f8f9fa !important;
    color: #343a40 !important;
}

.playlist-info {
    transition: all 0.2s ease;
}

.playlist-info:hover {
    background-color: rgba(0,123,255,0.1);
    border-radius: 4px;
}

/* Стили для мобильного виджета плейлистов */
.playlist-mobile-widget {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.playlist-mobile-widget:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.playlist-mobile-list {
    border-radius: 8px;
    background: rgba(255,255,255,0.6);
    border: 1px solid rgba(0,0,0,0.05);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.playlist-mobile-item {
    display: flex;
    align-items: center;
    padding: 3px 6px;
    margin: 1px 0;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    background: transparent;
}

.playlist-mobile-item:hover {
    background: rgba(0,123,255,0.1);
    transform: translateX(2px);
}

.playlist-mobile-item:active {
    transform: scale(0.98);
    background: rgba(0,123,255,0.2);
}

/* Убираем активное состояние для обычных плейлистов */
/* .playlist-mobile-item.active - убрано, так как теперь они открывают модальные окна */

.playlist-mobile-name {
    flex: 1;
    font-size: 0.65rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    line-height: 1.2;
}

.playlist-mobile-count {
    font-size: 0.6rem;
    color: #6c757d;
    background: rgba(108,117,125,0.1);
    padding: 1px 4px;
    border-radius: 8px;
    margin-left: 4px;
    min-width: 16px;
    text-align: center;
}

.playlist-mobile-item.active .playlist-mobile-count {
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.2);
}

/* Системные плейлисты */
.playlist-mobile-item.system-playlist {
    font-weight: 500;
}

.playlist-mobile-item.system-playlist.active {
    background: linear-gradient(135deg, rgba(108,117,125,0.1), rgba(108,117,125,0.2));
    color: #495057;
    border: 1px solid rgba(108,117,125,0.3);
}

.playlist-mobile-item.system-playlist.active[data-playlist-id="favorites"] {
    background: linear-gradient(135deg, rgba(220,53,69,0.1), rgba(220,53,69,0.2));
    color: #721c24;
    border: 1px solid rgba(220,53,69,0.3);
}

/* Анимация загрузки для мобильного виджета */
@keyframes mobile-playlist-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.mobile-playlist-loading {
    animation: mobile-playlist-pulse 1.5s infinite;
}

/* Стили для кнопки сворачивания мобильного виджета */
#mobileTogglePlaylistsBtn {
    transition: all 0.2s ease;
    border: 1px solid #dee2e6 !important;
    background: #f8f9fa !important;
    color: #6c757d !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mobileTogglePlaylistsBtn:hover {
    background: #e9ecef !important;
    border-color: #adb5bd !important;
    color: #495057 !important;
    transform: scale(1.05);
}

#mobileTogglePlaylistsBtn:active {
    transform: scale(0.95);
    background: #dee2e6 !important;
}

#mobileToggleIcon {
    transition: transform 0.3s ease;
}

#mobileTogglePlaylistsBtn:hover #mobileToggleIcon {
    transform: scale(1.1);
}

/* Стили для ссылки "Все плейлисты" в мобильном виджете */
.playlist-mobile-widget .text-center a.btn {
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.playlist-mobile-widget .text-center a.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,123,255,0.3);
}

/* Отзывчивость кнопок для разных экранов */
@media (max-width: 480px) {
    .playlist-mobile-widget .btn {
        padding: 4px 6px !important;
        min-width: 24px;
        min-height: 24px;
    }
    
    .playlist-mobile-widget .btn i {
        font-size: 0.7rem !important;
    }
}

@media (max-width: 768px) {
    .playlist-mobile-widget .btn {
        padding: 5px 8px !important;
        min-width: 28px;
        min-height: 28px;
    }
    
    .playlist-mobile-widget .btn i {
        font-size: 0.75rem !important;
    }
    
    .playlist-mobile-widget .d-flex.gap-1 {
        gap: 0.25rem !important;
    }
}

/* Адаптивное видео */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 соотношение */
    height: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Стили для переключателя платформ */
.platform-switch-btn {
    transition: all 0.3s ease;
    font-weight: 500;
}

.platform-switch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.platform-switch-btn.btn-primary,
.platform-switch-btn.btn-danger {
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.video-platform-wrapper {
    transition: opacity 0.3s ease;
}

.video-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #6c757d;
}

.video-placeholder i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Стили для кнопок действий (Нравится и Поделиться) */
.story-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Мобильная адаптация - горизонтальное расположение кнопок */
@media screen and (max-width: 768px) {
    .story-content .story-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        margin-bottom: 1rem !important;
        width: 100% !important;
    }
    
    .story-content .story-actions .btn {
        width: 100% !important;
        justify-content: center !important;
        padding: 10px 8px !important;
        font-size: 0.9rem !important;
        border-radius: 8px !important;
        text-align: center !important;
        margin: 0 !important;
        flex: 1 !important;
    }
    
    .story-content .story-actions .btn i {
        margin-right: 6px !important;
    }
}

@media screen and (max-width: 576px) {
    .story-content .story-actions {
        gap: 6px !important;
        margin-bottom: 0.75rem !important;
    }
    
    .story-content .story-actions .btn {
        padding: 8px 6px !important;
        font-size: 0.85rem !important;
        border-radius: 6px !important;
    }
    
    .story-content .story-actions .btn i {
        margin-right: 4px !important;
        font-size: 0.9rem !important;
    }
}

/* Стили для метаданных рассказа */
.story-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
}

/* Вторая строка с датой и просмотрами */
.meta-row-secondary {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 0.9rem;
    color: #6c757d;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #495057;
}

.meta-item i {
    color: #6c757d;
    font-size: 1rem;
}

.meta-item a {
    font-weight: 500;
    transition: color 0.2s ease;
}

.meta-item a:hover {
    color: #c53030 !important;
    text-decoration: underline !important;
}

/* Стили для dropdown меню "Поделиться" */
.share-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0.5rem;
    z-index: 1000;
    min-width: 200px;
}

.share-dropdown-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e9ecef;
    overflow: hidden;
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.share-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #212529;
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
}

.share-dropdown-item:last-child {
    border-bottom: none;
}

.share-dropdown-item:hover {
    background-color: #f8f9fa;
    color: #212529;
}

.share-dropdown-item i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.share-dropdown-item span {
    flex: 1;
}

/* Анимация биения сердечка */
@keyframes heartbeat {
    0% {
        transform: scale(1);
    }
    10% {
        transform: scale(1.2);
    }
    20% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.2);
    }
    40% {
        transform: scale(1);
    }
    100% {
        transform: scale(1);
    }
}

.heart-icon {
    display: inline-block;
    animation: heartbeat 2s ease-in-out infinite;
    color: #dc3545 !important;
    transition: all 0.3s ease;
}

.heart-icon:hover {
    animation: heartbeat 0.8s ease-in-out infinite;
    transform: scale(1.1);
}

/* Заполненное сердечко */
.bi-heart-fill.heart-icon {
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .video-container {
        margin-bottom: 15px;
    }
    
    .story-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 0.75rem;
        background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
        border-radius: 12px;
        border-left: 3px solid #e74c3c;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        animation: fadeInUp 0.6s ease-out;
    }
    
    .meta-item {
        font-size: 0.85rem;
        gap: 0.3rem;
        transition: all 0.2s ease;
        padding: 0.25rem 0.5rem;
        border-radius: 6px;
    }
    
    /* Первая строка - кнопки действий */
    .meta-item:not(.meta-secondary) {
        flex: 1;
        min-width: 80px;
        justify-content: center;
    }
    
    /* Вторая строка - информация */
    .meta-item.meta-secondary {
        width: auto;
        flex: 1;
        min-width: 120px;
        margin-top: 0.5rem;
        color: #6c757d;
        font-size: 0.8rem;
    }
    
    .meta-item.meta-secondary:first-of-type {
        margin-top: 0.5rem;
    }
    
    .meta-item i {
        font-size: 0.9rem;
    }
    
    .meta-item .btn {
        font-size: 0.85rem;
    }
    
    /* Дата и просмотры на новой строке */
    .meta-row-secondary {
        width: 100%;
        flex-basis: 100%;
        margin-top: 0.5rem;
        font-size: 0.85rem;
        justify-content: center;
    }
    
    /* Увеличиваем размер мобильного виджета на планшетах */
    .playlist-mobile-list {
        max-height: 100px !important;
    }
    
    .playlist-mobile-name {
        font-size: 0.7rem;
    }
    
    .playlist-mobile-count {
        font-size: 0.65rem;
    }
}

@media (max-width: 576px) {
    .playlist-mobile-widget {
        margin-bottom: 12px;
    }
    
    .playlist-mobile-list {
        max-height: 80px !important;
    }
    
    .playlist-mobile-item {
        padding: 2px 4px;
    }
    
    .playlist-mobile-name {
        font-size: 0.6rem;
    }
    
    .playlist-mobile-count {
        font-size: 0.55rem;
        padding: 0px 3px;
        min-width: 14px;
    }
    
    /* Компактные метаданные на маленьких экранах */
    .story-meta {
        gap: 0.5rem;
        padding: 0.6rem;
    }
    
    .meta-item {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
    }
    
    .meta-item:not(.meta-secondary) {
        min-width: 70px;
    }
    
    .meta-item.meta-secondary {
        min-width: 100px;
        font-size: 0.75rem;
    }
    
    .meta-item span {
        font-size: 0.8rem;
    }
    
    .meta-item i {
        font-size: 0.85rem;
    }
    
    /* Адаптация dropdown на мобильных */
    .share-dropdown {
        left: auto;
        right: 0;
        transform: none;
        min-width: 180px;
    }
    
    .share-dropdown-item {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .share-dropdown-item i {
        font-size: 1.1rem;
    }
}

/* Стили для кнопки добавления плейлиста */
.btn-add-playlist {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    position: relative;
    overflow: hidden;
    text-transform: none;
    letter-spacing: 0.3px;
    min-width: 110px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transform: translateZ(0);
}

.btn-add-playlist:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
    color: white;
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #c084fc 100%);
}

.btn-add-playlist:active {
    transform: translateY(0) scale(1.01);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
    transition: all 0.1s ease;
}

.btn-add-playlist:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* Анимация блика */
.btn-add-playlist::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-add-playlist:hover::before {
    left: 100%;
}

/* Анимация иконки */
.btn-add-playlist i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.btn-add-playlist:hover i {
    transform: rotate(90deg) scale(1.1);
}

/* Эффект пульса при нажатии */
.btn-add-playlist::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn-add-playlist:active::after {
    width: 120%;
    height: 120%;
}

/* Адаптивность кнопки */
@media (max-width: 768px) {
    .btn-add-playlist {
        padding: 6px 12px;
        font-size: 0.8rem;
        min-width: 100px;
        border-radius: 10px;
    }
    
    .btn-add-playlist i {
        font-size: 0.9rem;
    }
}

/* Стили для модального окна плейлиста */
.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.playlist-story-item {
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.playlist-story-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #007bff;
}

.playlist-story-thumbnail {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    display: flex;
    align-items: center;
    justify-content: center;
}

.playlist-story-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.playlist-story-item:hover .playlist-story-thumbnail img {
    transform: scale(1.05);
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.playlist-story-item:hover .play-overlay {
    opacity: 1;
}

.story-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.story-views-count {
    color: #6c757d;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.remove-from-playlist-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    opacity: 0.8;
    box-shadow: 0 2px 4px rgba(220,53,69,0.3);
}

.remove-from-playlist-btn:hover {
    background: linear-gradient(135deg, #c82333, #a71e2a);
    transform: scale(1.1);
    opacity: 1;
    box-shadow: 0 4px 8px rgba(220,53,69,0.4);
    color: white;
}

.remove-from-playlist-btn:focus {
    box-shadow: 0 0 0 3px rgba(220,53,69,0.25);
    color: white;
}

.remove-from-playlist-btn:active {
    transform: scale(0.95);
}

.playlist-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.story-meta-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.story-category {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.story-category:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    color: white;
    transform: translateY(-1px);
}

.story-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.story-tag {
    background: #f8f9fa;
    color: #6c757d;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.7rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.story-tag:hover {
    background: #e9ecef;
    color: #495057;
}

/* Анимация вращения */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
}

/* Пустое состояние плейлиста */
.empty-playlist {
    animation: gentle-fade-in 0.5s ease-in-out;
}

@keyframes gentle-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Стили для эффекта "читать далее" */
.story-content-wrapper {
    position: relative;
}

.story-content-wrapper.collapsed .read-more-btn {
    margin-top: -15px; /* Поднимаем кнопку чтобы она перекрывала градиент */
    margin-bottom: 20px;
}

.story-description {
    line-height: 1.6;
    font-size: 1rem;
    color: #2c3e50;
    text-align: justify;
    transition: all 0.5s ease;
    overflow: hidden;
}

.story-description.collapsed {
    max-height: 8.5em; /* Примерно 7-8 строк при line-height 1.6 */
    position: relative;
}

.story-description.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3em; /* Высота градиента */
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 30%,
        rgba(255, 255, 255, 0.7) 60%,
        rgba(255, 255, 255, 0.9) 80%,
        rgba(255, 255, 255, 1) 100%
    );
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1; /* Чтобы градиент был поверх текста, но под кнопкой */
}

.story-description.expanded {
    max-height: none;
}

.story-description.expanded::after {
    opacity: 0;
}

.read-more-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 12px 28px;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
    text-transform: none;
    letter-spacing: 0.5px;
    margin: 20px 0;
    display: block;
    transform: translateZ(0);
    cursor: pointer;
    width: 100%; /* На всю ширину блока */
    z-index: 2;
}

.read-more-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
    color: white;
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.read-more-btn:active {
    transform: translateY(0) scale(1.02);
    transition: all 0.1s ease;
}

.read-more-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* Анимация блика */
.read-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.read-more-btn:hover::before {
    left: 100%;
}

/* Анимация иконки */
.read-more-btn i {
    transition: transform 0.3s ease;
    margin-left: 8px;
}

.read-more-btn:hover i {
    transform: translateX(3px);
}

.read-more-btn.expanded i {
    transform: rotate(180deg);
}

/* Эффект пульса при клике */
.read-more-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.read-more-btn:active::after {
    width: 120%;
    height: 120%;
}

/* Адаптивность для кнопки читать далее */
@media (max-width: 768px) {
    .read-more-btn {
        padding: 10px 24px;
        font-size: 0.9rem;
        margin: 15px 0;
    }

    .story-description.collapsed {
        max-height: 4.8em; /* 3 строки на мобильных */
    }

    .story-description.collapsed::after {
        height: 2.5em;
    }
}

@media (max-width: 576px) {
    .read-more-btn {
        padding: 8px 20px;
        font-size: 0.85rem;
        border-radius: 20px;
        margin: 12px 0;
    }

    .story-description.collapsed {
        max-height: 6.5em; /* Еще меньше строк на маленьких экранах */
    }
}

/* Адаптивность модального окна */
@media (max-width: 768px) {
    .playlist-modal-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .playlist-story-item {
        border-radius: 8px;
    }
    
    .playlist-story-thumbnail {
        height: 200px;
    }
    
    .remove-from-playlist-btn {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }
    
    .story-meta-info {
        gap: 8px;
    }
}

@media (max-width: 576px) {
    .modal-xl {
        max-width: 95vw;
    }
    
    .playlist-modal-grid {
        padding: 10px;
        gap: 12px;
    }
    
    .playlist-story-thumbnail {
        height: 180px;
    }
    
    /* Дополнительные стили для маленьких экранов метаданных */
    .story-meta {
        gap: 0.5rem 0.75rem;
        padding: 0.6rem;
        border-radius: 10px;
    }
    
    .meta-item {
        font-size: 0.8rem;
        gap: 0.3rem;
    }
    
    .meta-item i {
        font-size: 0.85rem;
        min-width: 14px;
    }
    
    /* Компактные тексты для маленьких экранов */
    .meta-item span {
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 80px;
    }
    
    /* Исключение для кнопки - не обрезаем */
    .meta-item .btn span {
        max-width: none;
        overflow: visible;
        text-overflow: initial;
        white-space: nowrap;
    }
    
    /* Кнопка в метаданных остается с обычным стилем */
}

/* Анимации для мобильных метаданных */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInScale {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Стили для модального окна "Сохранить в плейлист" */
.save-playlist-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.save-playlist-item:hover {
    background-color: #f8f9fa;
}

.save-playlist-item:last-child {
    border-bottom: none;
}

.save-playlist-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #007bff;
}

.save-playlist-info {
    flex: 1;
    min-width: 0;
}

.save-playlist-title {
    font-weight: 500;
    font-size: 0.95rem;
    color: #212529;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.save-playlist-meta {
    font-size: 0.8rem;
    color: #6c757d;
    margin: 2px 0 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.save-playlist-privacy {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.save-playlist-privacy i {
    font-size: 0.75rem;
}

.save-playlist-loading {
    opacity: 0.6;
    pointer-events: none;
}

.save-playlist-loading .save-playlist-checkbox {
    position: relative;
}

.save-playlist-loading .save-playlist-checkbox::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border: 2px solid #007bff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Пустое состояние */
.save-playlist-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.save-playlist-empty i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.save-playlist-empty h6 {
    margin-bottom: 8px;
    color: #495057;
}

/* Ошибка */
.save-playlist-error {
    text-align: center;
    padding: 40px 20px;
    color: #dc3545;
}

.save-playlist-error i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.7;
}

.save-playlist-error .btn {
    margin-top: 16px;
}

/* Модальное окно */
#saveToPlaylistModal .modal-content {
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: none;
}

#saveToPlaylistModal .modal-header {
    padding: 20px 20px 10px 20px;
}

#saveToPlaylistModal .modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
}

#saveToPlaylistModal .modal-footer {
    padding: 10px 20px 20px 20px;
    justify-content: center;
    display: flex;
}

#saveToPlaylistModal .btn-link {
    color: #007bff;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 0;
}

#saveToPlaylistModal .btn-link:hover {
    color: #0056b3;
    text-decoration: none;
}

/* Адаптивность */
@media (max-width: 576px) {
    .save-playlist-item {
        padding: 10px 16px;
    }
    
    .save-playlist-title {
        font-size: 0.9rem;
    }
    
    .save-playlist-meta {
        font-size: 0.75rem;
    }
    
    #saveToPlaylistModal .modal-header {
        padding: 16px 16px 8px 16px;
    }
    
    #saveToPlaylistModal .modal-footer {
        padding: 8px 16px 16px 16px;
    }
}

/* Вкладки Видео / Аудио */
.media-tabs .nav-link {
    color: #666;
    font-weight: 500;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.6rem 1.2rem;
    transition: all 0.2s ease;
}

.media-tabs .nav-link:hover {
    color: #e74c3c;
    background: transparent;
}

.media-tabs .nav-link.active {
    color: #e74c3c;
    border-bottom: 2px solid #e74c3c;
    background: transparent;
}

/* Аудио плеер */
.audio-player-container {
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-bottom: 1rem;
}

.story-audio-player {
    width: 100%;
    height: 54px;
    border-radius: 8px;
}

.audio-meta {
    color: rgba(255,255,255,0.8);
    font-size: 0.875rem;
    text-align: center;
    margin-top: 0.75rem;
}

@media (max-width: 768px) {
    .audio-player-container {
        padding: 1.25rem;
    }

    .media-tabs .nav-link {
        padding: 0.5rem 0.85rem;
        font-size: 0.9rem;
    }
}
