/**
 * CM Media Player - CSS Styles
 */

 /* DEBUGGING ONLY */
 .dyn_text_overlay{
    border: 1px solid red !important;
}


/* Inner span wrapper for text - allows font-size cqi to measure from parent */
.dyn-text-inner {
    display: inline-block;
}

/* YouTube Player */
.cm-modal-youtube {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.cm-panel-container{
   container-type: inline-size;
}
.cm-modal-header{
    font-size: 2cqi;
}
.cm-modal-youtube .cm-modal-header {
    flex: 0 0 auto;
    position: absolute;
    padding: .5em;
    z-index: 2;
    border: none;
    color: #d2c9c9;
    width: auto;
    margin-right: auto;
    margin-left: auto;
    background: rgba(255, 0, 0, 0.18);
    bottom: 5.5em;
}

.cm-modal-youtube .cm-modal-content {
    padding: 0 !important;
    margin: 0 !important;
    background: #000 !important;
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.cm-youtube-container {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    height: 100% !important;
    overflow: hidden !important;
}

.cm-youtube-wrapper {
    position: relative !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    width: 100% !important;
    aspect-ratio: 16/9 !important;
}

.cm-youtube-wrapper iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

/* Maintain aspect ratio but allow for height constraints */
@media (max-height: 600px) {
    .cm-modal-youtube .cm-modal-header {
        padding: 5px 10px !important;
        font-size: 14px !important;
    }
}

/* Document Viewer */
.cm-modal-document .cm-modal-content {
    padding: 0;
}

.cm-document-viewer {
    min-height: 60vh;
    max-height: 75vh;
    width: 100%;
}

.cm-modal-document iframe {
    border: none;
    width: 100%;
    height: 100%;
    min-height: 60vh;
}

.cm-unsupported-document {
    padding: 20px;
    text-align: center;
}

.cm-document-download {
    display: inline-block;
    padding: 10px 15px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    margin-top: 10px;
}

.cm-document-download:hover {
    background: #005580;
    color: #fff;
}

/* Audio Player */
.cm-modal-audio .cm-modal-content {
    padding: 20px;
}

.cm-audio-player-wrapper {
    width: 100%;
    padding: 10px 0;
}

.cm-audio-player {
    width: 100%;
    margin-bottom: 10px;
}

.cm-audio-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-top: 1px solid #eee;
}

.cm-audio-filename {
    margin: 0;
    font-weight: bold;
    color: #444;
}

.cm-audio-download {
    color: #0073aa;
    text-decoration: none;
}

.cm-audio-download:hover {
    text-decoration: underline;
}

/* URL/Webpage Embeds */
.cm-modal-urlembed .cm-modal-content {
    padding: 0;
}

.cm-webpage-iframe-wrapper {
    position: relative;
    width: 100%;
    min-height: 70vh;
    max-height: 80vh;
}

.cm-webpage-iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    min-height: 70vh;
    border: none;
}

.cm-webpage-specialized {
    width: 100%;
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    padding: 15px;
}

/* Error Messages */
.cm-modal-error {
    padding: 15px;
    margin: 10px;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #b82a38;
    border-radius: 4px;
}

/* Video Play Icon Overlay */
.cm-video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    background-color: rgba(177, 33, 33, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.cm-video-play-icon:hover {
    background-color: rgba(255, 0, 0, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
}

/* Play triangle using CSS borders */
.cm-video-play-icon::before {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent #ffffff;
    margin-left: 4px; /* Optical centering */
}
/* Smaller play icon for lightbox thumbnails */
.cm-lightbox-thumbnail .cm-video-play-icon{
    width: 25px;
    height: 25px;
}

/* Smaller play triangle for lightbox thumbnails */
.cm-lightbox-thumbnail .cm-video-play-icon::before {
    border-width: 5px 0 5px 8px;
    margin-left: 2px;
}

.cm-lightbox-thumbnail .cm-video-play-icon:hover{
    transform: translate(-50%, -50%) scale(1.1);
}

/* Dynamic text overlay */
.dyn_text_overlay{
    container-type: inline-size;
    /* so its visible be it a light or dark background 
       expected to be changed by the user */
    color: #808080;
    /* Text elements need z-index to appear above images */
    z-index: 10;
    /* make visible after animations run */
    opacity: 0;
}

/* Text content areas - common styling */
.text-top-content,
.text-bottom-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}
.cm-panel-effects .dyn_text_overlay{
}
/* Text elements within top/bottom content areas */
.text-top-content .dyn_text_overlay,
.text-bottom-content .dyn_text_overlay { 
    position: relative !important; /* Override absolute positioning */
    display: block;
    width: auto;
    max-width: 100%;
    transform: none !important; /* Remove any positioning transforms */
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
}
