/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background: #f7fafc;
    font-size: 16px;
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 95%;
    margin: 0 auto;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.logo-text {
    font-size: 1.8rem;
    font-weight: bold;
}

.header-info {
    text-align: right;
}

.institution {
    font-size: 1rem;
    opacity: 0.9;
}

/* Tab Navigation */
.tab-navigation {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 2rem;
    display: flex;
    gap: 1rem;
    max-width: 95%;
    margin: 0 auto;
    width: 100%;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-weight: 500;
    color: #718096;
}

.tab-btn:hover:not(:disabled) {
    color: #667eea;
    background: #f7faff;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #f7faff;
}

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

/* Tab Content */
.tab-content-container {
    flex: 1;
    max-width: 95%;
    margin: 0 auto;
    width: 100%;
    padding: 2rem;
}

.tab-content {
    display: none;
}

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

/* Selection Tab */
.selection-header {
    text-align: center;
    margin-bottom: 3rem;
}

.selection-header h1 {
    font-size: 3rem;
    color: #2d3748;
    margin-bottom: 1rem;
}

.selection-subtitle {
    font-size: 1.4rem;
    color: #718096;
    max-width: 80%;
    margin: 0 auto;
}

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

/* Avatar Cards */
.avatar-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    overflow: hidden;
}

.avatar-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 1.5rem;
    font-weight: bold;
}

.card-body {
    padding: 1.5rem;
}

.card-description {
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.card-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.detail-label {
    font-weight: 600;
    color: #2d3748;
    font-size: 1rem;
}

.detail-value {
    color: #4a5568;
    text-align: right;
    flex: 1;
    margin-left: 1rem;
    font-size: 1rem;
}

.difficulty {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.difficulty.intermediate {
    background: #fed7d7;
    color: #c53030;
}

.difficulty.advanced {
    background: #fbb6ce;
    color: #97266d;
}

.card-footer {
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.select-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

/* Practice Tab */
.practice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.practice-info h2 {
    font-size: 2.5rem;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.practice-info p {
    color: #718096;
    font-size: 1.2rem;
}

.practice-controls {
    display: flex;
    gap: 1rem;
}

.control-btn {
    background: white;
    border: 2px solid #e2e8f0;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.control-btn:hover:not(:disabled) {
    border-color: #667eea;
    color: #667eea;
}

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

/* Demo Section */
.practice-demo-section {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.demo-content h3 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.demo-details {
    margin-bottom: 1.5rem;
}

.demo-tips h4 {
    color: #4a5568;
    margin-bottom: 0.75rem;
}

.demo-tips ul {
    list-style: none;
    padding-left: 0;
}

.demo-tips li {
    padding: 0.5rem 0;
    color: #4a5568;
    position: relative;
    padding-left: 1.5rem;
}

.demo-tips li:before {
    content: "✓";
    color: #48bb78;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Practice Tips List */
#practice-tips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0.5rem;
}

/* iFrame Container */
.iframe-container {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    height: 700px;
    position: relative;
    overflow: hidden;
}

#practice-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.loading-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #718096;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* About Tab */
.about-content {
    max-width: 90%;
    margin: 0 auto;
}

.about-content h1 {
    font-size: 3rem;
    color: #2d3748;
    margin-bottom: 2rem;
    text-align: center;
}

.about-section {
    margin-bottom: 3rem;
}

.about-section h2 {
    font-size: 2rem;
    color: #4a5568;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.about-section p {
    font-size: 1.2rem;
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.framework-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.framework-item {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.framework-item h3 {
    color: #667eea;
    margin-bottom: 0.75rem;
}

.outcomes-list {
    list-style: none;
    padding: 0;
}

.outcomes-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
    padding-left: 2rem;
}

.outcomes-list li:before {
    content: "🎯";
    position: absolute;
    left: 0;
}

.creator-info {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.creator-info a {
    color: #667eea;
    text-decoration: none;
}

.creator-info a:hover {
    text-decoration: underline;
}

.tech-info {
    background: #f0fff4;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #48bb78;
}

.tech-info p {
    margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-header {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .tab-navigation {
        padding: 0 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    .tab-content-container {
        padding: 1rem;
    }
    
    .selection-header h1 {
        font-size: 2.5rem;
    }
    
    .avatar-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .practice-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .practice-controls {
        justify-content: center;
    }
    
    .iframe-container {
        height: 500px;
    }
    
    #practice-tips {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 1.2rem;
    }
    
    .selection-header h1 {
        font-size: 1.8rem;
    }
    
    .selection-subtitle {
        font-size: 1.1rem;
    }
    
    .card-icon {
        font-size: 2.5rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .practice-info h2 {
        font-size: 2rem;
    }
    
    .iframe-container {
        height: 400px;
    }
}

/* Instructions Panel Styles */
.instructions-panel {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.instructions-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.instructions-header h3 {
    margin: 0;
    font-size: 1.5em;
}

.instruction-toggle {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 25px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.instruction-toggle:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}

.instructions-content {
    padding: 0;
}

.instruction-tabs {
    display: flex;
    background: #e9ecef;
    border-bottom: 1px solid #dee2e6;
}

.instruction-tab {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    color: #6c757d;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.instruction-tab.active {
    background: white;
    color: #28a745;
    border-bottom-color: #28a745;
}

.instruction-tab:hover:not(.active) {
    background: #f8f9fa;
    color: #495057;
}

.instruction-content {
    display: none;
    padding: 30px;
}

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

.instruction-section {
    margin-bottom: 25px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    border-left: 4px solid #28a745;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.instruction-section h5 {
    margin-top: 0;
    color: #28a745;
    font-size: 1.2em;
    margin-bottom: 15px;
}

.instruction-section ul {
    margin: 0;
    padding-left: 20px;
}

.instruction-section li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.assessment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.assessment-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #17a2b8;
}

.assessment-item strong {
    color: #17a2b8;
    display: block;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.assessment-item ul {
    margin: 0;
    padding-left: 15px;
}

.objective-list {
    background: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #ffc107;
    font-style: italic;
}

/* Avatar Session Styles */
.avatar-session {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.session-header {
    background: linear-gradient(135deg, #6f42c1 0%, #e83e8c 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 13px 13px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.session-info h3 {
    margin: 0;
    font-size: 1.4em;
}

.session-info p {
    margin: 5px 0 0 0;
    opacity: 0.9;
}

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

.control-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    white-space: nowrap;
}

.control-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-1px);
}

/* Enhanced Responsive Design for Instructions */
@media (max-width: 768px) {
    .instructions-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .instruction-tabs {
        flex-direction: column;
    }
    
    .assessment-grid {
        grid-template-columns: 1fr;
    }
    
    .session-header {
        flex-direction: column;
        text-align: center;
    }
    
    .session-controls {
        justify-content: center;
    }
}