/* Studio Styles */
:root {
    --primary-purple: #6D1A86;
    --primary-cyan: #2CC5FF;
    --danger-red: #dc3545;
    --success-green: #198754;
    --dark-bg: #1a1a1a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    overflow: hidden;
}

/* Green Room */
.studio-header h2 {
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Green Room Form Labels - Dark text on white cards */
#greenRoom .form-label {
    color: #212529 !important;
    font-weight: 600 !important;
}

#greenRoom .card-title {
    color: #212529 !important;
    font-weight: 700 !important;
}

#greenRoom .form-label strong {
    color: #212529 !important;
}

/* Ensure form text is readable */
#greenRoom .small,
#greenRoom small {
    color: #495057 !important;
}

.video-preview-container {
    width: 100%;
    max-width: 800px;
}

.video-preview-large {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-video-placeholder {
    text-align: center;
    padding: 40px;
}

#localVideoPreview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.audio-level-container {
    width: 100%;
}

/* Recording Studio */
.studio-container {
    min-height: calc(100vh - 56px);
    overflow: visible;
    background: #f5f5f5;
}

.studio-container .col-md-3.bg-light,
.studio-container .col-md-4.bg-light {
    min-height: calc(100vh - 56px);
    overflow: visible;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 15px;
    padding: 20px;
    min-height: calc(100vh - 200px);
    overflow: visible;
}

.participant-video {
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.video-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: #000;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.participant-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.participant-name {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.participant-muted {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger-red);
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
}

/* Recording Controls */
.recording-controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    padding: 15px 30px;
    border-radius: 50px;
    display: flex;
    gap: 15px;
    align-items: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 1000;
}

.recording-controls .btn {
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s;
}

.recording-controls .btn:hover {
    transform: scale(1.1);
}

.recording-controls .btn-danger {
    width: 80px;
    height: 80px;
    font-size: 24px;
}

.recording-timer {
    display: flex;
    align-items: center;
    gap: 10px;
}

.timer-display {
    font-family: 'Courier New', monospace;
    font-size: 24px;
    font-weight: 700;
    color: white;
    background: rgba(0,0,0,0.5);
    padding: 5px 15px;
    border-radius: 8px;
}

#recordingIndicator {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Sidebar */
.sidebar-section {
    padding: 15px;
}

.sidebar-section h5 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.participants-list {
    max-height: 300px;
    overflow-y: auto;
}

.participant-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.participant-item .name {
    font-weight: 500;
}

.participant-item .role {
    font-size: 12px;
    color: #666;
}

.participant-actions {
    display: flex;
    gap: 5px;
}

.participant-actions button {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}

/* Chat */
.chat-messages {
    height: 300px;
    overflow-y: auto;
    background: white;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #ddd;
}

.chat-message {
    margin-bottom: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
}

.chat-message .sender {
    font-weight: 600;
    font-size: 13px;
    color: var(--primary-purple);
    margin-bottom: 3px;
}

.chat-message .text {
    font-size: 14px;
    color: #333;
}

.chat-message .time {
    font-size: 11px;
    color: #999;
    margin-top: 3px;
}

/* Responsive */
@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
    }

    .recording-controls {
        bottom: 10px;
        padding: 10px 15px;
        gap: 10px;
    }

    .recording-controls .btn {
        width: 50px;
        height: 50px;
        font-size: 16px;
    }

    .recording-controls .btn-danger {
        width: 60px;
        height: 60px;
        font-size: 20px;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Connection Status Indicators */
.connection-status {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--success-green);
    box-shadow: 0 0 8px rgba(25, 135, 84, 0.6);
}

.connection-status.weak {
    background: #ffc107;
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.6);
}

.connection-status.poor {
    background: var(--danger-red);
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.6);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Audio Level Indicator */
.audio-level-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 2px;
    align-items: flex-end;
    height: 30px;
}

.audio-level-bar {
    width: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    transition: all 0.1s;
}

.audio-level-bar.active {
    background: var(--success-green);
    box-shadow: 0 0 6px var(--success-green);
}

/* Recording Status Badge */
.recording-status-badge {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--danger-red);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    display: none;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
    z-index: 1001;
}

.recording-status-badge.show {
    display: flex;
}

.recording-status-badge .rec-dot {
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

/* Participant Count Badge */
.participant-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(109, 26, 134, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    color: var(--primary-purple);
}

/* Network Quality Indicator */
.network-quality {
    position: absolute;
    top: 40px;
    left: 10px;
    display: flex;
    gap: 2px;
}

.network-bar {
    width: 6px;
    height: 12px;
    background: rgba(255,255,255,0.3);
    border-radius: 1px;
}

.network-bar:nth-child(1) { height: 6px; }
.network-bar:nth-child(2) { height: 9px; }
.network-bar:nth-child(3) { height: 12px; }

.network-bar.active {
    background: var(--success-green);
}

/* Loading States */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

.toast-notification {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-notification.success {
    border-left: 4px solid var(--success-green);
}

.toast-notification.error {
    border-left: 4px solid var(--danger-red);
}

.toast-notification.info {
    border-left: 4px solid var(--primary-cyan);
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-notification.success .toast-icon {
    color: var(--success-green);
}

.toast-notification.error .toast-icon {
    color: var(--danger-red);
}

.toast-notification.info .toast-icon {
    color: var(--primary-cyan);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: #666;
}

/* Screen Share Indicator */
.screen-share-active {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: var(--primary-cyan);
    color: white;
    padding: 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
}

/* Hover Effects */
.participant-video:hover .participant-actions {
    opacity: 1;
}

.participant-actions {
    position: absolute;
    top: 10px;
    right: 40px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s;
}

.participant-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.7);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.participant-action-btn:hover {
    background: rgba(0,0,0,0.9);
    transform: scale(1.1);
}

/* Keyboard Shortcuts Styling */
kbd {
    display: inline-block;
    padding: 3px 8px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
    background-color: #f7f7f7;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 0 rgba(0,0,0,0.1), inset 0 0 0 2px #fff;
    white-space: nowrap;
}

.modal kbd {
    margin: 0 2px;
}

.keyboard-shortcuts-help table td:first-child {
    white-space: nowrap;
    min-width: 150px;
}

.keyboard-shortcuts-help table td {
    padding: 8px 12px;
    vertical-align: middle;
}
