/* Main index.html additional features styles */

/* News Feed Styles */
.news-feed-section {
    margin-bottom: 2rem;
}

.news-feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #0d6efd;
}

.news-feed-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-feed-icon {
    font-size: 1.75rem;
}

.refresh-news-btn {
    background: none;
    border: none;
    color: #0d6efd;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

.refresh-news-btn:hover {
    background-color: #e7f1ff;
    transform: rotate(180deg);
}

/* Category Tabs */
.news-categories {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.category-tab {
    padding: 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.category-tab:hover {
    border-color: #007bff;
    color: #007bff;
}

.category-tab.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.category-tab i {
    margin-right: 0.25rem;
}

/* Carousel Wrapper - FIXED */
.news-carousel-wrapper {
    position: relative;
    margin-bottom: 0; /* Changed from 1rem to 0 */
}

/* News Carousel Container */
#news-feed-container {
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#news-feed-container::-webkit-scrollbar {
    display: none;
}

/* Carousel Navigation */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.carousel-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.carousel-nav-prev {
    left: -20px;
}

.carousel-nav-next {
    right: -20px;
}

/* Carousel Indicators - FIXED */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem; /* Increased from 1rem */
    margin-bottom: 2rem; /* Added more space */
    position: relative; /* Changed from default */
    z-index: 1; /* Ensure proper stacking */
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d0d0d0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: #007bff;
    width: 30px;
    border-radius: 5px;
}

.indicator:hover {
    background: #007bff;
    opacity: 0.7;
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(12, calc(25% - 0.75rem));
    gap: 1rem;
    padding: 0.5rem 0;
}

.news-card {
    background: #ffffff;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    text-decoration: none;
}

.news-image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.news-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-image {
    transform: scale(1.05);
}

.news-category-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(13, 110, 253, 0.9);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
}

.no-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #6c757d;
}

.news-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-description {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.news-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #6c757d;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
    margin-top: auto;
}

.news-source {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
}

