/* Library Page Specific Styles (History, Watch Later, Liked, Downloads) */

.library-container {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.library-container h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 30px;
}

.library-content-grid {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Library Sidebar (Filters and Actions) */
.library-sidebar {
    width: 280px;
    flex-shrink: 0;
    padding: 15px;
    background: var(--secondary-dark);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.sidebar-section {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sidebar-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-pink);
    margin-bottom: 15px;
}

.sidebar-action-btn {
    width: 100%;
    text-align: left;
    background: var(--primary-dark);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.sidebar-action-btn:hover {
    background: var(--hover-color);
    border-color: var(--primary-pink);
    color: var(--text-primary);
}

.sidebar-action-btn.btn-danger {
    color: #ff4444;
    border-color: #ff4444;
}

.sidebar-action-btn.btn-danger:hover {
    background: #440000;
}

.sidebar-action-btn.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

/* Library List Section */
.library-list-section {
    flex-grow: 1;
    min-width: 0;
}

.list-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

#resultsSummary {
    font-size: 16px;
    color: var(--text-muted);
}

/* Video List Styling (Horizontal Layout - Preferred for Library) */
.library-video-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.library-video-card {
    display: flex;
    gap: 20px;
    padding: 15px;
    background: var(--secondary-dark);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.library-video-card:hover {
    background: var(--hover-color);
}

.library-video-thumbnail {
    width: 240px;
    height: 135px; /* 16:9 ratio */
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: var(--primary-dark);
}

.library-video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.library-video-details {
    flex-grow: 1;
}

.library-video-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.library-video-channel, .library-video-meta {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.library-video-meta {
    color: var(--text-muted);
}

.library-video-description {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 10px;
    max-height: 3em;
    overflow: hidden;
}

.remove-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: color 0.3s;
}

.remove-btn:hover {
    color: var(--primary-red);
    background: rgba(255, 0, 85, 0.1);
}

/* Empty State (Reusing home/subscriptions styles) */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    display: none;
    background: var(--secondary-dark);
    border-radius: 12px;
    margin-top: 40px;
    border: 1px solid var(--border-color);
}

.empty-state.active {
    display: block;
}

.empty-state i {
    font-size: 60px;
    color: var(--primary-pink);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 992px) {
    .library-content-grid {
        flex-direction: column;
    }
    
    .library-sidebar {
        width: 100%;
        order: -1;
    }

    .library-video-card {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .library-video-thumbnail {
        width: 100%;
        height: 200px;
    }

    .library-video-details {
        min-width: 0;
    }
}