/* ========== Layout & Container Styles ========== */
.iptv-main-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 100%;
    position: relative;
}

.iptv-vertical-tabs {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    width: 100%;
    background: #ffffff;
    padding: 0.75rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}


.tab-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-align: left;
    flex: 1;
    justify-content: center;
    max-width: 200px;
    margin-bottom: 0 !important;
}

.tab-button:hover {
    background: #eee;
    color: #333;
}

.tab-button.active {
    background: #34baf3;
    color: #fff;
}

.tab-button svg {
    width: 20px;
    height: 20px;
}

.iptv-content-container {
    width: 100%;
}

.tab-content {
    display: none;
    width: 100%;
}

.tab-content.active {
    display: block;
}

.coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 2rem;
}

.coming-soon svg {
    margin-bottom: 1rem;
}

.coming-soon h2 {
    margin: 1rem 0;
    color: #333;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .iptv-vertical-tabs {
        flex-wrap: wrap;
        justify-content: center;
    }

    .tab-button {
        flex: 0 0 calc(50% - 0.5rem);
        max-width: none;
    }
}

@media (max-width: 480px) {
    .tab-button {
        flex: 0 0 100%;
    }
}

.iptv-channels-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 0;
}

/* ========== Movie Card Styles ========== */
.movie-card {
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    border: 1px solid #eaeaea;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.movie-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.movie-thumb-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 aspect ratio */
    background: #f5f5f5;
    overflow: hidden;
}

.movie-thumb-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.movie-card:hover .movie-thumb-wrapper img {
    transform: scale(1.05);
}

.movie-thumb-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    background: #f0f0f0;
}

.movie-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.movie-info {
    flex: 1;
}

.movie-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-group {
    font-size: 14px;
    color: #666;
    display: block;
}

.movie-actions {
    position: absolute;
    top: 8px;
    right: 8px;
}

.actions-toggle {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    color: #333;
    backdrop-filter: blur(4px);
    transition: background-color 0.2s ease;
}

.actions-toggle:hover {
    background: rgba(255, 255, 255, 1);
}

.movie-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    pointer-events: none;
    z-index: 999;
    transition: background-color 0.2s ease;
}

.movie-card:has(.movie-actions-dropdown.show)::after {
    background-color: rgba(0, 0, 0, 0.03);
    pointer-events: auto;
}

/* List Styles */

.movies-list .movie-card {
    margin-bottom: 10px;
    padding: 5px;
}

/* ========== Movie Header Styles ========== */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    align-items: start;
}

.movie-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.movie-thumb {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    background: #ccc;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.movie-thumb img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    pointer-events: none;
    user-select: none;
    opacity: 1 !important;
}

.movie-info {
    flex-grow: 1;
    min-width: 0;
}

.movie-info h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-group {
    font-size: 13px;
    color: #666;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#movie-group-filter,
#series-group-filter {
    margin-bottom: 10px;
}

/* Responsive adjustments */

@media only screen and (max-width:768px) {
    .movies-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media only screen and (max-width:540px) {
    .movies-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}


/* ========== Series Styles ========== */
.series-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Changed from 1fr to repeat(2, 1fr) */
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    background: #f5f7fa;
}

