/* videos.css */

/* Container for all video cards */
#output {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    padding: 20px;
    max-width: 1160px; /* Fits exactly 4 videos (260px each) with gaps */
    margin-left: auto;
    margin-right: auto;
}

.video-info {
    width: 260px;
    flex: 0 0 calc(25% - 15px); /* 25% for 4 per row with gap compensation */
    max-width: 260px;
    border: 2px solid #000;
    border-radius: 10px;
    overflow: hidden;
    background-color: #fff;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.video-container {
    position: relative;
    width: 100%;
    padding-top: 177.778%; /* 16:9 ratio */
    overflow: hidden;
    cursor: pointer;
}

.video-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Header and Date Section */
.date-info {
    padding: 10px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Delete Button */
.delete-button {
    position: absolute;
    left: 10px;
    width: 26px;
    height: 26px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    z-index: 1;
}

.delete-button:hover {
    opacity: 1;
}

.delete-button svg,
.delete-button svg path,
.delete-button svg g {
    fill: black !important;
}

/* Text for fallback if not in progress */
.fallback-text {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #5850EC;
    font-weight: bold;
    text-align: center;
}

/* Play Button Overlay */
.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.play-button {
    width: 90px;
    height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateX(10px);
}

.play-button svg {
    width: 90px;
    height: 90px;
    fill: white;
    transition: transform 0.2s ease;
}

.video-container:hover .play-button svg {
    transform: scale(1.2);
}

.in-progress-text {
    padding: 10px;
    background-color: #f8f9fa;
    font-weight: bold;
    color: #5850EC;
}

.lottie-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
}

/* Button Container */
.button-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    width: 100%;
}

/* Base Button Styles */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-weight: 500;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border-radius: 8px;
    width: calc(50% - 4px);
    color: #fff;
}

.button svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Download button and Edit button styles */
.download-btn, .edit-btn-purple {
    background-color: #5850EC;
}

.download-btn:hover, .edit-btn-purple:hover {
    background-color: rgba(88, 80, 236, 0.85);
}

/* Disabled Edit Button */
.edit-btn-purple.disabled {
    background-color: #9CA3AF;
    cursor: not-allowed;
    position: relative;
}

.edit-btn-purple.disabled:hover {
    background-color: #9CA3AF;
}

/* Tooltip for not-eligible videos */
.coming-soon-tooltip {
    position: absolute;
    top: -58px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1F2937;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: normal;
    max-width: 180px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    line-height: 1.2;
}

.coming-soon-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #1F2937 transparent transparent transparent;
}

.edit-btn-purple.disabled:hover .coming-soon-tooltip {
    opacity: 1;
}

/* No Videos Message */
#noVideosMessage {
    width: 100%;
    text-align: center;
    font-size: 24px;
    color: #333;
    margin-top: 50px;
}

#lottieContainer {
    width: 450px;
    height: 450px;
    max-width: 100%;
    margin: 0 auto;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto 40px;
    max-width: 1160px;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(88, 80, 236, 0.1);
    background-color: white;
    border: 1px solid rgba(88, 80, 236, 0.2);
}

.pagination-button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    background-color: transparent;
    border: none;
    color: #091747;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.pagination-button:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background-color: rgba(88, 80, 236, 0.2);
}

.pagination-button:hover {
    background-color: #f4f5f7;
    color: #5850EC;
}

.pagination-button.active {
    background-color: #5850EC;
    color: white;
}

.pagination-button.active:hover {
    background-color: #5850EC;
}

.pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-button svg {
    width: 18px;
    height: 18px;
}

.pagination-info {
    margin: 0 15px;
    color: #091747;
    font-size: 14px;
    font-weight: 500;
}

.pagination-page-size {
    display: flex;
    align-items: center;
    margin-left: 15px;
    border-radius: 10px;
    overflow: hidden;
    background-color: white;
    border: 1px solid rgba(88, 80, 236, 0.2);
    box-shadow: 0 2px 10px rgba(88, 80, 236, 0.1);
}

.page-size-label {
    padding: 0 10px;
    font-size: 14px;
    color: #091747;
}

.page-size-select {
    height: 40px;
    padding: 0 10px;
    border: none;
    border-left: 1px solid rgba(88, 80, 236, 0.2);
    background-color: transparent;
    color: #5850EC;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235850EC' 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 10px center;
    background-size: 12px;
    padding-right: 30px;
}

/* Responsive adjustments for different screen sizes */
@media (max-width: 1120px) {
    .video-info {
        flex: 0 0 calc(33.333% - 15px); /* 3 items per row */
    }
}

@media (max-width: 840px) {
    .video-info {
        flex: 0 0 calc(50% - 15px); /* 2 items per row */
    }
    
    .pagination {
        flex-wrap: wrap;
    }
    
    .pagination-page-size {
        margin-top: 10px;
        margin-left: 0;
    }
}

@media (max-width: 560px) {
    .video-info {
        flex: 0 0 100%; /* 1 item per row for mobile */
        max-width: 100%;
    }
    
    .pagination-container {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .pagination-info {
        margin: 10px 0;
    }
}

@media (max-width: 470px) {
    #noVideosMessage {
        white-space: normal;
        width: 350px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .pagination-button {
        min-width: 36px;
        height: 36px;
    }
}