/* Component styles - Buttons, Forms, Cards, Alerts, etc. */

/* Stage Indicator */
.stage-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

/* Hide stage indicator when welcome screen is active */
.content:has(.welcome-screen.active) .stage-indicator {
    display: none;
}

/* Hide stage indicator when assessment info screen is active */
.content:has(.assessment-info-screen.active) .stage-indicator {
    display: none;
}

/* Hide stage indicator when briefing screens are active */
.content:has(.stage1-briefing-screen.active) .stage-indicator {
    display: none;
}

.content:has(.stage2-briefing-screen.active) .stage-indicator {
    display: none;
}

.content:has(.stage3-briefing-screen.active) .stage-indicator {
    display: none;
}

.stage-indicator::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 60px;
    right: 60px;
    height: 3px;
    background: #e0e0e0;
    z-index: 0;
}

.stage-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.stage-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #999;
    margin-bottom: 10px;
}

.stage-circle.active {
    background: #0056D6;
    color: white;
}

.stage-circle.completed {
    background: #4caf50;
    color: white;
}

.stage-label {
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* Info Boxes */
.info-box {
    background: #f5f5f5;
    border-left: 4px solid #0056D6;
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.info-box h3 {
    color: #0056D6;
    margin-bottom: 10px;
}

.info-box ul {
    list-style-position: inside;
    color: #666;
    line-height: 1.8;
}

/* Form Components */
.form-group {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.form-group label {
    display: block;
    margin: 0;
    color: #374151;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 400;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transition: all 0.2s;
    background: white;
    box-sizing: border-box;
    color: #111827;
}

.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 400;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transition: all 0.2s;
    background: white;
    box-sizing: border-box;
    color: #111827;
}

.form-group input::placeholder,
.form-group select::placeholder {
    color: #d1d5db;
    font-weight: 400;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1);
}

/* Select Dropdown Styling */
.select-wrapper {
    position: relative;
    width: 100%;
}

.select-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    color: #d1d5db;
    padding-right: 40px;
}

.select-wrapper select:not([value=""]):valid {
    color: #111827;
}

.select-wrapper select option {
    color: #111827;
}

.select-wrapper .select-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    pointer-events: none;
    opacity: 0.5;
}