.series-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.series-card:hover {
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Adjust card content for two-column layout */
.series-content {
    display: flex;
    flex-direction: column;
    /* Changed from row to column for better two-column fit */
    padding: 1.5rem;
    gap: 1.5rem;
}

.series-main {
    flex: 0 0 auto;
    /* Changed from 300px to auto */
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.series-thumb {
    width: 100%;
    height: 450px;
    /* Reduced from 450px for better proportions */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.series-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.series-info {
    padding: 1rem 0;
}

.series-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
    font-weight: 600;
    color: #1a1a1a !important;
    line-height: 1.2;
}

.series-group {
    display: inline-block;
    font-size: 0.9rem;
    color: #666;
    padding: 0.25rem 0.75rem;
    background: #f0f2f5;
    border-radius: 20px;
}

.series-seasons {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.season {
    border: 1px solid #eef0f2;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.season-header {
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: #f8f9fa;
    font-weight: 600;
    color: #2d3748;
    transition: all 0.2s ease;
}

.season-header:hover {
    background: #edf2f7;
}

.expand-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.season.expanded .expand-icon {
    transform: rotate(180deg);
}

.season-episodes {
    display: none;
    background: #fff;
}

.season.expanded .season-episodes {
    display: block;
}

.episode {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #f0f2f5;
    transition: background-color 0.2s ease;
}

.episode:last-child {
    border-bottom: none;
}

.episode:hover {
    background-color: #f8fafc;
}

.episode-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.episode-number {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
}

.episode-title {
    color: #718096;
    font-size: 0.9rem;
}

.play-episode {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.episode:hover .play-episode {
    opacity: 1;
    background: #edf2f7;
}

.play-episode:hover {
    background: #e2e8f0;
}

.play-episode svg {
    width: 24px;
    height: 24px;
    color: #4a5568;
    transition: color 0.2s ease;
}

.play-episode:hover svg {
    color: #2b6cb0;
}

.watch-now-btn {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background-color: #2b6cb0;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.watch-now-btn:hover {
    background-color: #2c5282;
    transform: translateY(-1px);
}

.series-seasons .loading {
    padding: 2rem;
    text-align: center;
    color: #666;
}

.series-seasons .error {
    padding: 2rem;
    text-align: center;
    color: #e53e3e;
}

/* Responsive breakpoints */


@media only screen and (max-width: 768px) {
    .series-thumb {
        height: 230px;
    }
}

@media (max-width: 1200px) {
    .series-grid {
        grid-template-columns: 1fr;
        /* Return to single column on smaller screens */
    }

    .series-content {
        flex-direction: row;
        /* Return to row layout on single column */
    }

    .series-main {
        flex: 0 0 300px;
        /* Return to original width */
    }
}

/* ========== Series List Styles ========== */

.series-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    background: #f5f7fa;
}

/* List view card modifications */
.series-list .series-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.series-list .series-content {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 0 !important;
}

/* Main row layout */
.series-list .series-main {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    flex-direction: row;
}

/* Thumbnail adjustments */
.series-list .series-thumb {
    flex: 0 0 100px;
    height: 140px;
    border-radius: 6px;
}

/* Info section adjustments */
.series-list .series-info {
    flex: 1;
    padding: 0;
}

.series-list .series-info h3 {
    font-size: 1.25rem;
    margin: 0 0 0.5rem 0;
}

/* Watch button adjustments */
.series-list .watch-now-btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
}

/* Seasons section */
.series-list .series-seasons {
    flex: 1;
    width: 100%;
}

.series-list .season {
    border-radius: 6px;
}

.series-list .season-header {
    padding: 0.75rem 1rem;
}

.series-list .episode {
    padding: 0.75rem 1rem;
}

/* Responsive adjustments */
@media (max-width: 425px) {
    .series-list .series-main {
        flex-direction: column;
    }

    .series-list .series-thumb {
        width: 100px;
        height: 140px;
    }
}


/* ========== Channel Card Styles ========== */

.channels-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    align-items: start;
}

.channel-card {
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    padding: 15px;
    gap: 12px;
    width: 100%;
    height: 100%;
    border: 1px solid #eaeaea;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.channel-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.channel-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 0;
    background: #0073aa;
    transition: height 0.3s ease;
}

.channel-card:hover::before {
    height: 100%;
}

.channel-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    pointer-events: none;
    z-index: 999;
    transition: background-color 0.2s ease;
}

.channel-card:has(.channel-actions-dropdown.show)::after {
    background-color: rgba(0, 0, 0, 0.03);
    pointer-events: auto;
}

