/* Steve Jobs inspired minimalist design */
:root {
    --primary-color: #000;
    --secondary-color: #666;
    --accent-color: #0071e3;
    --background: #fff;
    --border-radius: 20px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--primary-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    padding: 20px 0;
    background: var(--background);
    border-bottom: 1px solid #e5e5e5;
}

.logo-container {
    text-align: center;
}

.logo {
    height: 60px;
    width: auto;
}

/* Main content */
main {
    flex: 1;
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Footer */
footer {
    padding: 20px;
    text-align: center;
    background: #f5f5f7;
    color: var(--secondary-color);
    font-size: 14px;
}

/* Upload page styles */
.upload-container {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

h1 {
    font-size: 48px;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 24px;
    color: var(--secondary-color);
    margin-bottom: 60px;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.file-upload-group {
    display: flex;
    gap: 40px;
    justify-content: center;
}

.file-upload {
    position: relative;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 30px 20px;
    background: #f5f5f7;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    width: 240px;
    height: 200px;
    justify-content: center;
    text-align: center;
}

.file-label:hover {
    background: #e8e8ed;
    border-color: var(--accent-color);
    transform: scale(1.02);
}

.file-icon {
    font-size: 48px;
}

.file-text {
    font-size: 16px;
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.submit-btn {
    align-self: center;
    padding: 16px 48px;
    font-size: 18px;
    font-weight: 500;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
}

.submit-btn:hover {
    background: #0077ed;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.submit-btn:disabled {
    background: #d0e3ff;
    color: #8a8a8a;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
    transform: none;
}

/* Preparing screen */
.preparing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.logo-animation {
    margin-bottom: 40px;
}

.rotating-logo {
    width: 120px;
    height: 120px;
    animation: rotateY 2s ease-in-out infinite;
}

@keyframes rotateY {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
    100% { transform: rotateY(360deg); }
}

.preparing-text {
    font-size: 24px;
    color: var(--secondary-color);
}

/* Interview stage */
.interview-container {
    max-width: 1000px;
    margin: 0 auto;
}

.interview-stage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-bottom: 40px;
}

.interviewer-side, .candidate-side {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.video-bubble {
    width: 300px;
    height: 300px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: #f5f5f7;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    position: relative;
}

.video-bubble img, .video-bubble video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.countdown {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 120px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
}

.interviewer-name, .candidate-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.instruction {
    font-size: 16px;
    color: var(--secondary-color);
    margin-bottom: 30px;
}

.controls {
    display: flex;
    gap: 20px;
}

.control-btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.record-btn {
    background: #ff3b30;
    color: white;
}

.stop-btn {
    background: #34c759;
    color: white;
}

.next-btn {
    background: var(--accent-color);
    color: white;
}

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

.control-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.question-display {
    text-align: center;
    padding: 40px;
    background: #f5f5f7;
    border-radius: var(--border-radius);
}

.question-display h2 {
    font-size: 28px;
    font-weight: 500;
    line-height: 1.4;
}

/* Analysis page */
.analysis-container {
    max-width: 1000px;
    margin: 0 auto;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

/* Analysis card styles moved to later in file for better organization */

.timestamp {
    color: var(--secondary-color);
    font-size: 14px;
    margin-bottom: 20px;
}

.processing-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.status-text {
    font-size: 18px;
    font-weight: 500;
    color: #34c759;
}

.status-text.error {
    color: #ff3b30;
}

/* Review page */
.review-container {
    max-width: 900px;
    margin: 0 auto;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 24px 32px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.review-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 113, 227, 0.1) 50%, transparent 100%);
}

.home-icon {
    text-decoration: none;
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(0, 113, 227, 0.08) 0%, rgba(0, 113, 227, 0.05) 100%);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    color: var(--accent-color);
    border: 1px solid rgba(0, 113, 227, 0.1);
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.1);
}

.home-icon:hover {
    background: linear-gradient(135deg, rgba(0, 113, 227, 0.15) 0%, rgba(0, 113, 227, 0.08) 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 113, 227, 0.2);
    border-color: rgba(0, 113, 227, 0.2);
}

.home-icon svg {
    transition: all 0.3s ease;
}

.home-icon:hover svg {
    transform: scale(1.1);
}

.navigation {
    display: flex;
    gap: 15px;
}

.nav-btn {
    padding: 12px 16px;
    font-size: 18px;
    background: linear-gradient(135deg, var(--accent-color) 0%, #0077ed 100%);
    color: white;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
    font-weight: 500;
    min-width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.nav-btn:not(:disabled):hover {
    background: #0077ed;
}

.video-player-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 40px;
    background: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.video-player-container video {
    width: 100%;
    display: block;
}

.analysis-section {
    background: #f5f5f7;
    border-radius: var(--border-radius);
    padding: 40px;
}

.metric-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.metric-card h3 {
    font-size: 24px;
    margin-bottom: 15px;
}

.metric-card p {
    color: var(--secondary-color);
    line-height: 1.8;
}

.metric-card ul {
    list-style: none;
    padding-left: 0;
}

.metric-card li {
    padding: 10px 0;
    border-bottom: 1px solid #e5e5e5;
}

.metric-card li:last-child {
    border-bottom: none;
}


/* Interview camera overlays */
.camera-status {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.face-indicator {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.face-indicator.no-face {
    background: rgba(255, 0, 0, 0.8);
    animation: pulse 1.5s infinite;
}

.face-indicator.face-detected {
    background: rgba(0, 255, 0, 0.8);
}

.comfort-indicator {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.comfort-indicator.comfortable {
    background: rgba(0, 255, 0, 0.8);
}

.comfort-indicator.too-close {
    background: rgba(255, 165, 0, 0.8);
}

.comfort-indicator.too-far {
    background: rgba(255, 0, 0, 0.8);
}

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

/* Camera Alert Modal */
.camera-alert-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none; /* toggled to flex in JS when showing */
    align-items: center;
    justify-content: center;
}

.camera-alert-content {
    background: white;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.camera-alert-header {
    background: #ff6b6b;
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    text-align: center;
}

.camera-alert-header h3 {
    margin: 0;
    font-size: 24px;
}

.camera-alert-body {
    padding: 20px;
}

.camera-alert-body p {
    margin: 10px 0;
    font-size: 16px;
}

.camera-alert-body ul {
    margin: 15px 0;
    padding-left: 20px;
}

.camera-alert-body li {
    margin: 8px 0;
    font-size: 14px;
}

.camera-preview {
    margin: 20px 0;
    text-align: center;
}

.camera-preview video {
    width: 200px;
    height: 150px;
    border-radius: 10px;
    border: 2px solid #ddd;
}

.camera-alert-footer {
    padding: 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
    border-top: 1px solid #eee;
}

.control-btn.secondary {
    background: #6c757d;
}

.control-btn.secondary:hover {
    background: #5a6268;
}

/* Analysis filters */
.filters {
    margin: 20px 0 30px;
}

.filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.filter-input {
    padding: 10px 14px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    min-width: 220px;
}

.filter-select {
    padding: 10px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: #fff;
}

/* Analysis grid improvements */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.analysis-card {
    padding: 20px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #eee;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    transition: transform .2s ease, box-shadow .2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.analysis-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.analysis-card:hover::before {
    left: 100%;
}

.analysis-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.10);
}

.analysis-card.processing {
    border-left: 4px solid #0071e3;
}

.analysis-card.completed {
    border-left: 4px solid #34c759;
}

.analysis-card.completed::after {
    content: '👆 Click to view analysis';
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 12px;
    color: #34c759;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.analysis-card.completed:hover::after {
    opacity: 1;
}

.analysis-card.error {
    border-left: 4px solid #ff3b30;
}

.analysis-card.unfinished {
    border-left: 4px solid #ff3b30;
    background: linear-gradient(135deg, #fff, #fff5f5);
}

.analysis-card.in-processing {
    border-left: 4px solid #ff9f0a;
    background: linear-gradient(135deg, #fff, #fffbf5);
}

/* Card header and interview type badge styles */
.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.card-title {
    margin: 0;
}

.interview-type-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.text-interview-badge {
    background: #e3f2fd;
    color: #1976d2;
}

.video-interview-badge {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Review page assessment header styles */
.assessment-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.assessment-title {
    margin: 0;
}

.interview-type-badge-large {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

/* Action button styles */
.card-actions button {
    transition: all 0.2s ease;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    padding: 8px 16px;
}

.card-actions .restart-btn {
    background: #007bff;
    color: white;
}

.card-actions .restart-btn:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-1px);
}

.card-actions .restart-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.card-actions .delete-btn {
    background: #dc3545;
    color: white;
}

.card-actions .delete-btn:hover:not(:disabled) {
    background: #c82333;
    transform: translateY(-1px);
}

.card-actions .delete-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.page-link {
    color: #0071e3;
    text-decoration: none;
    padding: 8px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    margin: 0 6px;
}

.page-current {
    padding: 8px 12px;
    color: #666;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 24px 0;
}

/* Interview Type Selection Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
}

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

.modal-header {
    text-align: center;
    margin-bottom: 40px;
}

.modal-header h2 {
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 10px;
}

.modal-subtitle {
    font-size: 18px;
    color: var(--secondary-color);
}

.interview-type-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.interview-option {
    border: 2px solid #e5e5e5;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.interview-option:hover {
    border-color: var(--accent-color);
    box-shadow: 0 8px 24px rgba(0, 113, 227, 0.15);
    transform: translateY(-5px);
}

.option-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.interview-option h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.interview-option p {
    font-size: 16px;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.option-features {
    list-style: none;
    text-align: left;
    margin-bottom: 25px;
}

.option-features li {
    padding: 8px 0;
    color: var(--secondary-color);
    font-size: 14px;
}

.option-btn {
    width: 100%;
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.option-btn:hover {
    background: #005bb5;
    transform: scale(1.02);
}

/* Text Interview Styles */
.text-interview-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.chat-container {
    background: #f5f5f7;
    border-radius: 20px;
    padding: 30px;
    min-height: 500px;
    max-height: 600px;
    overflow-y: auto;
    margin-bottom: 30px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chat-message {
    margin-bottom: 20px;
    animation: messageSlide 0.3s ease;
}

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

.chat-message.interviewer {
    text-align: left;
}

.chat-message.candidate {
    text-align: right;
}

.message-bubble {
    display: inline-block;
    max-width: 70%;
    padding: 15px 20px;
    border-radius: 18px;
    font-size: 16px;
    line-height: 1.5;
}

.chat-message.interviewer .message-bubble {
    background: white;
    color: var(--primary-color);
    border: 1px solid #e5e5e5;
    text-align: left;
}

.chat-message.candidate .message-bubble {
    background: var(--accent-color);
    color: white;
    text-align: left;
}

.message-sender {
    font-size: 12px;
    color: var(--secondary-color);
    margin-bottom: 5px;
    font-weight: 500;
}

.text-input-area {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.text-input-area textarea {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    max-height: 200px;
    transition: var(--transition);
}

.text-input-area textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.text-input-area button {
    padding: 15px 30px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.text-input-area button:hover:not(:disabled) {
    background: #005bb5;
    transform: scale(1.02);
}

.text-input-area button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.progress-indicator {
    text-align: center;
    margin-bottom: 20px;
    font-size: 16px;
    color: var(--secondary-color);
}

.progress-indicator strong {
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .interview-type-options {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        padding: 30px 20px;
    }
}