/* =============================================================================
   Reader Widgets CSS - Sistema de widgets para el reader
   ============================================================================= */

/* Sección social principal */
.reader-social-section {
    /* background: #f8f9fa; */
    padding: 20px 0;
    margin-top: 30px;
    /* border-top: 1px solid #e9ecef; */
}
.reader-social-section .container {
    max-width: 1200px;
    margin: auto;
    padding: 30px;
}

.social-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
}

.episode-info h4 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.episode-number {
    color: #666;
    font-size: 0.9rem;
    margin-right: 10px;
}

.schedule {
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Botones de acción social */
.social-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 20px;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #f8f9fa;
    color: #333;
    transform: translateY(-1px);
}

.like-btn.liked {
    background: #ff4757;
    color: white;
    border-color: #ff4757;
}

.like-btn.liked:hover {
    background: #ff3742;
}

/* Dropdown de compartir */
.share-group {
    position: relative;
}

.share-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.share-group:hover .share-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(5px);
}

.share-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f1f1;
}

.share-option:last-child {
    border-bottom: none;
}

.share-option:hover {
    background: #f8f9fa;
    color: #333;
}

/* Navegación de episodios */
.episode-navigation {
    border-top: 1px solid #e9ecef;
    padding-top: 20px;
}

.episode-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    /* background: white;
    border: 1px solid #ddd; */
    border-radius: 8px;
    /* color: #666; */
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    flex: 1;
    justify-content: center;
    max-width: 230px;
}

.nav-btn:hover:not(.disabled) {
    /* background: #00 7bff;*/
    color: white;
    /* border-color: #007bff; */
    transform: translateY(-1px);
}

.nav-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.all-btn {
    /* background: #007bff; */
    color: white;
    /* border-color: #007bff; */
    font-weight: 600;
}

.all-btn:hover {
    /* background: #0056b3;
    border-color: #0056b3; */
}

/* Container principal con layout flex */
.chapter-comments-section {
   /*  background: #f8f9fa; */
    padding: 20px 0;
    margin-top: 30px;
}

.comments-widget-layout {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.comments-container {
    flex: 1;
    min-width: 0; /* Importante para flex */
}

.comments-title {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
    font-weight: 600;
}

.comments-title i {
    margin-right: 10px;
    color: var(--zikpic-green);
}

/* Sidebar de widgets */
.reader-sidebar {
    width: 320px;
    flex-shrink: 0;
}

.widget {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.widget h3 {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    gap: 8px;
}

.widget h3 i:first-child {
    margin-right: 8px;
    color: #e74c3c;
}

.genre-filter {
    background: #e9ecef;
    color: #666;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: normal;
}

/* Series lists */
.series-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.series-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rank {
    width: 20px;
    height: 20px;
    background: var(--zikpic-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.series-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 0;
}

.series-thumbnail,
.original-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.series-thumbnail img,
.original-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.series-info,
.original-info {
    flex: 1;
    min-width: 0;
}

.series-info h4,
.original-info h4 {
    margin: 0 0 2px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.series-info .author,
.original-info .author,
.series-info .category {
    font-size: 0.8rem;
    color: #666;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Originals list */
.originals-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.original-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.original-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 0;
}

/* Gallery grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
}

.gallery-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.gallery-thumbnail {
    width: 100%;
    height: 100%;
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 10px;
    transform: translateY(100%);
    transition: transform 0.2s ease;
}

.gallery-item:hover .gallery-thumbnail img {
    transform: scale(1.05);
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay h5 {
    margin: 0 0 2px 0;
    font-size: 0.8rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-overlay span {
    font-size: 0.7rem;
    opacity: 0.9;
}

/* Responsive design */
@media (max-width: 1024px) {
    .reader-sidebar {
        width: 280px;
    }
    
    .comments-widget-layout {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .comments-widget-layout {
        flex-direction: column;
        gap: 30px;
    }
    
    .reader-sidebar {
        width: 100%;
        order: -1; /* Widget arriba en móvil */
    }
    
    .social-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .social-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .episode-nav {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-btn {
        max-width: none;
        width: 100%;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 480px) {
    .comments-widget-layout {
        padding: 0 15px;
    }
    
    .social-actions {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .action-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}