/* Admin Status Panel */
.admin-status-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 320px;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #fff;
    border: 1px solid #333;
}

.admin-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #1a1a1a;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #333;
}

.admin-label {
    font-weight: bold;
    color: #4CAF50;
}

.toggle-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn:hover {
    background: #333;
    border-radius: 3px;
}

.admin-status-content {
    padding: 15px;
}

.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 4px 0;
}

.status-label {
    color: #ccc;
    font-weight: bold;
    min-width: 100px;
}

.status-value {
    text-align: right;
    font-weight: normal;
}

.status-success {
    color: #4CAF50 !important;
}

.status-warning {
    color: #ff9800 !important;
}

.status-error {
    color: #f44336 !important;
}

.status-info {
    color: #2196F3 !important;
}

/* Voice Level Bar */
.voice-level-container {
    width: 100px;
    height: 12px;
    background: #333;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #555;
}

.voice-level-fill {
    height: 100%;
    width: 0%;
    background: #ddd;
    transition: width 0.1s ease, background-color 0.3s ease;
    border-radius: 6px;
}

/* Responsive adjustments for admin panel */
@media (max-width: 768px) {
    .admin-status-panel {
        position: relative;
        top: 0;
        right: 0;
        width: 100%;
        margin-bottom: 20px;
    }
}

/* Hide admin panel for non-admin users */
body:not(.admin-bar) .admin-status-panel {
    display: none;
}

/* HeyGen Audio Capture Styles - Simplified */
#heygen-audio-capture-container {
    max-width: 400px;
    margin: 20px auto;
    padding: 20px;
    border-radius: 12px;
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Status States */
.audio-capture-listening {
    border-color: #4CAF50;
    box-shadow: 0 8px 32px rgba(76, 175, 80, 0.2);
}

.audio-capture-recording {
    border-color: #f44336;
    box-shadow: 0 8px 32px rgba(244, 67, 54, 0.3);
    animation: pulse-recording 2s infinite;
}

.audio-capture-processing {
    border-color: #ff9800;
    box-shadow: 0 8px 32px rgba(255, 152, 0, 0.2);
}

.audio-capture-complete {
    border-color: #2196F3;
    box-shadow: 0 8px 32px rgba(33, 150, 243, 0.2);
}

.audio-capture-error {
    border-color: #e91e63;
    box-shadow: 0 8px 32px rgba(233, 30, 99, 0.3);
}

.audio-capture-text-mode {
    border-color: #9c27b0;
    box-shadow: 0 8px 32px rgba(156, 39, 176, 0.2);
}

@keyframes pulse-recording {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Audio Status */
#heygen-audio-status {
    text-align: center;
    margin-bottom: 20px;
}

.status-text {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 15px;
    min-height: 24px;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.audio-capture-recording .status-text {
    color: #f44336;
}

.audio-capture-listening .status-text {
    color: #4CAF50;
}

.audio-capture-processing .status-text {
    color: #ff9800;
}

.audio-capture-error .status-text {
    color: #e91e63;
}

.audio-capture-complete .status-text {
    color: #2196F3;
}

/* Audio Visualizer */
.audio-visualizer {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    height: 60px;
    gap: 4px;
    margin: 10px 0;
}

.audio-visualizer .bar {
    width: 8px;
    min-height: 4px;
    height: 20%;
    background: linear-gradient(to top, #4CAF50, #81C784);
    border-radius: 4px;
    transition: height 0.1s ease, opacity 0.3s ease;
    opacity: 0.3;
}

.audio-capture-recording .audio-visualizer .bar {
    background: linear-gradient(to top, #f44336, #ef5350);
    animation: visualizer-pulse 0.8s infinite alternate;
}

.audio-capture-listening .audio-visualizer .bar {
    background: linear-gradient(to top, #4CAF50, #81C784);
}

.audio-capture-processing .audio-visualizer .bar {
    background: linear-gradient(to top, #ff9800, #ffb74d);
    animation: processing-wave 1.5s infinite;
}

@keyframes visualizer-pulse {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

@keyframes processing-wave {
    0%, 100% { height: 20%; }
    50% { height: 80%; }
}

.audio-visualizer .bar:nth-child(1) { animation-delay: 0s; }
.audio-visualizer .bar:nth-child(2) { animation-delay: 0.1s; }
.audio-visualizer .bar:nth-child(3) { animation-delay: 0.2s; }
.audio-visualizer .bar:nth-child(4) { animation-delay: 0.3s; }
.audio-visualizer .bar:nth-child(5) { animation-delay: 0.4s; }

/* Recording Controls */
.recording-controls {
    text-align: center;
    margin: 20px 0;
}

.record-btn, .stop-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    min-width: 160px;
}

.record-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.record-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.stop-btn {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
    animation: pulse-record-btn 2s infinite;
}

.stop-btn:hover {
    background: linear-gradient(135deg, #d32f2f, #c62828);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(244, 67, 54, 0.4);
}

@keyframes pulse-record-btn {
    0% { box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3); }
    50% { box-shadow: 0 4px 20px rgba(244, 67, 54, 0.6); }
    100% { box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3); }
}

/* Text Fallback */
.text-fallback {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
    transition: all 0.3s ease;
}

.text-fallback:focus-within {
    border-color: #9c27b0;
    background: #fafafa;
}

#heygen-text-input {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
    background: white;
}

#heygen-text-input:focus {
    outline: none;
    border-color: #9c27b0;
    box-shadow: 0 0 0 3px rgba(156, 39, 176, 0.1);
}

#heygen-text-input::placeholder {
    color: #999;
    font-style: italic;
}

/* Buttons */
.submit-text-btn,
.toggle-text-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: inline-block;
    text-decoration: none;
}

