/**
 * Video Gallery Styles
 */

/* Gallery Layout */
.video-gallery-container {
    display: flex;
    gap: 30px;
    margin: 20px 0;
}

.gallery-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.gallery-main {
    flex: 1;
}

/* Filter Sections */
.filter-section {
    margin-bottom: 25px;
    background: #fff;
    border-radius: 4px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.filter-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 16px;
}

/* Barber Filter */
.barber-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.barber-list li {
    margin-bottom: 8px;
}

.barber-list li a {
    display: block;
    padding: 6px 10px;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
}

.barber-list li a:hover {
    background-color: #f0f0f0;
}

.barber-list li.active a {
    background-color: #d0a84a;
    color: #fff;
    font-weight: bold;
}

/* Sort Options */
.sort-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sort-option {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.sort-option:hover {
    background-color: #f0f0f0;
}

.sort-option.active {
    background-color: #f0f0f0;
    font-weight: bold;
}

.sort-option input {
    margin-right: 10px;
}

/* Gallery Header */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.result-count {
    color: #666;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-link {
    display: inline-block;
    padding: 5px 10px;
    background-color: #f0f0f0;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
}

.page-link:hover {
    background-color: #d0a84a;
    color: #fff;
}

.page-link.current {
    background-color: #d0a84a;
    color: #fff;
    font-weight: bold;
}

.pagination-ellipsis {
    color: #999;
}

.pagination-bottom {
    margin-top: 30px;
    justify-content: center;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.video-grid.small-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* Video Items */
.video-item {
    background-color: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.video-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Video Thumbnails */
.video-thumbnail-container {
    position: relative;
    aspect-ratio: 16/9;
    background-color: #000;
    overflow: hidden;
}

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

.video-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.placeholder-youtube {
    background-color: #FF0000;
}

.placeholder-tiktok {
    background-color: #000000;
}

.placeholder-instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.placeholder-other {
    background-color: #6c757d;
}

/* Play Button Overlay */
.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.video-thumbnail-container:hover .video-play-overlay {
    opacity: 1;
}

.video-play-button {
    width: 60px;
    height: 60px;
    background-color: rgba(0,0,0,0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.8);
    transition: transform 0.2s;
}

.video-play-button::before {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 20px;
    border-color: transparent transparent transparent #ffffff;
    margin-left: 5px;
}

.video-thumbnail-container:hover .video-play-button {
    transform: scale(1);
}

/* Video Info */
.video-info {
    padding: 15px;
}

.video-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.3;
    height: 42px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.video-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.video-barber-info {
    display: flex;
    align-items: center;
    margin-top: 10px;
    font-size: 14px;
}

.video-barber-name {
    font-weight: bold;
}

/* Tag Styling */
.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
}

.tag:hover {
    background-color: #d0a84a;
    color: #fff;
}

.tag.hair_type {
    background-color: #e3f2fd;
    color: #0d47a1;
}

.tag.cut_style {
    background-color: #e8f5e9;
    color: #1b5e20;
}

.tag.color {
    background-color: #fff3e0;
    color: #e65100;
}

.tag.gender {
    background-color: #f3e5f5;
    color: #6a1b9a;
}

/* Empty State */
.empty-gallery {
    text-align: center;
    padding: 50px 20px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.empty-gallery p {
    margin-bottom: 20px;
    color: #666;
}

/* Single Video View */
.single-video-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.video-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    margin-bottom: 30px;
}

.video-embed iframe,
.video-embed object,
.video-embed embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-details {
    margin-bottom: 40px;
}

.video-details .video-title {
    font-size: 24px;
    margin-bottom: 15px;
    height: auto;
}

.video-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: #666;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.barber-info a {
    color: #d0a84a;
    text-decoration: none;
}

.barber-info a:hover {
    text-decoration: underline;
}

.video-details .video-description {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 1.6;
    height: auto;
    display: block;
}

.video-details .video-tags {
    margin-bottom: 20px;
}

.video-details .video-tags h3 {
    margin-bottom: 10px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.video-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #d0a84a;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
}

.button:hover {
    background-color: #b89139;
}

.more-videos {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.more-videos h2 {
    margin-bottom: 20px;
}

/* Video Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal.open {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    cursor: pointer;
}

.modal-container {
    position: relative;
    width: 90%;
    max-width: 1100px;
    max-height: 90%;
    margin: 5% auto;
    background-color: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background-color: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 20px;
    line-height: 30px;
    text-align: center;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}

.modal-content {
    height: 100%;
    overflow-y: auto;
}

.video-embed-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
}

.video-embed-container iframe,
.video-embed-container object,
.video-embed-container embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.modal-info {
    padding: 20px;
}

.modal-info .video-title {
    font-size: 20px;
    margin-bottom: 10px;
    height: auto;
}

.modal-info .video-description {
    margin-bottom: 15px;
    display: block;
    height: auto;
}

.barber-info {
    margin-bottom: 15px;
}

.barber-name {
    font-weight: bold;
    margin-right: 10px;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .video-gallery-container {
        flex-direction: column;
    }
    
    .gallery-sidebar {
        width: 100%;
    }
    
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .gallery-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .modal-container {
        width: 95%;
        margin: 2.5% auto;
    }
}

@media (max-width: 600px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .video-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .video-actions {
        flex-direction: column;
    }
    
    .button {
        width: 100%;
        text-align: center;
    }
    
    .modal-container {
        width: 100%;
        height: 100%;
        max-height: 100%;
        margin: 0;
        border-radius: 0;
    }
}