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

/* 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;
} 

/* Dynamic text overlay */
.dyn_text_overlay{
    /* 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;
}
