/* AI Demo Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Mobile Setup Banner */
.mobile-setup-banner {
    position: sticky;
    top: 0;
    z-index: 1100; /* above navbar to avoid overlap on mobile */
    background: #fff3cd;
    border-bottom: 1px solid #ffe69c;
}

.mobile-setup-banner .banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.mobile-setup-banner .banner-text {
    color: #664d03;
    font-size: 0.9rem;
}

.mobile-setup-banner .banner-dismiss {
    background: none;
    border: none;
    color: #664d03;
    font-size: 1rem;
    cursor: pointer;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: sticky !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: auto;         /* override shared-nav fixed height */
    min-height: 60px;     /* maintain comfortable nav size */
}

.nav-logo h1, .nav-logo h2 {
    color: #667eea;
    font-weight: 700;
    font-size: 1.5rem;
}

.sector-tag {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 1rem;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

/* Mobile hamburger button (hidden on desktop) */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #667eea;
    font-size: 1.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.nav-toggle:focus {
    outline: 2px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

.user-menu { display: flex; align-items: center; gap: 1rem; }

.nav-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #667eea;
}

/* User Authentication Menu */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-weight: 500;
    color: #333;
}

.user-dropdown {
    position: relative;
}

.dropdown-btn {
    background: none;
    border: none;
    color: #667eea;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.dropdown-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

.dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 0.5rem 0;
    display: none;
    z-index: 1001;
}

.dropdown-content.show {
    display: block;
}

.dropdown-content a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    transition: background 0.3s ease;
}

.dropdown-content a:hover {
    background: rgba(102, 126, 234, 0.1);
}

.dropdown-content i {
    width: 16px;
    color: #667eea;
}

.login-link {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.login-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    color: white !important;
}

/* Dashboard Modal Styles */
.dashboard-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.dashboard-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.dashboard-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.dashboard-body {
    padding: 2rem;
    max-height: 60vh;
    overflow-y: auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #e9ecef;
}

.stat-card h3 {
    font-size: 2rem;
    color: #667eea;
    margin: 0 0 0.5rem 0;
}

.stat-card p {
    margin: 0;
    color: #666;
    font-weight: 500;
}

.sessions-list h3 {
    margin-bottom: 1rem;
    color: #333;
}

.session-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.session-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.session-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.team-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.team-member {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    border: 2px solid #e9ecef;
}