.submit-text-btn {
    background: linear-gradient(135deg, #9c27b0, #673ab7);
    color: white;
    margin-top: 10px;
    width: 100%;
}

.submit-text-btn:hover {
    background: linear-gradient(135deg, #8e24aa, #5e35b1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.3);
}

.submit-text-btn:active {
    transform: translateY(0);
}

.toggle-text-btn {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    margin-top: 15px;
    width: 100%;
}

.toggle-text-btn:hover {
    background: #eeeeee;
    color: #333;
    border-color: #bbb;
}

/* Controls */
.controls {
    text-align: center;
    margin-top: 15px;
}

/* Success indicators */
.audio-capture-complete .audio-visualizer .bar {
    background: linear-gradient(to top, #2196F3, #64b5f6);
    animation: success-pulse 0.6s ease-in-out;
}

@keyframes success-pulse {
    0% { height: 20%; opacity: 0.3; }
    50% { height: 90%; opacity: 1; }
    100% { height: 20%; opacity: 0.7; }
}

/* Error states */
.audio-capture-error .audio-visualizer .bar {
    background: linear-gradient(to top, #e91e63, #f06292);
    animation: error-shake 0.5s ease-in-out;
}

@keyframes error-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

/* Responsive Design */
@media (max-width: 480px) {
    #heygen-audio-capture-container {
        margin: 10px;
        padding: 15px;
        max-width: none;
    }
    
    .status-text {
        font-size: 14px;
    }
    
    .audio-visualizer {
        height: 50px;
    }
    
    .audio-visualizer .bar {
        width: 6px;
    }
    
    .record-btn, .stop-btn {
        padding: 10px 20px;
        font-size: 14px;
        min-width: 140px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    #heygen-audio-capture-container {
        background: linear-gradient(145deg, #2d2d2d, #1a1a1a);
        border-color: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }
    
    .status-text {
        color: #ffffff;
    }
    
    .text-fallback {
        background: #333;
        border-color: #555;
    }
    
    #heygen-text-input {
        background: #2d2d2d;
        border-color: #555;
        color: #ffffff;
    }
    
    #heygen-text-input::placeholder {
        color: #aaa;
    }
    
    .toggle-text-btn {
        background: #333;
        color: #ccc;
        border-color: #555;
    }
    
    .toggle-text-btn:hover {
        background: #444;
        color: #fff;
        border-color: #777;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Focus indicators for keyboard navigation */
.submit-text-btn:focus,
.toggle-text-btn:focus,
.record-btn:focus,
.stop-btn:focus {
    outline: 2px solid #9c27b0;
    outline-offset: 2px;
}

/* Loading states */
.submit-text-btn:disabled,
.record-btn:disabled,
.stop-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.submit-text-btn:disabled:hover {
    background: linear-gradient(135deg, #9c27b0, #673ab7);
    box-shadow: none;
}

/* Controls */
.controls {
    text-align: center;
    margin-top: 15px;
}

/* Responsive Design */
@media (max-width: 480px) {
    #heygen-audio-capture-container {
        margin: 10px;
        padding: 15px;
        max-width: none;
    }
    
    .status-text {
        font-size: 14px;
    }
    
    .audio-visualizer {
        height: 50px;
    }
    
    .audio-visualizer .bar {
        width: 6px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    #heygen-audio-capture-container {
        background: linear-gradient(145deg, #2d2d2d, #1a1a1a);
        border-color: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }
    
    .status-text {
        color: #ffffff;
    }
    
    .text-fallback {
        background: #333;
        border-color: #555;
    }
    
    #heygen-text-input {
        background: #2d2d2d;
        border-color: #555;
        color: #ffffff;
    }
    
    #heygen-text-input::placeholder {
        color: #aaa;
    }
    
    .toggle-text-btn {
        background: #333;
        color: #ccc;
        border-color: #555;
    }
    
    .toggle-text-btn:hover {
        background: #444;
        color: #fff;
        border-color: #777;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Focus indicators for keyboard navigation */
.submit-text-btn:focus,
.toggle-text-btn:focus {
    outline: 2px solid #9c27b0;
    outline-offset: 2px;
}

/* Loading states */
.submit-text-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.submit-text-btn:disabled:hover {
    background: linear-gradient(135deg, #9c27b0, #673ab7);
    box-shadow: none;
}

/* Success indicators */
.audio-capture-complete .audio-visualizer .bar {
    background: linear-gradient(to top, #2196F3, #64b5f6);
    animation: success-pulse 0.6s ease-in-out;
}

@keyframes success-pulse {
    0% { height: 20%; opacity: 0.3; }
    50% { height: 90%; opacity: 1; }
    100% { height: 20%; opacity: 0.7; }
}

/* Error states */
.audio-capture-error .audio-visualizer .bar {
    background: linear-gradient(to top, #e91e63, #f06292);
    animation: error-shake 0.5s ease-in-out;
}

@keyframes error-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}