/* Modern Transcript Container - Window Style with Drag and Resize */
#transcriptcontainer {
    position: fixed;
    bottom: 100px;
    left: 50%;
    display:none;
    transform: translateX(-50%);
    width: 500px;
    min-width: 300px;
    max-width: 90vw;
    background: white;
    border-radius: 15px;
    z-index: -1;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    min-height: 120px;
    resize: both;
    overflow: hidden;
}

#transcriptcontainer.active {
    z-index: 999999;
}

/* Drag Bar Header */
#transcriptDragBar {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    padding: 12px 15px;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    -webkit-user-select: none;
    border-radius: 15px 15px 0 0;
    position: relative;
}

#transcriptDragBar:active {
    cursor: grabbing;
}

/* Content Area */
#transcriptContent {
    padding: 15px 20px;
    min-height: 80px;
    height: calc(100% - 50px);
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 0 0 15px 15px;
}

/* Transcript Text */
#transcript {
    color: white;
    font-size: 18px;
    line-height: 1.6;
    white-space: pre-wrap;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: block;
}

/* Status Text */
#status {
    color: #60a5fa;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: block;
}

/* Language Selector - use fixed positioning to escape container overflow:hidden */
#languageselector {
    position: relative;
    display: flex;
    align-items: center;
    height: auto;
}

#selectedLanguageselected {
    cursor: pointer;
    padding: 4px 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 6px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
}

#selectedLanguageselected:hover {
    background: rgba(255,255,255,0.3);
}

/* Language dropdown - positioned fixed to escape container clipping */
#selectLanguageItems {
    position: fixed !important;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-height: 300px;
    overflow-y: auto;
    min-width: 60px;
    padding: 8px;
    z-index: 99999999999999 !important;
}

#selectLanguageItems div {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#selectLanguageItems div:hover {
    background: #f3f4f6;
}

/* Flag icon sizing */
#selectLanguageItems .flag-icon,
#selectedLanguageselected .flag-icon {
    width: 24px;
    height: 18px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: inline-block;
}

/* Resize Handle - visual indicator */
#transcriptResizeHandle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, rgba(59, 130, 246, 0.5) 50%);
    border-bottom-right-radius: 15px;
    pointer-events: none;
}

/* Close Button Hover Effect */
#closeTranscript:hover {
    background: rgba(255,255,255,0.3) !important;
}

/* Scrollbar Styling for Content */
#transcriptContent::-webkit-scrollbar {
    width: 6px;
}

#transcriptContent::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

#transcriptContent::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

#transcriptContent::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* Scrollbar for language selector */
#selectLanguageItems::-webkit-scrollbar {
    width: 6px;
}

#selectLanguageItems::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#selectLanguageItems::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#selectLanguageItems::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Responsive Adjustments */
@media only screen and (max-width: 600px) {
    #transcriptcontainer {
        width: 95vw;
        left: 2.5vw;
        transform: none;
        bottom: 80px;
    }
    
    #transcript {
        font-size: 16px;
    }
    
    #selectLanguageItems {
        max-height: 200px;
    }
}
