/* Videos Page Specific Styles */
/* Note: Common styles (body, header, container, wide-container) are in landing.css */

.section-description {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

/* Filters and Search */
.filter-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-primary);
}

.filter-group input[type="checkbox"] {
    cursor: pointer;
}

.search-container {
    width: -webkit-fill-available;
    position: relative;
    align-items: center;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 3%;
    width: fit-content;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    color: var(--primary-dark);
    font-size: 1.1rem;
    pointer-events: none;
}

.search-input {
    padding: 0.75rem 3.5rem 0.75rem 3rem;
    border-radius: 30px;
    border: 2px solid var(--primary-dark);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    max-width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px var(--shadow-primary);
}

.clear-search {
    position: absolute;
    right: 1rem;
    top: 22%;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.25rem;
    display: none;
    transition: all 0.2s ease;
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.clear-search:hover {
    color: var(--primary-color);
    background: var(--shadow-primary);
}

.clear-search.visible {
    display: block;
}

.search-results {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    display: none;
    animation: fadeIn 0.3s ease;
}

.search-results.visible {
    display: inline-block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.view-toggle {
    margin-left: auto;
}

.view-toggle button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: var(--gradient-button);
    color: #fff;
    font-weight: 600;
    margin-left: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px var(--shadow-primary);
}

.view-toggle button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--shadow-primary);
    background: var(--gradient-button-hover);
}

.view-toggle button:active {
    transform: translateY(0);
}

/* Loading and No Results */
.loading {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: 0 4px 12px var(--shadow-light);
    margin: 2rem 0;
}

.no-results::before {
    content: "🔍";
    display: block;
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Video Card and Grid */
.category-section {
    margin-bottom: 2rem;
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    background: var(--bg-secondary);
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-light);
    transition: box-shadow 0.3s ease;
}

.category-section:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.category-title {
    font-weight: 600;
    font-size: 1.25rem;
    margin: 0;
    padding: 1rem 1.5rem;
    cursor: pointer;
    background: var(--gradient-card);
    color: var(--text-primary);
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-primary);
}

/* Make the category title sticky */
.category-title {
    position: sticky;
    top: 0; /* Distance from the top when the element sticks */
    z-index: 10; /* Ensures it stays above other content */
}

/* Optional: add some padding or background to avoid overlap */
.videos-grid {
    padding-top: 30px; /* Adds some space above the sticky title */
}

.category-title:hover {
    background: var(--gradient-cta);
    padding-left: 1.75rem;
}

.category-title::after {
    content: "▼";
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.category-title.collapsed::after {
    transform: rotate(-90deg);
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    padding: 0.5rem 1rem;
}

.video-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.video-card {
    z-index: 10;
    background: var(--bg-primary);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow-light);
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-primary);
}

.video-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px var(--shadow-medium), 0 2px 8px var(--shadow-light);
    border-color: var(--primary-color);
}

.video-card.iframe-card iframe,
.video-card.iframe-card .video-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
}

.video-thumbnail {
    position: relative;
    cursor: pointer;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.video-thumbnail::after {
    content: '';
    position: absolute;
    width: 68px;
    height: 48px;
    background: rgba(255, 0, 0, 0.9);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.video-thumbnail::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 20px;
    border-color: transparent transparent transparent white;
    z-index: 1;
    margin-left: 4px;
    transition: all 0.2s ease;
}

.video-thumbnail:hover::after {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

.video-thumbnail:hover::before {
    transform: scale(1.1);
}

.video-card.list-card {
    flex-direction: row;
    align-items: flex-start;
    padding: 0.5rem;
}

.video-card.list-card iframe,
.video-card.list-card .video-thumbnail {
    width: 200px;
    aspect-ratio: 16/9;
    margin-right: 0.5rem;
}

.video-content {
    padding: 0.75rem 0;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.video-title {
    font-weight: 600;
    font-size: 1.05rem;
    margin: 0.5rem 1rem;
    color: var(--text-primary);
    line-height: 1.4;
    transition: color 0.2s ease;
}

.video-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.video-title a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.video-card:hover .video-title a {
    color: var(--primary-color);
}

.highlight {
    background: var(--highlight-bg);
    color: var(--highlight-text);
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 700;
}

.video-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    margin: 0 1rem;
}

.video-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.5rem 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.video-description.expanded {
    -webkit-line-clamp: unset;
    line-clamp: unset;
}

.show-more {
    font-size: 0.8rem;
    color: var(--primary-color);
    cursor: pointer;
    margin: 0.25rem 1rem 1rem;
    align-self: flex-start;
    user-select: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.show-more:hover {
    color: var(--primary-dark);
    transform: translateX(4px);
}

.video-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0.5rem 1rem 1rem;
}

.reason-tag {
    background: var(--gradient-card);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid var(--border-secondary);
    transition: all 0.2s ease;
}

.reason-tag:hover {
    background: var(--gradient-button);
    transform: scale(1.05);
}

/* Responsive Design Enhancements */
@media (max-width: 896px) {
    
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .video-card.list-card {
        flex-direction: column;
    }

}