/* ========== Channel Header Styles ========== */
.channel-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.channel-thumb {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    background: #ccc;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.channel-thumb img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    pointer-events: none;
    user-select: none;
    opacity: 1 !important;
}

.channel-info {
    flex-grow: 1;
    min-width: 0;
}

.channel-info h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-group {
    font-size: 13px;
    color: #666;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== Quality Badge Styles ========== */
.quality-badges {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 4px;
}

.quality-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    background: #e1eeff;
    color: #0073aa;
}

/* ========== Program Information Styles ========== */

.program-info-trigger {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s ease;
}

.program-info-trigger:hover {
    color: #333;
}


/* List Styles */

/* List Layout Styles */
.channels-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.channel-card-list {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.channel-card-list:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.channel-card-list .channel-content {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 16px;
}

.channel-card-list .list-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.channel-card-list h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #000 !important;
}

.channel-card-list .list-quality-badges {
    display: flex;
    gap: 4px;
}

.channel-card-list .quality-badge {
    padding: 2px 6px;
    font-size: 12px;
    border-radius: 4px;
}

.channel-card-list .program-name {
    font-weight: 500;
}

.channel-card-list .program-time {
    color: #9ca3af;
}

.channel-card-list .list-channel-actions {
    position: relative;
    margin-left: auto;
}

.channel-card-list .actions-toggle {
    padding: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #000;
    border-radius: 4px;
    width: auto !important;
}

.channel-card-list .actions-toggle:hover {
    background: #fff;
    color: #000;
}