/* Question Components */
.question-container {
    margin-bottom: 30px;
    padding: 25px;
    background: white;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.question-number {
    background: #0056D6;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

.question-timer {
    color: #666;
    font-size: 14px;
}

.question-text {
    font-size: 18px;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.6;
    white-space: pre-wrap; /* Preserve whitespace and line breaks */
}

/* Better spacing for multi-part questions */
.question-text div {
    margin-bottom: 8px;
}

.question-text div:last-child {
    margin-bottom: 0;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option {
    padding: 15px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.option:hover {
    border-color: #0056D6;
    background: #f5f5ff;
}

.option.selected {
    border-color: #0056D6;
    background: #0056D6;
    color: white;
}

.option input[type="radio"] {
    margin-right: 12px;
}

/* Form Fields Container */
.form-fields {
    display: flex;
    flex-direction: column;
    gap: 24px;
    flex: 1;
}

/* Buttons */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    box-sizing: border-box;
    width: 100%;
    margin-top: 8px;
}

.btn-primary {
    background: #818cf8;
    color: white;
}

.btn-primary.disabled,
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary:not(:disabled):hover {
    background: #6366f1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(129, 140, 248, 0.3);
}

.btn-primary:not(:disabled):active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: rgba(30, 84, 231, 0.5);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
    margin-right: 10px;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-container {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

/* Video Components */
.video-container {
    margin: 25px auto;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    max-width: 800px;
    aspect-ratio: 16 / 9;
}

.video-preview {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background: #000;
    display: block;
    object-fit: cover;
}

.video-controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.recording-indicator {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(244, 67, 54, 0.95);
    border-radius: 8px;
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    color: white;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.recording-indicator.active {
    display: flex;
}

.recording-dot {
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Camera Test Prompt */
.camera-test-prompt {
    background: #fff3e0;
    border: 2px solid #ff9800;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.camera-test-prompt h3 {
    color: #e65100;
    margin: 0 0 10px 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.camera-test-prompt p {
    color: #666;
    margin: 0 0 15px 0;
    line-height: 1.6;
}

.camera-test-prompt ul {
    text-align: left;
    color: #666;
    margin: 0 auto 15px auto;
    max-width: 400px;
    line-height: 1.8;
}

.camera-test-prompt.success {
    background: #e8f5e9;
    border-color: #4caf50;
}

.camera-test-prompt.success h3 {
    color: #2e7d32;
}

/* Stage 3 Screen Layout */
.stage3-screen {
    max-width: 1400px;
    margin: 0 auto;
}

/* Camera prompts span full width above split layout */
.stage3-screen > .camera-test-prompt {
    margin-bottom: 24px;
}

/* Stage 3 Two-Column Layout */
.stage3-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.stage3-left {
    flex: 0 0 60%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stage3-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Adjust video container for two-column layout */
.stage3-left .video-container {
    margin: 0;
    max-width: 100%;
}

/* Video controls in right column under question */
.stage3-right .video-controls {
    margin-top: 20px;
}

/* Video Progress Indicator (non-clickable) */
.video-progress-indicator {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 20px 0;
    text-align: center;
}

.video-progress-indicator h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.video-progress-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.video-progress-step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-progress-step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid #e0e0e0;
    color: #999;
    background: white;
}

.video-progress-step.completed .video-progress-step-icon {
    background: #4caf50;
    border-color: #4caf50;
    color: white;
}

.video-progress-step.current .video-progress-step-icon {
    background: #818cf8;
    border-color: #818cf8;
    color: white;
    animation: pulse-subtle 2s ease-in-out infinite;
}

.video-progress-step-label {
    font-size: 12px;
    color: #666;
}

@keyframes pulse-subtle {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(129, 140, 248, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 6px rgba(129, 140, 248, 0);
    }
}

/* Confirmation Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal h3 {
    color: #e65100;
    margin: 0 0 15px 0;
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal p {
    color: #666;
    line-height: 1.6;
    margin: 0 0 10px 0;
}

.modal-warning {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.modal-warning p {
    margin: 0;
    color: #e65100;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.modal-actions .btn {
    flex: 1;
    margin: 0;
}

/* Progress Bar - HIDDEN */
.progress-bar {
    display: none;
}

/* Question Navigation Bar */
.question-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    padding: 20px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.question-nav-item {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.question-nav-item:hover {
    border-color: #818cf8;
    background: #f5f5ff;
    transform: translateY(-2px);
}

.question-nav-item.current {
    border-color: #818cf8;
    background: #818cf8;
    color: white;
}

.question-nav-item.answered {
    border-color: #4caf50;
    background: #e8f5e9;
    color: #2e7d32;
}

.question-nav-item.answered.current {
    border-color: #4caf50;
    background: #4caf50;
    color: white;
}

/* Question Navigation - Responsive */
@media (max-width: 768px) {
    .question-nav {
        gap: 10px;
        padding: 15px;
        margin: 20px 0;
    }

    .question-nav-item {
        width: 40px;
        height: 40px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .question-nav {
        gap: 8px;
        padding: 12px;
        margin: 15px 0;
    }

    .question-nav-item {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

/* Results Components */
.results-summary {
    text-align: center;
    padding: 30px;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0056D6 0%, #003D99 100%);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.score-circle .score {
    font-size: 48px;
    font-weight: bold;
}

.score-circle .label {
    font-size: 14px;
    opacity: 0.9;
}

.result-message {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

.result-details {
    background: #f5f5f5;
    padding: 25px;
    border-radius: 12px;
    margin-top: 30px;
    text-align: left;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: #666;
    font-weight: 500;
}

.detail-value {
    color: #333;
    font-weight: 600;
}

.stage-results-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.stage-results-section h3 {
    color: #0056D6;
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #0056D6;
    padding-bottom: 8px;
}

.stage-results-section .detail-row {
    background: #f9f9f9;
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 6px;
    border-bottom: none;
}

.stage-results-section .detail-row:last-child {
    margin-bottom: 0;
}

.timer-warning {
    color: #f44336;
    font-weight: bold;
}

/* Candidate Cards */
.candidate-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.candidate-card:hover {
    border-color: #0056D6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.candidate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.candidate-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.candidate-score {
    font-size: 24px;
    font-weight: bold;
    color: #0056D6;
}

.candidate-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    font-size: 14px;
    color: #666;
}

.video-playback {
    margin-top: 15px;
}

.video-playback video {
    width: 100%;
    border-radius: 8px;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-passed {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-failed {
    background: #ffebee;
    color: #c62828;
}

.status-pending {
    background: #fff3e0;
    color: #e65100;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

.alert-warning {
    background: #fff3e0;
    color: #e65100;
    border-left: 4px solid #ff9800;
}

/* ============================================
   RESPONSIVE DESIGN - COMPONENTS
   ============================================ */

/* Mobile and small tablets (< 768px) */
@media (max-width: 768px) {
    /* Form adjustments */
    .form-group {
        margin-bottom: 18px;
    }

    .form-group label {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .form-group input,
    .form-group select {
        font-size: 14px;
        padding: 8px 10px;
        height: 36px;
    }

    .select-wrapper .select-icon {
        right: 10px;
    }

    /* Button adjustments */
    .btn {
        font-size: 14px;
        padding: 10px 24px;
        height: 40px;
    }

    .btn-primary {
        width: 100%;
    }

    /* Stage indicator adjustments for assessment screens */
    .stage-indicator {
        margin-bottom: 30px;
        flex-wrap: wrap;
        gap: 15px;
    }

    .stage-indicator::before {
        display: none;
    }

    .stage-circle {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .stage-label {
        font-size: 11px;
    }

    /* Question components */
    .question-container {
        padding: 20px;
        margin-bottom: 25px;
    }

    .question-text {
        font-size: 16px;
    }

    .option {
        padding: 12px;
        font-size: 14px;
    }

    /* Results components */
    .score-circle {
        width: 120px;
        height: 120px;
    }

    .score-circle .score {
        font-size: 36px;
    }

    .result-message {
        font-size: 20px;
    }

    /* Candidate cards */
    .candidate-details {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    /* Stage 3 responsive - stack on mobile */
    .stage3-layout {
        flex-direction: column;
        gap: 24px;
    }

    .stage3-left {
        flex: none;
        width: 100%;
    }

    .stage3-right {
        width: 100%;
    }
}

/* Small mobile devices (< 480px) */
@media (max-width: 480px) {
    /* Form adjustments */
    .form-group {
        margin-bottom: 16px;
    }

    .form-group label {
        font-size: 11px;
    }

    .form-group input,
    .form-group select {
        font-size: 13px;
        padding: 7px 9px;
        height: 34px;
    }

    /* Button adjustments */
    .btn {
        font-size: 13px;
        padding: 9px 20px;
        height: 38px;
    }

    /* Stage indicator adjustments */
    .stage-indicator {
        gap: 12px;
    }

    .stage-circle {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .stage-label {
        font-size: 10px;
    }

    /* Question components */
    .question-container {
        padding: 16px;
        margin-bottom: 20px;
    }

    .question-text {
        font-size: 15px;
    }

    .question-number {
        padding: 4px 12px;
        font-size: 13px;
    }

    .option {
        padding: 10px;
        font-size: 13px;
    }

    /* Results components */
    .score-circle {
        width: 100px;
        height: 100px;
    }

    .score-circle .score {
        font-size: 30px;
    }

    .score-circle .label {
        font-size: 12px;
    }

    .result-message {
        font-size: 18px;
    }

    .result-details {
        padding: 20px;
    }
}
