.ai-interview-bot-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ai-interview-bot-header {
    text-align: center;
    margin-bottom: 30px;
}

.ai-interview-bot-header h2 {
    margin: 0 0 10px 0;
    color: #333;
}

.ai-interview-bot-subtitle {
    color: #666;
    margin: 0;
}

.ai-interview-bot-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.ai-interview-bot-video-container {
    position: relative;
    background: #fff;      /* White background instead of black */
    border: 1px solid #ddd; /* Grey border like chat container */
    border-radius: 8px;
    overflow: hidden;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9; /* Maintain video aspect ratio */
    width: 100%;           /* Constrain width */
    max-width: 100%;       /* Prevent overflow */
    /* Prevent layout shifts during video switching */
    contain: layout style paint;
    will-change: contents;
}

/* Pauline background image - shown before interview starts */
.ai-interview-pauline-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4; /* Subtle, professional look */
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.ai-interview-video {
    width: 100% !important;  /* Override any inline styles */
    height: 100% !important;  /* Override any inline styles */
    object-fit: cover; /* Fill entire container without empty space */
    transition: opacity 0.3s ease; /* Only transition opacity, not dimensions */
    /* Prevent layout shifts during video switching */
    display: block;
    position: relative;
    flex-shrink: 0; /* Prevent shrinking during layout changes */
}

/* Visual feedback when avatar is "talking" */
.ai-interview-video.talking {
    box-shadow: 0 0 20px rgba(0, 115, 170, 0.5);
    transform: scale(1.02);
}

.ai-interview-loading,
.ai-interview-placeholder {
    color: #333;        /* Better visibility on white background */
    text-align: center;
    padding: 20px;
    position: absolute;  /* Position absolutely */
    top: 50%;            /* Center vertically */
    left: 50%;          /* Center horizontally */
    transform: translate(-50%, -50%); /* Center it perfectly */
    z-index: 10;        /* Ensure it's on top */
    background: rgba(255, 255, 255, 0.9); /* Semi-transparent white background */
    border-radius: 8px;
    width: 80%;
    max-width: 300px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ai-interview-bot-chat {
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.ai-interview-messages {
    flex: 1;
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
    background: #f9f9f9;
    margin: 0;
}

.ai-message {
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    max-width: 80%;
}

.ai-message-user {
    background: #6c6c6c;
    color: #fff;
    margin-left: auto;
    text-align: right;
}

.ai-message-bot {
    background: #e5e5e5;
    color: #333;
}

.ai-interview-input-container {
    display: flex;
    padding: 15px;
    background: #fff;
    border-top: 1px solid #ddd;
    margin: 0;
}

.ai-interview-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
}

.ai-interview-voice-btn {
    padding: 0 15px;
    background: #6c6c6c;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    line-height: 40px; /* Match input field height */
    margin-right: 10px;
    font-size: 18px;
    transition: background 0.3s ease;
}

.ai-interview-voice-btn:hover {
    background: #555555;
}

.ai-interview-voice-btn.recording {
    background: #dc3232;
    animation: pulse 1.5s infinite;
}

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

.ai-interview-send-btn {
    padding: 0 20px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    line-height: 40px; /* Match input field height */
}

.ai-interview-send-btn:hover {
    background: #333;
}

.ai-interview-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ✅ NEW: Hide text input and send button when setting is enabled */
.ai-interview-input-container.hide-text-input .ai-interview-input,
.ai-interview-input-container.hide-text-input .ai-interview-send-btn {
    display: none !important;
}

/* ✅ NEW: Adjust voice button styling when text input is hidden */
.ai-interview-input-container.hide-text-input {
    justify-content: center; /* Center the microphone button */
}

.ai-interview-input-container.hide-text-input .ai-interview-voice-btn {
    margin-right: 0; /* Remove right margin when alone */
}

/* ✅ NEW: Hide chat area when setting is enabled (anti-cheating) */
.ai-interview-bot-chat.hide-chat-area .ai-interview-messages {
    display: none !important;
}

/* ✅ NEW: Center input container when chat area is hidden */
.ai-interview-bot-chat.hide-chat-area {
    justify-content: center; /* Center vertically in flex container */
    align-items: center;     /* Center horizontally in flex container */
    min-height: 200px;       /* Ensure enough height for centering */
}

.ai-interview-bot-chat.hide-chat-area .ai-interview-input-container {
    justify-content: center;  /* Center the microphone button horizontally */
    width: auto;             /* Let container size to content */
    margin: 0 auto;          /* Center the container itself */
    border-top: none;        /* Remove top border when centered (looks cleaner) */
}

/* Always-visible live interview status area (outside hidden chat container) */
.ai-interview-live-status {
    margin: 10px 0 12px;
    text-align: center;
}

.ai-interview-mic-status-chip {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 600;
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    max-width: 100%;
}

.ai-interview-mic-hint {
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
}

.ai-interview-bot-controls {
    text-align: center;
    margin-top: 20px;
    padding: 0;
}

.ai-interview-btn {
    padding: 0 30px;
    margin: 0 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    line-height: 40px; /* Add line-height to maintain button height */
}

.ai-interview-btn-primary {
    background: #000;
    color: #fff;
}

.ai-interview-btn-primary:hover {
    background: #333;
}

.ai-interview-btn-secondary {
    background: #dc3232;
    color: #fff;
}

.ai-interview-btn-secondary:hover {
    background: #a00;
}

/* Typing indicator - animated dots */
.ai-typing-indicator {
    padding: 10px 15px;
    margin-bottom: 10px;
    background: #e5e5e5;
    color: #666;
    border-radius: 8px;
    max-width: 80px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
}

.ai-typing-indicator .typing-dot {
    width: 8px;
    height: 8px;
    background: #666;
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite;
}

.ai-typing-indicator .typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-typing-indicator .typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* User video PiP overlay */
.ai-interview-user-video {
    position: absolute;
    bottom: 15px;
    left: 15px;
    width: 130px !important;       /* Fixed square dimensions - override Elementor styles */
    height: 130px !important;     /* Fixed square dimensions - override Elementor styles */
    max-width: 130px !important;  /* Prevent percentage-based overrides */
    border-radius: 8px;
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    object-fit: cover;   /* Ensures face fills the frame properly */
    z-index: 20;
    background: #000;
}

/* Camera indicator */
.ai-interview-camera-indicator {
    position: absolute;
    bottom: 5px;         /* Adjusted to avoid overlap with video */
    left: 5px;           /* Adjusted to avoid overlap with video */
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 4px 8px;    /* Slightly smaller for better fit */
    border-radius: 4px;
    font-size: 11px;     /* Slightly smaller font */
    z-index: 21;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease;
}

.ai-interview-camera-indicator:hover {
    background: rgba(0,0,0,0.9);
}

/* Camera off state */
.ai-interview-camera-indicator.camera-off {
    background: rgba(150, 0, 0, 0.7) !important;
    opacity: 0.7;
}

.ai-interview-camera-indicator.camera-off:hover {
    background: rgba(150, 0, 0, 0.9) !important;
    opacity: 0.9;
}

/* Photo capture indicator (flash effect) */
.ai-interview-photo-capture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.95);
    z-index: 30;
    animation: photoFlash 0.5s ease-out;
    pointer-events: none;
}