.channel-card-list .list-program-details {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

/* Dropdown positioning for list layout */
.channel-card-list .channel-actions-dropdown {
    position: absolute;
    left: -500%;
    top: 100%;
    z-index: 10;
}

.channel-card-list .list-channel-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.channel-card-list .list-primary-info {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.channel-card-list .list-program-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    font-size: 14px;
}

@media only screen and (max-width:768px) {
    .channel-card-list .list-channel-info {
        flex-direction: column;
    }

    .channel-card-list h3 {
        font-size: 14px;
        margin-bottom: 5px;
    }
}

/* Tooltip styles */
[data-tooltip] {
    position: relative;
    font-size: 6px;
    text-transform: none !important;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 4px;
    font-size: 12px;
    white-space: normal;
    max-width: 200px;
    width: max-content;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

[data-tooltip]:hover:before {
    visibility: visible;
    opacity: 1;
}

.program-info {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #eaeaea;
}

.program-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    position: relative;
}

.program-time-name {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.program-time {
    font-size: 12px;
    color: #0073aa;
    background: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #e1eeff;
    display: inline-block;
}

.program-name {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* No programs message styling */
.no-programs {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    /* Maintain minimum height */
}

.no-programs-message {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

.no-programs-message svg {
    opacity: 0.7;
    flex-shrink: 0;
}

.current-program {
    background: #f0f7ff;
    border: 1px solid #e1eeff;
    padding: 12px;
    border-radius: 8px;
}

.next-program {
    background: #f8f9fa;
    padding: 8px;
    border-radius: 8px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ========== Progress Bar Styles ========== */

.progress-container {
    display: flex;
    flex-direction: column-reverse;
    gap: 4px;
}

.progress-text {
    font-size: 11px;
    color: #666;
    text-align: right;
}

.progress-bar {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #00a0d2);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* ========== Pagination Styles ========== */

.channels-pagination,
.movies-pagination,
.series-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination-button {
    background: #fff;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    color: #000 !important;
    margin-bottom: 0 !important;
}

.pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-button:not(:disabled):hover {
    background: #f8f9fa;
    border-color: #0073aa;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 5px;
}

.page-number {
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    border: 1px solid #ddd;
    background: #fff;
    color: #000 !important;
    transition: all 0.2s ease;
}

.page-number:hover {
    background: #f8f9fa;
    border-color: #0073aa;
}

.page-number.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.page-dots {
    padding: 8px 12px;
    color: #666;
}

.pagination-info {
    font-size: 14px;
    color: #666;
}


/* ========== Channel Actions Styles ========== */
.channel-actions {
    flex-shrink: 0;
    position: relative;
    z-index: 1000;
    color: #000 !important;
}

.actions-toggle {
    margin-top: 10px;
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.actions-toggle svg {
    fill: #000;
}

.channel-actions-dropdown {
    position: fixed;
    /* Changed to fixed for better positioning */
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    min-width: 210px;
    padding: 8px 0;
    visibility: hidden;
    display: block;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Add this JavaScript to position the dropdown */
.channel-actions-dropdown.show {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.channel-actions-dropdown button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 16px;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    color: #333;
    height: 40px !important;
    margin: 0 !important;
    transition: background-color 0.2s ease;
}

.channel-actions-dropdown button:hover {
    background: #f8f9fa;
}

.dropdown-section {
    padding: 8px 0;
}

.dropdown-subheader {
    padding: 0 16px 8px;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.dropdown-divider {
    margin: 8px 0;
    border: none;
    border-top: 1px solid #eee;
}

.quality-option {
    display: block;
    width: 100%;
    padding: 8px 16px;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
}

.quality-option:hover {
    background-color: #f5f5f5;
}

/* ========== Alert Styles ========== */
.channel-alert {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #fff !important;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    min-width: 300px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

/* Alert styling */
.channel-alert {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #fff !important;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    min-width: 300px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.channel-alert.show {
    opacity: 1;
    transform: translateY(0);
}

.channel-alert-content {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
}

.channel-alert-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    margin-left: auto;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.channel-alert-close:hover {
    color: #333;
}

.channel-alert-icon {
    flex-shrink: 0;
}

.channel-alert-message {
    flex-grow: 1;
}

.channel-alert-icon {
    margin-right: 12px;
}

.channel-alert-message {
    color: #333;
    font-size: 0.95em;
}

.channel-alert-progress {
    height: 3px;
    background: #e9ecef;
    border-radius: 1.5px;
    overflow: hidden;
}

.channel-alert-progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
    transition: transform 3s linear;
}

.channel-alert.success .channel-alert-progress-bar {
    background: #4CAF50;
}

.channel-alert.error .channel-alert-progress-bar {
    background: #f44336;
}

/* ========== Filter and Search Styles ========== */
.iptv-channels-container,
.iptv-movies-container,
.iptv-series-container {
    --primary-color: #3b82f6;
    --primary-light: rgba(59, 130, 246, 0.1);
    --border-color: #e2e8f0;
    --text-color: #4b5563;
    --background-light: #f9fafb;
}

.iptv-filters-wrapper,
.movies-filters-wrapper,
.series-filters-wrapper {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.iptv-search-container,
.movies-search-container,
.series-search-container {
    position: relative;
    margin-bottom: 24px;
    display: flex;
    align-items: stretch;
    gap: 0;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--background-light);
}

.iptv-search-input,
.movies-search-input,
.series-search-input {
    flex: 1;
    height: 48px;
    padding: 8px 16px;
    border: none !important;
    border-radius: 5px 0 0 5px;
    font-size: 15px;
    transition: all 0.2s ease;
    background-color: transparent;
    line-height: 30px;
    margin-bottom: 0;
}

.search-icon-button {
    padding: 0 16px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-bottom: 0;
}

.search-icon-button:hover {
    background-color: var(--border-color);
}

.search-icon {
    width: 20px;
    height: 20px;
    fill: var(--text-color);
}

.iptv-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    align-items: flex-end;
}

.filter-group {
    position: relative;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #000 !important;
}

.filter-select {
    width: 100%;
    height: 48px;
    /* Match height with search input */
    padding: 8px 40px 8px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background-color: var(--background-light);
    cursor: pointer;
    transition: all 0.2s ease;
    color: #1f2937;
    font-size: 15px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    line-height: 30px;
    /* For vertical centering */
}

.reset-filters {
    height: 48px;
    /* Match height with other inputs */
    padding: 8px 20px;
    background-color: #fff;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-filters:hover {
    background-color: var(--background-light);
    border-color: #d1d5db;
}

.reset-filters:active {
    transform: translateY(1px);
}

.reset-filters svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transition: transform 0.2s ease;
}

.reset-filters:hover svg {
    transform: rotate(45deg);
}

/* Loading state */
.channels-grid.loading,
.movies-grid.loading,
.series-grid.loading,
.channels-list.loading,
.movies-list.loadign,
.series-list.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.channels-grid.loading::after,
.movies-grid.loading::after,
.series-grid.loading::after,
.channels-list.loading::after,
.movies-list.loading::after,
.series-list.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {

    .iptv-filters-wrapper,
    .movies-filters-wrapper,
    .series-filters-wrapper {
        padding: 16px;
    }

    .iptv-filters,
    .movies-filters,
    .series-filters {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .reset-filters {
        width: 100%;
        justify-content: center;
    }

    .filter-select,
    .iptv-search-input {
        padding: 10px 12px;
        font-size: 15px;
    }
}

/* ========== Player Styles ========== */

.channel-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    margin: 40px auto;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.modal-header {
    padding: 15px;
    background: #1a1a1a;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.modal-body {
    position: relative;
    background: #000;
}

#iptv-player {
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    position: relative;
    background: #000;
}

#iptv-player>div {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}


/* Responsive breakpoints */

@media (max-width: 768px) {
    .channels-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .channel-actions-dropdown {
        left: auto;
        right: 0;
        top: 100%;
        transform: none;
        margin-left: 0;
        margin-top: 8px;
    }

    /* Pagination Styles */

    .channels-pagination,
    .movies-pagination,
    .series-pagination {
        gap: 5px;
    }

    .pagination-button {
        padding: 6px 12px;
        font-size: 14px;
    }

    .pagination-numbers {
        order: -1;
        /* Move numbers above buttons */
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }

    .page-number {
        padding: 6px 10px;
        font-size: 14px;
    }

    .pagination-info {
        width: 100%;
        text-align: center;
        order: 1;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .channels-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .channel-card {
        padding: 8px;
        gap: 10px;
    }

    .channel-thumb {
        width: 70px;
        height: 50px;
    }

    .channel-info h3 {
        font-size: 13px;
    }

    /* Pagination styles */

    .channels-pagination,
    .movies-pagination,
    .series-pagination {
        gap: 3px;
    }

    .pagination-button {
        padding: 5px 10px;
        font-size: 13px;
    }

    .first-page,
    .last-page {
        display: none;
        /* Hide first/last on very small screens */
    }

    .page-number {
        padding: 5px 8px;
        font-size: 13px;
    }
}


/* Channel actions positioning */
.channel-header {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    /* For actions positioning */
}

.channel-actions {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
}

.actions-toggle {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    width: auto !important;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.actions-toggle:hover {
    opacity: 1;
}

.channel-actions-dropdown {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    min-width: 210px;
    padding: 8px 0;
    margin-left: 8px;
    visibility: hidden;
}

.channel-actions-dropdown.show {
    visibility: visible;
}

.channel-actions-dropdown button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    color: #333;
    transition: background-color 0.2s ease;
}

.channel-actions-dropdown button:hover {
    background: #f8f9fa;
}

.dropdown-icon {
    flex-shrink: 0;
}

/* Adjust channel info padding to accommodate actions */
.channel-info {
    flex-grow: 1;
    min-width: 0;
    padding-right: 32px;
    /* Make space for actions toggle */
}

/* Make sure the quality badges don't overlap with actions */
.quality-badges {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 4px;
    z-index: 999;
}