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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.setup-section, .interview-section, .summary-section {
    padding: 40px;
}

.language-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.lang-btn {
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 16px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.lang-btn:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.lang-btn h3 {
    color: #2a5298;
    margin-bottom: 10px;
    font-size: 1.8em;
}

.lang-btn p {
    color: #666;
    line-height: 1.6;
    font-size: 0.95em;
}

.process-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.main-selector {
    grid-template-columns: repeat(2, 1fr);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.scor-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.process-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.process-btn:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.length-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.length-btn:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.length-btn h3 {
    color: #2a5298;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.length-btn p {
    color: #666;
    line-height: 1.6;
}

.back-btn-container {
    margin-top: 30px;
    text-align: center;
}

.btn-back {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #e0e0e0;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
}

.btn-back:hover {
    background: #e0e0e0;
    border-color: #999;
    color: #333;
}

.process-btn h3 {
    color: #2a5298;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.process-btn p {
    color: #666;
    line-height: 1.6;
}

.controls {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-top: 2px solid #e0e0e0;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
    z-index: 100;
    margin-top: 20px;
}

.session-info {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

.voice-controls {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
    background: #e74c3c;
}

.btn-primary.recording {
    background: #e74c3c;
    animation: pulse 1.5s infinite;
}

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

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

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

.btn-small {
    padding: 8px 16px;
}

.main-content {
    display: grid;
    gap: 20px;
    padding-bottom: 20px;
}

.transcript-panel {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
}

.transcript-panel h3 {
    color: #2a5298;
    margin-bottom: 15px;
}

.transcript {
    background: white;
    border-radius: 8px;
    padding: 20px;
    min-height: 400px;
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.message {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 8px;
    animation: fadeIn 0.3s;
}

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

.message.user {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.message.assistant {
    background: #f3e5f5;
    border-left: 4px solid #9c27b0;
}

.message .role {
    font-weight: 700;
    margin-bottom: 8px;
    color: #333;
    font-size: 0.9em;
    text-transform: uppercase;
}

.message .content {
    color: #333;
    line-height: 1.6;
}

.message .timestamp {
    font-size: 0.75em;
    color: #999;
    margin-top: 8px;
}

.input-area {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-area input[type="text"] {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
}

.end-interview-container {
    margin-top: 15px;
    text-align: center;
}

.btn-voice {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-voice:hover {
    background: #5568d3;
}

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

.btn-end {
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
}

.btn-end:hover {
    background: #c82333;
}

.input-area input:focus {
    outline: none;
    border-color: #667eea;
}

.status-bar {
    background: #f8f9fa;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e0e0e0;
}

#status {
    font-size: 0.9em;
    color: #666;
}

.audio-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ccc;
    transition: all 0.3s;
}

.audio-indicator.recording {
    background: #e74c3c;
    animation: pulse 1s infinite;
}

.audio-indicator.playing {
    background: #2ecc71;
    animation: pulse 1s infinite;
}

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

.summary-content {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    margin: 20px 0;
    line-height: 1.8;
}

.summary-content h1, .summary-content h2, .summary-content h3 {
    color: #2a5298;
    margin-top: 20px;
    margin-bottom: 10px;
}

.summary-content h1 {
    font-size: 2em;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.summary-content ul, .summary-content ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.diagram-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    overflow-x: auto;
    margin-top: 20px;
}

.icon {
    font-size: 1.2em;
}

#recordBtn.recording {
    background: #e74c3c;
    animation: pulse 1s infinite;
}

#recordBtn.recording .text::after {
    content: ' - Recording...';
}

.email-section {
    background: #f0f8ff;
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
}

.email-section h3 {
    color: #2a5298;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.email-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.email-input-group input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
}

.email-input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.email-status {
    min-height: 24px;
    padding: 8px;
    font-size: 0.9em;
    border-radius: 6px;
}

.email-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.email-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.report-actions {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.feedback-section {
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
}

.feedback-form {
    margin: 30px auto;
}

.form-group {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: #2a5298;
    font-size: 1.05em;
}

.question-desc {
    color: #666;
    font-size: 0.95em;
    margin: 8px 0 15px 0;
    line-height: 1.5;
}

.scale-rating {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.scale-label {
    font-size: 0.85em;
    color: #888;
    font-style: italic;
    flex: 0 0 auto;
}

.scale-options {
    display: flex;
    gap: 15px;
    flex: 1;
    justify-content: center;
}

.scale-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
    color: #666;
}

.scale-options label:hover {
    background: #e3f2fd;
}

.scale-options input[type="radio"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.scale-options input[type="radio"]:checked + label,
.scale-options label:has(input[type="radio"]:checked) {
    background: #667eea;
    color: white;
}

.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    box-sizing: border-box;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input[type="email"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.feedback-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.feedback-actions button {
    flex: 1;
    padding: 14px 24px;
    font-size: 1.05em;
}

.access-control-section {
    max-width: 600px;
    margin: 40px auto;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.access-control-section h2 {
    color: #2a5298;
    margin-bottom: 15px;
}

.access-control-section > p {
    color: #666;
    margin-bottom: 30px;
}

.access-form {
    margin-top: 20px;
}

.access-form .form-group {
    margin-bottom: 20px;
}

.access-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.access-form input[type="email"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    box-sizing: border-box;
}

.access-form input[type="email"]:focus {
    outline: none;
    border-color: #667eea;
}

.access-form button {
    width: 100%;
    padding: 14px;
    font-size: 1.05em;
}

.access-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

.access-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.access-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.footer {
    background: #f0f2f5;
    padding: 15px 40px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

.footer-content {
    font-size: 0.85em;
    color: #666;
}

.footer-content strong {
    color: #2a5298;
    font-weight: 600;
}

.avatar-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin-bottom: 20px;
}

.avatar-wrapper {
    text-align: center;
    position: relative;
}

#avatarImage {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #667eea;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
    transition: all 0.5s ease;
}

#avatarImage.listening {
    transform: scale(1);
    opacity: 0.95;
    border-color: #667eea;
    animation: breathe 3s ease-in-out infinite;
}

#avatarImage.speaking {
    transform: scale(1.05);
    opacity: 1;
    border-color: #2ecc71;
    box-shadow: 0 8px 32px rgba(46, 204, 113, 0.5);
    animation: pulse-speaking 1.2s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 8px 28px rgba(102, 126, 234, 0.4);
    }
}

@keyframes pulse-speaking {
    0%, 100% { 
        transform: scale(1.05);
        box-shadow: 0 8px 32px rgba(46, 204, 113, 0.5);
    }
    50% { 
        transform: scale(1.08);
        box-shadow: 0 12px 40px rgba(46, 204, 113, 0.6);
    }
}

.avatar-state-indicator {
    margin-top: 15px;
    font-size: 0.95em;
    font-weight: 600;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.avatar-state-indicator.speaking {
    color: #2ecc71;
}

.avatar-state-indicator.listening {
    color: #667eea;
}