@keyframes photoFlash {
    0% { opacity: 0; }
    30% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

/* Camera indicator flash when photo captured */
.ai-interview-camera-indicator.photo-captured {
    background: rgba(0, 150, 0, 0.9) !important;
    animation: indicatorFlash 0.6s ease-out;
}

@keyframes indicatorFlash {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 rgba(0, 150, 0, 0);
    }
    50% { 
        transform: scale(1.15);
        box-shadow: 0 0 15px rgba(0, 150, 0, 0.8);
    }
}

/* Photo capture notification */
.ai-interview-photo-notification {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 150, 0, 0.95);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    z-index: 31;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    animation: photoNotificationSlide 0.4s ease-out;
    pointer-events: none;
}

@keyframes photoNotificationSlide {
    0% {
        transform: translateX(120%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .ai-interview-bot-content {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Enhanced Voice Recognition Styles
   ============================================ */

/* Voice Activity Detection Indicator */
.vad-indicator {
    display: inline-block;
    margin-left: 5px;
    vertical-align: middle;
}

.vad-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    transition: background 0.2s ease;
}

.vad-indicator.active .vad-dot {
    animation: vadPulse 1s infinite;
}

@keyframes vadPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

/* Audio Level Indicator */
.voice-level-container {
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0,0,0,0.1);
    border-radius: 2px;
    display: none;
}

.voice-level-container.active {
    display: block;
}

.voice-level-bar {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #ff9800, #f44336);
    border-radius: 2px;
    transition: width 0.1s ease;
    max-width: 100%;
}

/* Notifications */
.voice-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 10000;
    display: none;
    align-items: center;
    gap: 10px;
    max-width: 400px;
    animation: slideInRight 0.3s ease;
}

.voice-notification-info {
    border-left: 4px solid #2196F3;
}

.voice-notification-success {
    border-left: 4px solid #4caf50;
}

.voice-notification-error {
    border-left: 4px solid #f44336;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Permission Guidance */
.permission-guidance-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.permission-guidance-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.permission-guidance-box h3 {
    margin-top: 0;
    color: #333;
}

.permission-guidance-box ol {
    text-align: left;
    margin: 15px 0;
}

.permission-close-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 15px;
}

.permission-close-btn:hover {
    background: #1976D2;
}

/* Transcription Preview */
.transcription-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.transcription-preview-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.transcription-preview-box h3 {
    margin-top: 0;
    color: #333;
}

.transcription-edit {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin: 15px 0;
    box-sizing: border-box;
}

.transcription-edit:focus {
    outline: none;
    border-color: #2196F3;
}

.transcription-stats {
    text-align: right;
    color: #666;
    margin-bottom: 15px;
}

.transcription-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.transcription-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-send-transcription {
    background: #4caf50;
    color: white;
}

.btn-send-transcription:hover {
    background: #45a049;
}

.btn-cancel-transcription {
    background: #f44336;
    color: white;
}

.btn-cancel-transcription:hover {
    background: #d32f2f;
}

.btn-edit-transcription {
    background: #2196F3;
    color: white;
}

.btn-edit-transcription:hover {
    background: #1976D2;
}

/* ============================================
   Timer Positioning Fix
   ============================================ */
#ai-interview-timer {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 18px;
    font-weight: bold;
    z-index: 9999;
    display: none; /* Will be shown when timer starts */
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

#ai-interview-timer-text {
    font-family: monospace;
    letter-spacing: 1px;
}