.news-date {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.news-loading {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.news-error {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
}

/* Section Separator - NEW */
.news-section-separator-decorative {
    text-align: center;
    margin: 2.5rem 0;
    position: relative;
}

.news-section-separator-decorative::before,
.news-section-separator-decorative::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: linear-gradient(to right, transparent, #dee2e6, transparent);
}

.news-section-separator-decorative::before {
    left: 0;
}

.news-section-separator-decorative::after {
    right: 0;
}

.separator-icon {
    display: inline-block;
    color: #6c757d;
    font-size: 1.2rem;
    padding: 0 1rem;
    background: white;
    position: relative;
    z-index: 1;
}

/* Dark Theme */
[data-theme="dark"] .news-feed-title {
    color: var(--text-dark, #e2e8f0);
}

[data-theme="dark"] .news-card {
    background: var(--widget-bg, #263242);
    border: 1px solid var(--border-light, #4a5568);
}

[data-theme="dark"] .news-title {
    color: var(--text-dark, #e2e8f0);
}

[data-theme="dark"] .news-description {
    color: var(--text-muted, #a0aec0);
}

[data-theme="dark"] .news-meta {
    color: var(--text-muted, #a0aec0);
    border-top-color: var(--border-light, #4a5568);
}

[data-theme="dark"] .news-image-container {
    background: linear-gradient(135deg, var(--input-bg, #1e2a38) 0%, var(--border-light, #4a5568) 100%);
}

[data-theme="dark"] .no-image-placeholder {
    color: var(--text-muted, #a0aec0);
}

[data-theme="dark"] .news-error {
    background: #f8d7da;
    color: #721c24;
}

[data-theme="dark"] .separator-icon {
    background: var(--body-bg, #1a202c);
    color: var(--text-muted, #a0aec0);
}

[data-theme="dark"] .category-tab {
    background: var(--widget-bg, #263242);
    border-color: var(--border-light, #4a5568);
    color: var(--text-dark, #e2e8f0);
}

[data-theme="dark"] .category-tab:hover {
    border-color: #4299e1;
    color: #4299e1;
}

[data-theme="dark"] .category-tab.active {
    background: #4299e1;
    color: white;
    border-color: #4299e1;
}

/* Responsive */
@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: repeat(12, calc(50% - 0.5rem));
    }
    
    .news-image-container {
        height: 180px;
    }
    
    .carousel-nav {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .carousel-nav-prev {
        left: -15px;
    }
    
    .carousel-nav-next {
        right: -15px;
    }
    
    .category-tab {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .carousel-indicators {
        margin-top: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .news-section-separator-decorative {
        margin: 2rem 0;
    }
}

/* Styles for the subtitle removed feature */
.feature-icon-subtle {
    font-size: 2.5rem;
    opacity: 0.4;
    margin-bottom: 1rem;
}

.sad-emoji-small {
    font-size: 2.5rem;
    animation: sad-bounce-small 2s ease-in-out infinite;
}

@keyframes sad-bounce-small {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.trash-bin-small {
    width: 120px;
    height: 150px;
    margin: 0 auto;
    position: relative;
    animation: float-small 3s ease-in-out infinite;
}

@keyframes float-small {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

.bin-body-small {
    width: 110px;
    height: 120px;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border-radius: 0 0 15px 15px;
    position: relative;
    margin: 0 auto;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.bin-lid-small {
    width: 120px;
    height: 20px;
    background: linear-gradient(135deg, #5a6268 0%, #3d4348 100%);
    border-radius: 8px 8px 0 0;
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.bin-handle-small {
    width: 40px;
    height: 10px;
    background: #495057;
    border-radius: 8px 8px 0 0;
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.bin-lines-small {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.bin-line-small {
    position: absolute;
    width: 2px;
    height: 100px;
    background: rgba(255,255,255,0.1);
    top: 10px;
}

.bin-line-small:nth-child(1) { left: 27px; }
.bin-line-small:nth-child(2) { left: 54px; }
.bin-line-small:nth-child(3) { right: 27px; }

.papers-small {
    position: absolute;
    width: 100%;
    height: 90px;
    bottom: 15px;
    overflow: hidden;
}

.paper-small {
    position: absolute;
    width: 25px;
    height: 32px;
    background: white;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    animation: paper-float-small 4s ease-in-out infinite;
}

.paper-small:before {
    content: '';
    position: absolute;
    width: 70%;
    height: 1px;
    background: #dee2e6;
    top: 6px;
    left: 15%;
    box-shadow: 0 5px 0 #dee2e6, 0 10px 0 #dee2e6, 0 15px 0 #dee2e6;
}

.paper-small:nth-child(1) {
    left: 15px;
    bottom: 25px;
    transform: rotate(-12deg);
    animation-delay: 0s;
}

.paper-small:nth-child(2) {
    right: 18px;
    bottom: 30px;
    transform: rotate(10deg);
    animation-delay: 0.5s;
}

.paper-small:nth-child(3) {
    left: 50%;
    transform: translateX(-50%) rotate(-6deg);
    bottom: 20px;
    animation-delay: 1s;
}

@keyframes paper-float-small {
    0%, 100% { transform: translateY(0) rotate(var(--rotate, 0deg)); }
    50% { transform: translateY(-4px) rotate(calc(var(--rotate, 0deg) + 4deg)); }
}

.subtitle-icon-small {
    font-size: 16px;
    color: #6c757d;
    position: absolute;
    animation: subtitle-fade-small 2s ease-in-out infinite;
}

.subtitle-icon-small:nth-child(4) {
    left: 22px;
    bottom: 18px;
    animation-delay: 0.2s;
}

.subtitle-icon-small:nth-child(5) {
    right: 25px;
    bottom: 22px;
    animation-delay: 0.8s;
}

@keyframes subtitle-fade-small {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.subtitle-removed-visual {
    padding: 2rem 1rem;
}
  
/* Subtitles style */
.feature-card {
    background-color: #ffff;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}
.feature-card:hover {
    transform: translateY(-5px);
}
.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #0d6efd;
}
.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #212529;
}
.feature-description {
    color: #6c757d;
    line-height: 1.6;
}
.popular-preview h5 {
    color: #212529;
    font-weight: 600;
}

/* Improved Mini Subtitle Cards with Fixed Dimensions */
.subtitle-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
    align-items: stretch;
}

.subtitle-card-wrapper {
    height: 120px; /* Fixed height for all cards */
}

.mini-subtitle-card {
    background: #ffff;
    border-radius: 0.5rem;
    padding: 0.75rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    height: 100%; /* Fill the fixed wrapper height */
    overflow: hidden;
}

.mini-subtitle-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.375rem 0.75rem rgba(0,0,0,0.15);
    text-decoration: none;
    color: inherit;
}

/* Fixed Poster Dimensions */
.mini-poster {
    width: 75px;
    height: 95px;
    border-radius: 0.375rem;
    overflow: hidden;
    flex-shrink: 0;
    background: #f8f9fa;
}

.poster-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-poster-mini {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.2rem;
}

/* Improved Info Section */
.mini-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    overflow: hidden;
}

.mini-title-section {
    flex: 1;
    min-height: 0;
}

.mini-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #212529;
    line-height: 1.2;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.mini-type-year {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    margin-bottom: 0.25rem;
    font-size: 0.7rem;
    color: #6c757d;
}

.mini-type,
.mini-year {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

/* Episode Info Badge */
.episode-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 0.3rem;
    font-size: 0.65rem;
    font-weight: 600;
    display: inline-block;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    margin-bottom: 0.4rem;
    white-space: nowrap;
}

/* Stats Section - Always at Bottom */
.mini-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: #6c757d;
    margin-top: auto;
    flex-shrink: 0;
}

.mini-downloads,
.mini-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.mini-rating i.fas.fa-star {
    color: #ffc107 !important;
}

/* Dark theme overrides for index page */
[data-theme="dark"] .feature-card {
    background-color: var(--widget-bg, #263242);
    color: var(--text-dark, #e2e8f0);
    box-shadow: var(--secondary-shadow, 0 1px 3px rgba(0,0,0,0.35));
    border: 1px solid var(--border-light, #4a5568);
}

[data-theme="dark"] .feature-title {
    color: var(--text-dark, #e2e8f0);
}

[data-theme="dark"] .feature-description {
    color: var(--text-muted, #a0aec0);
}

[data-theme="dark"] .popular-preview h5 {
    color: var(--text-dark, #e2e8f0);
}

[data-theme="dark"] .mini-subtitle-card {
    background: var(--widget-bg, #263242);
    border: 1px solid var(--border-light, #4a5568);
    color: var(--text-dark, #e2e8f0);
}

[data-theme="dark"] .mini-title {
    color: var(--text-dark, #e2e8f0);
}

[data-theme="dark"] .mini-type-year {
    color: var(--text-muted, #a0aec0);
}

[data-theme="dark"] .mini-stats {
    color: var(--text-muted, #a0aec0);
}

[data-theme="dark"] .no-poster-mini {
    background: linear-gradient(135deg, var(--input-bg, #1e2a38) 0%, var(--border-light, #4a5568) 100%);
    color: var(--text-muted, #a0aec0);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .subtitle-cards-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .subtitle-card-wrapper {
        height: 100px; /* Slightly smaller on mobile */
    }
    
    .mini-subtitle-card {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .mini-poster {
        width: 40px;
        height: 55px;
    }
    
    .mini-title {
        font-size: 0.8rem;
        -webkit-line-clamp: 1;
    }
    
    .mini-type-year {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }
    
    .mini-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
        font-size: 0.65rem;
    }
}

@media (max-width: 576px) {
    .subtitle-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .subtitle-card-wrapper {
        height: 90px;
    }
    
    .mini-subtitle-card {
        padding: 0.4rem;
    }
    
    .mini-poster {
        width: 35px;
        height: 50px;
    }
}