.member-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.department {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

.member-stats {
    display: flex;
    gap: 2rem;
    font-size: 0.9rem;
    color: #666;
}

@media (max-width: 768px) {
    .dashboard-content {
        width: 95%;
        margin: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .session-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .member-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Demo Container */
.demo-container {
    margin-top: 16px;
    padding: 2rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    display: grid;
    grid-template-columns: 300px 1fr;
    grid-template-rows: auto;
    grid-template-areas: "panel chat";
    gap: 2rem;
    min-height: calc(100vh - 120px);
}

/* Scenario Panel */
.scenario-panel {
    grid-area: panel;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.scenario-header h3 {
    margin: 0 0 8px 0;
    font-size: 1.2em;
    font-weight: 600;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid #667eea;
    border-radius: 8px;
    color: #667eea;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(102, 126, 234, 0.2);
}

.sector-selection {
    margin-bottom: 1rem;
}

.sector-dropdown {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-family: inherit;
    font-size: 0.95rem;
}

.scenario-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 600px;
    overflow-y: auto;
}

.scenario-item {
    padding: 1rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.scenario-item:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.scenario-item.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
}

.scenario-item h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 0.95rem;
    font-weight: 600;
}

.scenario-item p {
    margin: 0;
    color: #666;
    font-size: 0.85rem;
    line-height: 1.4;
}

.scenario-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

.difficulty-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
}

.difficulty-1 { background: #e8f5e8; color: #2e7d32; }
.difficulty-2 { background: #fff3e0; color: #f57c00; }
.difficulty-3 { background: #e3f2fd; color: #1976d2; }
.difficulty-4 { background: #fce4ec; color: #c2185b; }
.difficulty-5 { background: #f3e5f5; color: #7b1fa2; }

.voice-tone-badge {
    padding: 0.25rem 0.5rem;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-radius: 12px;
    font-weight: 500;
}

.session-controls {
    padding: 1rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.current-scenario h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1rem;
}

.current-scenario p {
    margin: 0 0 1rem 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.session-buttons {
    display: flex;
    gap: 0.75rem;
}

.btn-primary, .btn-danger {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

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

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

/* Avatar Container */
.avatar-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
}

#avatar-canvas {
    flex: 1;
    border-radius: 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    position: relative;
    min-height: 400px;
}

.avatar-status {
    margin-top: 1rem;
    text-align: center;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 20px;
    color: #4caf50;
    font-size: 0.9rem;
}

.status-indicator.speaking {
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800;
}

.status-indicator.listening {
    background: rgba(33, 150, 243, 0.1);
    color: #2196f3;
}

.status-indicator i {
    font-size: 0.8rem;
}

/* Chat Container */
.chat-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border-radius: 25px;
    padding: 0.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Disabled state for chat controls */
.chat-input-wrapper.controls-disabled {
    opacity: 0.6;
    filter: grayscale(0.1);
}
.chat-input-wrapper.controls-disabled .voice-btn,
.chat-input-wrapper.controls-disabled .send-btn {
    cursor: not-allowed;
}
.voice-btn:disabled,
.send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}
.chat-input-wrapper.controls-disabled input::placeholder {
    color: #9ca3af; /* muted */
}

.chat-input-wrapper .voice-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-input-wrapper .voice-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.chat-input-wrapper .voice-btn.listening {
    background: linear-gradient(135deg, #ff4757, #ff3838);
    animation: pulse 1.5s infinite;
}

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

.chat-container {
    grid-area: chat;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.chat-header .avatar-status {
    display: flex;
    align-items: center;
}

.chat-header .status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.chat-header .status-indicator i {
    color: #4caf50;
    font-size: 0.75rem;
}

.chat-header .status-indicator.speaking i {
    color: #ff4757;
    animation: pulse 1s infinite;
}

.chat-header .status-indicator.processing i {
    color: #ff9800;
    animation: pulse 1s infinite;
}

.chat-header h4 {
    color: #333;
    font-weight: 600;
}

.voice-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.voice-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-btn:hover {
    transform: scale(1.05);
}

.voice-btn.listening {
    background: linear-gradient(135deg, #ff4757, #ff3838);
    animation: pulse 1.5s infinite;
}

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

.voice-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.voice-info span {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.voice-info small {
    color: #666;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Feedback Panel */
.feedback-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1rem;
    margin-top: 1rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.feedback-header h5 {
    margin: 0;
    color: #333;
    font-weight: 600;
}

.current-score {
    font-weight: 600;
    color: #667eea;
}

.feedback-content {
    color: #666;
    line-height: 1.5;
}

.feedback-content p {
    margin: 0;
    font-size: 0.9rem;
}

.score-good { color: #4caf50; }
.score-average { color: #ff9800; }
.score-poor { color: #f44336; }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
    max-height: 400px;
}

.message {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-message .message-avatar {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
}

.message-content {
    flex: 1;
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 15px;
    border-top-left-radius: 5px;
}

.user-message .message-content {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-top-right-radius: 5px;
    border-top-left-radius: 15px;
}

.chat-input-container {
    margin-top: 1rem;
}

.chat-input-wrapper {
    display: flex;
    gap: 0.5rem;
}

#chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 20px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    background: transparent;
    transition: all 0.3s ease;
}

#chat-input:focus {
    border-color: #667eea;
}

.send-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    transform: scale(1.05);
}

.input-status {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #666;
    min-height: 20px;
}

/* Typing Indicator */
.typing-indicator {
    opacity: 0.8;
}

.typing-content {
    background: #f0f0f0 !important;
    padding: 1rem !important;
    border-radius: 15px !important;
    border-top-left-radius: 5px !important;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 20px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

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

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content.large {
    max-width: 800px;
}

.modal-header {
    padding: 2rem 2rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.modal-body {
    padding: 2rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

/* Summary Styles */
.summary-content {
    line-height: 1.6;
}

.summary-score {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 15px;
    margin-bottom: 2rem;
}

.summary-score h2 {
    margin: 0 0 0.5rem 0;
    font-size: 3rem;
}

.summary-score p {
    margin: 0;
    opacity: 0.9;
}

.summary-section {
    margin-bottom: 2rem;
}

.summary-section h4 {
    color: #333;
    margin-bottom: 1rem;
    font-weight: 600;
}

.interaction-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.interaction-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.interaction-score {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.interaction-score strong {
    color: #333;
}

.score-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
}

.score-excellent { background: #e8f5e8; color: #2e7d32; }
.score-good { background: #e3f2fd; color: #1976d2; }
.score-satisfactory { background: #fff3e0; color: #f57c00; }
.score-needs-improvement { background: #fce4ec; color: #c2185b; }
.score-poor { background: #ffebee; color: #d32f2f; }

/* Objectives Summary Styles */
.objectives-summary {
    margin-top: 1rem;
}

.completed-objectives, .incomplete-objectives {
    margin-bottom: 1.5rem;
}

.completed-objectives h5, .incomplete-objectives h5 {
    margin: 0 0 0.75rem 0;
    font-weight: 600;
    font-size: 1rem;
}

.completed-objectives h5 {
    color: #2e7d32;
}

.incomplete-objectives h5 {
    color: #d32f2f;
}

.completed-objectives ul, .incomplete-objectives ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.objective-completed, .objective-incomplete {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.objective-completed {
    background: #e8f5e8;
    border-left: 4px solid #2e7d32;
}

.objective-incomplete {
    background: #ffebee;
    border-left: 4px solid #d32f2f;
    flex-direction: column;
    align-items: flex-start;
}

.objective-completed strong, .objective-incomplete strong {
    color: #333;
    font-weight: 600;
}

.completion-time {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

.objective-desc {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
}

.loading-spinner i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 1rem;
}

/* Scenario Context Panel - Compact Design */
.scenario-context-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
    overflow: hidden;
    transition: all 0.3s ease;
}

.context-header {
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.context-info {
    flex: 1;
    min-width: 0;
}

.scenario-title {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scenario-details {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.scenario-sector, .scenario-difficulty {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.objectives-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

.objectives-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-weight: 600;
}

.mini-progress-bar {
    width: 60px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.mini-progress-fill {
    height: 100%;
    background: #28a745;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.context-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.scenario-description {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    font-size: 0.9rem;
    line-height: 1.4;
    color: #333;
}

.character-info {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0 6px 6px 0;
    font-style: italic;
    color: #555;
}

.objectives-section {
    padding: 0.75rem 1.25rem 1rem;
}

.objectives-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.objectives-heading i {
    color: #667eea;
    margin-right: 0.5rem;
}

.objectives-toggle-btn {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.objectives-toggle-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.1);
}

.objectives-list {
    display: grid;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.objectives-list.collapsed {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}

.objective-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.objective-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.objective-item.completed {
    background: #f0f9f0;
    border-color: #28a745;
}

.objective-checkbox {
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
    transition: all 0.2s ease;
    font-size: 0.7rem;
}

.objective-item.completed .objective-checkbox {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.objective-content {
    flex: 1;
    min-width: 0;
}

.objective-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.objective-description {
    color: #666;
    font-size: 0.8rem;
    line-height: 1.3;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Make navbar participate in layout to avoid overlapping content */
    .navbar { position: sticky; top: 0; }
    /* Reduce overall top spacing since navbar is no longer fixed */
    .demo-container { margin-top: 16px; height: auto; }

    .nav-container {
        padding: 0 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
        height: auto;          /* override shared-nav fixed height */
        min-height: 60px;      /* keep a comfortable min height */
    }

    /* Show hamburger, collapse menu */
    .nav-toggle { display: block; margin-left: auto; }

    .nav-menu {
        display: none;           /* collapsed by default */
        flex-direction: column;  /* vertical list */
        gap: 0.5rem;
        width: 100%;
        overflow: visible;       /* no scrollbar */
        white-space: normal;     /* allow wrapping */
        padding-top: 0.5rem;
    }

    .nav-menu.open { display: flex; }

    .nav-link { display: block; width: 100%; }

    .user-menu { margin-left: auto; }

    .nav-logo h1, .nav-logo h2 { font-size: 1.25rem; }
    .nav-menu { gap: 0.75rem; }
    .nav-link { font-size: 0.95rem; }

    .context-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .objectives-summary {
        align-self: flex-end;
    }
    
    .scenario-details {
        gap: 0.5rem;
    }
    
    .objectives-list {
        max-height: 150px;
    }
}

/* Learning Objectives Panel - Enhanced */
.objectives-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    overflow: hidden;
    display: none;
    transition: all 0.3s ease;
}

.objectives-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.2);
}

.objectives-header {
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.objectives-title {
    font-weight: 700;
    color: white;
    margin: 0;
    font-size: 1.1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.objectives-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.objectives-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.objectives-content {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    font-style: italic;
}

.objectives-list {
    margin-bottom: 1rem;
}

.objective-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e4ff;
    transition: all 0.3s ease;
}

.objective-item.completed {
    background: #f0f9f0;
    border-color: #28a745;
}

.objective-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.3s ease;
}

.objective-item.completed .objective-checkbox {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.objective-content {
    flex: 1;
}

.objective-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.objective-item.completed .objective-title {
    color: #28a745;
}

.objective-description {
    color: #666;
    font-size: 0.8rem;
    line-height: 1.4;
}

.objectives-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e4ff;
}

.progress-text {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.progress-count {
    font-weight: 700;
    color: #667eea;
    font-size: 0.9rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e0e4ff;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #28a745);
    transition: width 0.5s ease;
    border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .demo-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        grid-template-areas:
            "panel"
            "chat";
        height: auto;
    }
    
    .scenario-list {
        max-height: 200px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
}

@media (max-width: 768px) {
    .demo-container {
        padding: 1rem;
        gap: 1rem;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .scenario-buttons {
        flex-direction: column;
    }
    
    .chat-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .main-container {
        flex-direction: column;
        padding: 1rem;
    }
    
    .sidebar {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .chat-container {
        margin: 0;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-logo h2 {
        font-size: 1.2rem;
    }
}

/* Custom Scenario Modal - Objectives Section */
.form-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%);
    border: 1px solid #d1e7ff;
    border-radius: 12px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.section-title i {
    color: #667eea;
    font-size: 1.2rem;
}

.section-subtitle {
    display: block;
    font-size: 0.85rem;
    font-weight: 400;
    color: #666;
    margin-top: 0.25rem;
    margin-left: 1.7rem;
}

.objective-item {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.objective-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.objective-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.objective-number {
    font-weight: 600;
    color: #667eea;
    font-size: 1rem;
}

.remove-objective-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.remove-objective-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.objective-title-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.objective-title-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.objective-desc-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.4;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.3s ease;
}

.objective-desc-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.objectives-help {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    margin-top: 1rem;
}

.objectives-help i {
    color: #667eea;
    font-size: 1.1rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.objectives-help span {
    color: #555;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Modal adjustments for larger content */
.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

.modal-body {
    max-height: calc(90vh - 120px);
    overflow-y: auto;
    padding: 1.5rem;
}

/* Sticky Session Footer (mobile-first) */
.session-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 0.5rem 1rem;
    display: none; /* default hidden on desktop */
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    z-index: 1050;
}
.session-footer .footer-status { display: flex; align-items: baseline; gap: 0.5rem; color: #374151; }
.session-footer #footer-timer { font-variant-numeric: tabular-nums; color: #6b7280; font-weight: 600; }

/* Make room so footer doesn't cover input; show footer on small/medium screens */
@media (max-width: 1024px) {
    .demo-container { padding-bottom: 84px; }
    .session-footer { display: flex; }
}

/* Compact stepper further on smaller screens and wrap status below */
@media (max-width: 900px) {
    .session-stepper { flex-wrap: wrap; }
    .session-stepper .stepper-status { flex-basis: 100%; margin-left: 0; margin-top: 0.25rem; }
    .session-stepper .step { padding-right: 12px; }
    .session-stepper .step:not(:last-child)::after { width: 12px; }
}

@media (max-width: 480px) {
    .session-stepper { padding: 0.25rem 0.4rem; gap: 0.35rem; }
    .session-stepper .step-index { width: 16px; height: 16px; line-height: 16px; font-size: 0.7rem; }
    .session-stepper .step-label { font-size: 0.75rem; }
}

/* Responsive adjustments for objectives */
@media (max-width: 768px) {
    .form-section {
        margin: 1rem 0;
        padding: 1rem;
    }
    
    .objective-item {
        padding: 1rem;
    }
    
    .section-subtitle {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    .objective-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
