/*--------------------------------------------------------------
# Caption Grid Participant
# Styles for caption as a video grid participant (like Google Meet notetaker)
# Uses existing .Camera class from videoGrid.css - DRY principle
# SIMPLE APPROACH: caption fills its container naturally, just like a video does
--------------------------------------------------------------*/

/* When caption-draggable is inside the grid, override draggable modal styles completely */
.Camera .caption-draggable {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    resize: none !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
}

/* The caption section fills its container and uses flexbox for internal layout */
.Camera .caption {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 10px;
}

/* Caption header - matches video navbar style with flexbox layout */
.Camera .caption-header {
    z-index: 8;
    position: relative;
    width: 100%;
    background: var(--navbar-bg);
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    box-sizing: border-box;
    cursor: default !important;
}

/* Hide pin and ghost theme buttons - not applicable in grid mode */
.Camera .caption-header #captionTogglePin,
.Camera .caption-header #captionTheme {
    display: none !important;
}

/* Caption header title on left side */
.Camera .caption-header-title {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

/* Caption header options on right side */
.Camera .caption-header-options {
    display: flex;
    align-items: center;
    gap: 2px;
    padding-right: 5px;
}

.Camera .caption-header button {
    padding: 8px;
    font-size: small;
    text-decoration: none;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #fff;
}

.Camera .caption-header button:hover {
    color: var(--hover-color);
    cursor: pointer;
}

.Camera .caption-header-title i {
    font-size: 14px;
    color: #4CAF50;
}

/* Caption chat area - scrollable middle section */
.Camera .caption-chat {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    color: #fff;
    font-size: 14px;
    line-height: 1.5;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    min-height: 0;
}

.Camera .caption-chat::-webkit-scrollbar {
    width: 6px;
}

.Camera .caption-chat::-webkit-scrollbar-track {
    background: transparent;
}

.Camera .caption-chat::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.Camera .caption-chat::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Caption message styling */
.Camera .caption-chat .caption-msg {
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border-left: 3px solid #4CAF50;
    animation: fadeInCaption 0.3s ease;
}

/* Caption input area - controls at bottom */
.Camera .caption-inputarea {
    flex-shrink: 0;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.85);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    border-radius: 0 0 10px 10px;
}

.Camera .caption-inputarea select {
    flex: 1;
    min-width: 120px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.Camera .caption-inputarea select:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.Camera .caption-inputarea select:focus {
    outline: none;
    border-color: #4CAF50;
    background: rgba(255, 255, 255, 0.15);
}

.Camera .caption-inputarea select option {
    background: #2c3e50;
    color: #fff;
}

.Camera .caption-inputarea button {
    padding: 6px 12px;
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.4);
    border-radius: 5px;
    color: #4CAF50;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.Camera .caption-inputarea button:hover {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.6);
    transform: translateY(-1px);
}

.Camera .caption-inputarea button:active {
    transform: translateY(0);
}

.Camera .caption-inputarea button i {
    font-size: 11px;
}

/* Mobile responsive adjustments */
@media screen and (max-width: 768px) {
    .Camera .caption-header-title {
        font-size: 11px;
        left: 8px;
    }

    .Camera .caption-header-title i {
        font-size: 12px;
    }

    .Camera .caption-chat {
        padding: 10px;
        font-size: 12px;
    }

    .Camera .caption-chat .caption-msg {
        padding: 6px 10px;
        margin-bottom: 10px;
    }

    .Camera .caption-inputarea {
        padding: 8px 10px;
        gap: 6px;
    }

    .Camera .caption-inputarea select {
        min-width: 80px;
        padding: 5px 8px;
        font-size: 11px;
    }

    .Camera .caption-inputarea button {
        padding: 5px 10px;
        font-size: 11px;
    }
}

/* Small devices - single column controls */
@media screen and (max-width: 480px) {
    .Camera .caption-inputarea {
        flex-direction: column;
        align-items: stretch;
    }

    .Camera .caption-inputarea select,
    .Camera .caption-inputarea button {
        width: 100%;
        justify-content: center;
    }
}

/* Empty state when no captions */
.Camera .caption-chat:empty::before {
    content: 'No captions yet. Click Start to begin transcription.';
    display: block;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    padding: 20px;
}
