/* Custom Video Player Styles */
.cvp-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}
.cvp-card {
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex; /* Use flexbox for better content structure */
    flex-direction: column; /* Stack content vertically */
}
.cvp-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}
.cvp-card-thumbnail {
    position: relative;
}
.cvp-card-thumbnail img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}
.cvp-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: background-color 0.2s;
}
.cvp-card:hover .cvp-play-icon {
    background-color: rgba(255, 255, 255, 1);
}
.cvp-play-icon::after {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent #333;
    margin-left: 5px;
}
.cvp-card-content {
    padding: 1.25rem;
    flex-grow: 1; /* Allow content to fill available space */
    display: flex;
    flex-direction: column;
}
.cvp-card-title {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}
.cvp-card-description {
    color: #4A5568;
    font-size: 0.9rem;
    margin-top: auto; /* Push description to the bottom */
}

/* Modal Styles */
body.cvp-modal-open {
    overflow: hidden;
}
.cvp-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    padding: 1rem;
}
.cvp-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.cvp-modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
}
.cvp-modal-top-bar {
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.cvp-modal-close {
    background: transparent;
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    color: #333;
    padding: 0;
}
.cvp-subscribe-img-modal {
    height: 50px;
    width: auto;
    display: block;
    cursor: pointer;
}
.cvp-video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
}
.cvp-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Styles for the floated video on single posts */
.cvp-single-video-floated {
    float: left !important;
    width: 33.33% !important;
    max-width: 400px !important;
    margin-right: 1.5em !important;
    margin-bottom: 1em !important;
}

/* Responsive styles for the floated video */
@media (max-width: 768px) {
    .cvp-single-video-floated {
        float: none !important; /* Use important here too just in case */
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 1.5em !important;
    }
}

.cvp-modal-header {
    margin-bottom: 1rem;
}
.cvp-modal-title {
    font-size: 1.5rem;
    margin: 0;
    color: #1a202c;
}
.cvp-modal-description {
    margin-top: 1.5rem;
    color: #4a5568;
    line-height: 1.6;
    max-height: 20vh;
    overflow-y: auto;
}
.cvp-modal-description p:first-child {
    margin-top: 0;
}
.cvp-modal-description p:last-child {
    margin-bottom: 0;
}

/* Categories Styles */
.cvp-card-categories {
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
}
.cvp-card-categories a {
    color: #a987c2;
    text-decoration: none;
    background-color: #faf7fd;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    transition: background-color 0.2s;
}
.cvp-card-categories a:hover {
    background-color: #f4eff8;
    text-decoration: underline;
}