/* Interview Simulator Styles */

/* Hero Section */
.simulator-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 50px 20px;
    text-align: center;
}

.simulator-hero h1 {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.simulator-hero p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Container */
.simulator-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Progress Bar */
.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 40px;
    padding: 20px;
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.progress-step.active {
    opacity: 1;
}

.progress-step.completed {
    opacity: 1;
}

.progress-step.completed .step-number {
    background: #22c55e;
    color: #fff;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: all 0.3s ease;
}

.progress-step.active .step-number {
    background: #667eea;
    color: #fff;
    transform: scale(1.1);
}

.step-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.progress-line {
    width: 60px;
    height: 3px;
    background: var(--border);
    margin: 0 8px;
}

@media (max-width: 600px) {
    .progress-line {
        width: 20px;
    }
    .step-label {
        font-size: 0.7rem;
    }
}

/* Step Sections */
.step-section {
    display: none;
}

.step-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Configuration Card - Step 1 */
.config-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
}

.config-card h2 {
    text-align: center;
    margin-bottom: 32px;
    color: var(--text);
}

.config-group {
    margin-bottom: 28px;
}

.config-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

/* Role Selector */
.role-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.role-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--background);
    cursor: pointer;
    transition: all 0.2s ease;
}

.role-btn:hover {
    border-color: #667eea;
}

.role-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.role-icon {
    font-size: 2rem;
}

/* Level Selector */
.level-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.level-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--background);
    cursor: pointer;
    transition: all 0.2s ease;
}

.level-btn:hover {
    border-color: #667eea;
}

.level-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.level-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.level-badge.fresher {
    background: #dcfce7;
    color: #166534;
}

.level-badge.junior {
    background: #fef3c7;
    color: #92400e;
}

.level-badge.senior {
    background: #fee2e2;
    color: #991b1b;
}

.level-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Question Count Selector */
.question-count-selector {
    display: flex;
    gap: 12px;
}

.count-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--background);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.count-btn:hover {
    border-color: #667eea;
}

.count-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: #fff;
}

/* AI Mode Selector */
.ai-mode-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.ai-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--background);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-btn:hover {
    border-color: #667eea;
}

.ai-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.ai-icon {
    font-size: 2rem;
}

.ai-name {
    font-weight: 600;
}

.ai-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* API Key Input */
.api-key-group {
    background: var(--background);
    padding: 16px;
    border-radius: 12px;
    border: 1px dashed var(--border);
}

.api-key-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--surface);
    color: var(--text);
}

.api-key-group small {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 8px;
    display: block;
}

/* Start Button */
.btn-start {
    width: 100%;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Interview Card - Step 2 */
.interview-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
}

.interview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.question-counter {
    font-size: 1rem;
    color: var(--text-secondary);
}

.question-counter span {
    font-weight: 700;
    color: #667eea;
}

.timer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--background);
    border-radius: 20px;
    font-weight: 600;
}

.timer.warning {
    background: #fef3c7;
    color: #92400e;
}

.timer.danger {
    background: #fee2e2;
    color: #991b1b;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.question-category {
    display: inline-block;
    padding: 4px 12px;
    background: #667eea;
    color: #fff;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 16px;
}

.question-text {
    font-size: 1.3rem;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 24px;
}

.answer-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

.answer-section textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    background: var(--background);
    color: var(--text);
    font-family: inherit;
    transition: border-color 0.2s;
}

.answer-section textarea:focus {
    outline: none;
    border-color: #667eea;
}

.char-count {
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.interview-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-skip {
    flex: 1;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 500;
    background: var(--background);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-skip:hover {
    background: var(--border);
}

.btn-next {
    flex: 2;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Evaluating Card - Step 3 */
.evaluating-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 60px 32px;
    text-align: center;
}

.loading-animation {
    margin-bottom: 24px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.evaluating-card h2 {
    margin-bottom: 12px;
    color: var(--text);
}

.evaluating-card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.evaluating-progress {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    max-width: 400px;
    margin: 0 auto;
}

.evaluating-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
}

/* Results Card - Step 4 */
.results-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
}

.results-header {
    text-align: center;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

.score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: #fff;
}

.score-value {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

.score-label {
    font-size: 1rem;
    opacity: 0.8;
}

.result-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 600;
}

.result-status.pass { color: #22c55e; }
.result-status.improve { color: #f59e0b; }
.result-status.fail { color: #ef4444; }

.results-summary {
    margin-bottom: 32px;
}

.results-summary h3 {
    margin-bottom: 16px;
    color: var(--text);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.summary-item {
    background: var(--background);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.summary-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.results-details h3 {
    margin-bottom: 16px;
    color: var(--text);
}

.questions-feedback {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feedback-item {
    background: var(--background);
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid var(--border);
}

.feedback-item.good { border-left-color: #22c55e; }
.feedback-item.medium { border-left-color: #f59e0b; }
.feedback-item.bad { border-left-color: #ef4444; }

.feedback-question {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.feedback-score {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.feedback-item.good .feedback-score {
    background: #dcfce7;
    color: #166534;
}

.feedback-item.medium .feedback-score {
    background: #fef3c7;
    color: #92400e;
}

.feedback-item.bad .feedback-score {
    background: #fee2e2;
    color: #991b1b;
}

.feedback-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.results-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.btn-retry,
.btn-share {
    flex: 1;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-retry {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
}

.btn-retry:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-share {
    background: var(--background);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-share:hover {
    background: var(--border);
}

/* History Sidebar */
.history-sidebar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
}

.history-toggle {
    writing-mode: vertical-rl;
    padding: 12px 8px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    font-weight: 500;
}

.history-content {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    width: 280px;
    max-height: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: none;
    overflow-y: auto;
}

.history-content.active {
    display: block;
}

.history-content h4 {
    margin-bottom: 12px;
    color: var(--text);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    padding: 12px;
    background: var(--background);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.history-item:hover {
    background: var(--border);
}

.history-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.history-info {
    font-weight: 500;
    margin-top: 4px;
}

.history-score {
    color: #667eea;
    font-weight: 700;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .role-selector,
    .level-selector {
        grid-template-columns: 1fr;
    }
    
    .ai-mode-selector {
        grid-template-columns: 1fr;
    }
    
    .question-count-selector {
        flex-direction: column;
    }
    
    .interview-actions {
        flex-direction: column;
    }
    
    .btn-skip,
    .btn-next {
        flex: none;
        width: 100%;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .history-sidebar {
        display: none;
    }
}
