/* resources/css/threads.css */

/* Threads-like styles */
.threads-container {
    max-width: 600px;
    margin: 0 auto;
}

.thread-post {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.thread-post:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #d0d0d0;
}

.thread-content {
    line-height: 1.5;
    color: #666;
    font-size: 14px;
}

/* Горизонтальный скролл для изображений */
.thread-images-scroll {
    position: relative;
    margin: 12px 0;
}

.images-scroll-container {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    gap: 8px;
    padding: 4px 0;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.images-scroll-container::-webkit-scrollbar {
    height: 4px;
}

.images-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.images-scroll-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.images-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.scroll-image-item {
    flex: 0 0 auto;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #eee;
}

.scroll-image-item:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.scroll-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Кнопки навигации для скролла */
.scroll-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.thread-images-scroll:hover .scroll-nav-btn {
    opacity: 0.8;
}

.scroll-nav-btn:hover {
    background: #fff;
    opacity: 1;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.scroll-nav-btn.prev {
    left: 5px;
}

.scroll-nav-btn.next {
    right: 5px;
}

.scroll-nav-btn i {
    font-size: 14px;
    color: #555;
}

/* Модальное окно для изображений */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1050;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-modal.active {
    display: flex;
    opacity: 1;
}

.image-modal-content {
    max-width: 90%;
    max-height: 85%;
    position: relative;
    text-align: center;
}

.image-modal-content img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1060;
}

.modal-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 1060;
}

.modal-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-nav.prev {
    left: 20px;
}

.modal-nav.next {
    right: 20px;
}

.modal-counter {
    position: absolute;
    bottom: -40px;
    left: 0;
    width: 100%;
    text-align: center;
    color: white;
    font-size: 14px;
    opacity: 0.8;
    font-weight: 500;
}

/* Анимации для постов */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.thread-post {
    animation: fadeInUp 0.3s ease forwards;
}

/* Стили для рейтинга */
.js-rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-rating-up,
.post-rating-down {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.post-rating-up:hover {
    color: #1a73e8 !important;
    background: rgba(26, 115, 232, 0.1);
}

.post-rating-down:hover {
    color: #ea4335 !important;
    background: rgba(234, 67, 53, 0.1);
}

.post-rating-up.active {
    color: #1a73e8 !important;
}

.post-rating-down.active {
    color: #ea4335 !important;
}

/* Адаптивность */
@media (max-width: 768px) {
    .threads-container {
        max-width: 100%;
        padding: 0 10px;
    }
    
    .thread-post {
        border-radius: 10px;
    }
    
    .scroll-image-item {
        width: 100px;
        height: 100px;
    }
    
    .scroll-nav-btn {
        display: none;
    }
    
    .modal-nav {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .modal-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .scroll-image-item {
        width: 80px;
        height: 80px;
    }
    
    .thread-content {
        font-size: 13px;
    }
    
    .modal-nav {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .modal-nav.prev {
        left: 10px;
    }
    
    .modal-nav.next {
        right: 10px;
    }
}