:root {
    --atv-bg-dark: transparent;
    --atv-bg-card: #1e1e1e;
    --atv-text-main: #ffffff;
    --atv-text-secondary: #aaaaaa;
    --atv-accent: #f00;
    --atv-radius: 12px;
    --atv-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.atv-gallery-container.dark-theme {
    background: var(--atv-bg-dark);
    color: var(--atv-text-main);
    padding: 40px 20px;
    font-family: 'Roboto', sans-serif;
}

/* Category Tabs (Chips) */
.atv-tabs-container {
    padding: 10px 0 20px 0;
    position: sticky;
    top: 0;
    background: var(--atv-bg-dark);
    z-index: 100;
}

.atv-tabs-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 5px 0;
}

.atv-tabs-scroll::-webkit-scrollbar {
    display: none;
}

.atv-tab {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--atv-transition);
}

.atv-tab:hover {
    background: rgba(255,255,255,0.2);
}

.atv-tab.active {
    background: #fff;
    color: #000;
}

/* Gallery Layout */
.atv-gallery-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.atv-main-content {
    flex-grow: 1;
    min-width: 0;
}

.atv-sidebar {
    width: 350px;
    flex-shrink: 0;
}

.atv-sidebar-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: var(--atv-text-main);
}

.atv-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.atv-sidebar-item {
    display: flex;
    gap: 12px;
    cursor: pointer;
}

.atv-sidebar-thumb {
    width: 140px;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.atv-sidebar-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.atv-sidebar-info {
    min-width: 0;
}

.atv-sidebar-info h4 {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
}

.atv-sidebar-info p {
    font-size: 12px;
    color: var(--atv-text-secondary);
    margin: 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .atv-gallery-layout {
        flex-direction: column;
    }
    .atv-sidebar {
        width: 100%;
    }
}

/* Unified Video Grid */
.atv-video-grid-unified {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding-top: 20px;
}

.atv-video-card {
    cursor: pointer;
    transition: var(--atv-transition);
}

.atv-video-card.hidden {
    display: none;
}

.atv-video-thumb-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--atv-radius);
    overflow: hidden;
    background: #000;
}

.atv-video-thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--atv-transition);
}

.atv-video-card:hover .atv-video-thumb-wrapper img {
    transform: scale(1.05);
}

.atv-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--atv-transition);
    overflow: hidden;
}

.atv-video-card:hover .atv-play-overlay {
    opacity: 1;
}

.play-icon-container {
    position: relative;
    z-index: 2;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.5));
}

.atv-video-card:hover .play-icon-container {
    transform: scale(1.1);
}

.atv-sidebar-thumb {
    position: relative;
}

.atv-sidebar-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--atv-transition);
}

.atv-sidebar-item:hover .atv-sidebar-play-overlay {
    opacity: 1;
}

.atv-video-info-new {
    display: flex;
    gap: 12px;
    padding-top: 12px;
}

.atv-channel-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    margin-top: 4px;
}

.atv-channel-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.atv-meta-content {
    flex-grow: 1;
}

.atv-video-title {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    color: var(--atv-text-main);
}

.atv-channel-name, .atv-video-meta {
    font-size: 12px;
    color: var(--atv-text-secondary);
    margin: 0 0 2px 0;
}

.atv-video-meta {
    display: flex;
    align-items: center;
}

/* Modal Styling */
.atv-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    backdrop-filter: blur(10px);
}

.atv-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 40px;
    box-sizing: border-box;
    overflow-y: auto;
}

.atv-close {
    position: fixed;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100001;
}

/* Player Styles */
.atv-player-container {
    max-width: 1000px;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--atv-radius);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

#atv-main-player {
    width: 100%;
    height: 100%;
}

.atv-video-details {
    max-width: 1000px;
    margin: 20px auto;
    color: #fff;
}

.atv-video-details h1 {
    font-size: 24px;
    margin-bottom: 10px;
}

.atv-video-details p {
    color: var(--atv-text-secondary);
    font-size: 16px;
    line-height: 1.6;
}

/* Related Slider */
.atv-related-slider-container {
    max-width: 1000px;
    margin: 40px auto;
}

.atv-related-slider {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--atv-accent) transparent;
}

.atv-related-item {
    min-width: 200px;
    cursor: pointer;
}

.atv-related-item img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 8px;
}

.atv-related-item h4 {
    font-size: 14px;
    margin: 8px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Fullscreen Category Grid */
.atv-grid-large {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 60px 0;
    max-width: 1400px;
    margin: 0 auto;
}

.atv-grid-large .atv-video-card {
    min-width: unset; /* Override row styling */
}

.atv-category-modal-header {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    max-width: 1400px;
    margin: 0 auto;
}

.atv-category-modal-header h2 {
    font-size: 32px;
    color: #fff;
    margin: 0;
}
