/**
 * Public styles for the Mad-RVD plugin
 *
 * @since      1.0.0
 * @package    Mad_RVD
 */

/* Video Dashboard */
.mad-rvd-video-dashboard {
    margin-bottom: 40px;
}

/* Category Navigation */
.mad-rvd-categories {
    margin-bottom: 30px;
}

.mad-rvd-category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.mad-rvd-category-nav li a {
    display: inline-block;
    padding: 8px 15px;
    background-color: #f7f7f7;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
}

.mad-rvd-category-nav li a:hover {
    background-color: #e6e6e6;
}

.mad-rvd-category-nav li.active a {
    background-color: #2271b1;
    color: #fff;
}

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

.mad-rvd-video-grid[data-columns="1"] {
    grid-template-columns: 1fr;
}

.mad-rvd-video-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.mad-rvd-video-grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.mad-rvd-video-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.mad-rvd-video-grid[data-columns="5"] {
    grid-template-columns: repeat(5, 1fr);
}

.mad-rvd-video-grid[data-columns="6"] {
    grid-template-columns: repeat(6, 1fr);
}

/* Video Card */
.mad-rvd-video-card {
    background-color: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mad-rvd-video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.mad-rvd-video-thumbnail {
    position: relative;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
    background-color: #f0f0f0;
    width: 100%;
    display: block;
}

.mad-rvd-video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
    display: block;
}

.mad-rvd-video-thumbnail .mad-rvd-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mad-rvd-video-card:hover .mad-rvd-video-thumbnail img {
    transform: scale(1.05);
}

.mad-rvd-video-play-button {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0.8;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

.mad-rvd-video-card:hover .mad-rvd-video-play-button {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.8);
}

.mad-rvd-video-play-button svg {
    width: 24px;
    height: 24px;
}

.mad-rvd-video-info {
    padding: 15px;
}

.mad-rvd-video-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
    line-height: 1.3;
}

.mad-rvd-video-title button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: #333;
    cursor: pointer;
    text-align: left;
    transition: color 0.2s ease;
}

.mad-rvd-video-title button:hover {
    color: #2271b1;
}

.mad-rvd-video-category {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.mad-rvd-video-description {
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}

.mad-rvd-open-video {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    display: block;
}

/* Video Modal */
.mad-rvd-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    overflow: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mad-rvd-modal.active {
    display: block;
    opacity: 1;
}

.mad-rvd-modal-content {
    position: relative;
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    width: 90%;
    max-width: 900px;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.mad-rvd-modal-close {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    z-index: 10;
}

.mad-rvd-modal-close:hover {
    color: #333;
}

.mad-rvd-modal-header {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mad-rvd-modal-header h3 {
    margin: 0;
    flex: 1;
}

.mad-rvd-video-wrapper {
    position: relative;
    min-height: 490px;
    overflow: hidden;
}

#mad-rvd-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#mad-rvd-video-container iframe,
#mad-rvd-video-container video {
    width: 100%;
    height: 100%;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .mad-rvd-video-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
    }
    
    .mad-rvd-modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

@media screen and (max-width: 480px) {
    .mad-rvd-video-grid {
        grid-template-columns: 1fr !important;
    }
    
    .mad-rvd-category-nav {
        flex-direction: column;
        gap: 5px;
    }
    
    .mad-rvd-modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 15px;
    }
}
