/* Language Selector Styles */
.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 5px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 5px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.lang-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.lang-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.lang-btn i {
    font-size: 0.8rem;
}

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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    margin: 20px 0;
    padding: 30px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.5rem;
    color: #667eea;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: #666;
    font-size: 1.1rem;
    font-weight: 400;
}

/* Navigation Breadcrumb */
.nav-breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    font-size: 0.9rem;
}

.breadcrumb-link {
    color: #667eea;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}

.breadcrumb-link:hover {
    color: #764ba2;
}

.breadcrumb-separator {
    color: #999;
}

.breadcrumb-current {
    color: #666;
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.welcome-section {
    text-align: center;
    margin-bottom: 40px;
}

.welcome-section h2 {
    font-size: 2.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.welcome-section p {
    font-size: 1.1rem;
    color: #666;
}

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

.page-header h2 {
    font-size: 2.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.page-header p {
    font-size: 1.1rem;
    color: #666;
}

/* Experiment Grid */
.experiment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.experiment-card {
    background: white;
    border-radius: 15px;
    padding: 30px 25px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.experiment-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.experiment-card.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.experiment-card.active .experiment-icon i {
    color: white;
}

.experiment-icon {
    margin-bottom: 20px;
}

.experiment-icon i {
    font-size: 3rem;
    color: #667eea;
    transition: color 0.3s ease;
}

.experiment-card h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.experiment-card p {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.experiment-card.active p {
    color: rgba(255, 255, 255, 0.9);
}

.default-badge, .coming-soon {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    position: absolute;
    top: 15px;
    right: 15px;
}

.default-badge {
    background: #4CAF50;
    color: white;
}

.coming-soon {
    background: #ff9800;
    color: white;
}

/* Action Section */
.action-section {
    text-align: center;
}

.start-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* Function Navigation */
.function-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 15px;
    overflow-x: auto;
}

.nav-btn {
    background: transparent;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
    min-width: fit-content;
}

.nav-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.nav-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

/* Function Panels */
.function-content {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.function-panel {
    display: none;
}

.function-panel.active {
    display: block;
}

.panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.panel-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-content {
    padding: 30px;
}

/* Description Content */
.description-content h4 {
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 25px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

.description-content h4:first-child {
    margin-top: 0;
}

.description-content p {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.7;
}

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

.description-content li {
    color: #666;
    margin-bottom: 8px;
    line-height: 1.6;
}

.description-content strong {
    color: #333;
    font-weight: 600;
}

/* Phases Grid */
.phases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.phase-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #667eea;
    transition: transform 0.3s ease;
}

.phase-card:hover {
    transform: translateY(-2px);
}

.phase-card h5 {
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.phase-card p {
    color: #666;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.phase-duration {
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Parameters Grid */
.parameters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 25px 0;
}

.parameter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.parameter-name {
    font-weight: 600;
    color: #333;
}

.parameter-desc {
    color: #666;
    font-size: 0.9rem;
}

/* Upload Section */
.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f8f9fa;
}

.upload-area:hover {
    border-color: #764ba2;
    background: rgba(102, 126, 234, 0.05);
}

.upload-area.dragover {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.upload-content i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 20px;
}

.upload-content h4 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.upload-content p {
    color: #666;
    margin-bottom: 20px;
}

.browse-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.browse-btn:hover {
    background: #764ba2;
    transform: translateY(-2px);
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #e8f5e8;
    border: 1px solid #4CAF50;
    border-radius: 10px;
    padding: 15px 20px;
    margin-top: 15px;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-details i {
    font-size: 1.5rem;
    color: #4CAF50;
}

.file-name {
    font-weight: 600;
    color: #333;
}

.file-size {
    color: #666;
    font-size: 0.9rem;
}

.remove-file {
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-file:hover {
    background: #cc0000;
}

/* Group Names Section */
.group-names-section {
    margin-bottom: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #667eea;
}

.group-names-section h4 {
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.section-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
    font-style: italic;
}

.group-names-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.group-name-field {
    display: flex;
    flex-direction: column;
}

.group-name-field label {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.group-name-field input {
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

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

.group-name-field input::placeholder {
    color: #999;
    font-style: italic;
}

/* Plot Modes */
.plot-modes {
    margin-bottom: 30px;
}

.mode-selection {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.mode-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    font-weight: 500;
    color: #666;
}

.mode-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.mode-btn i {
    font-size: 1.5rem;
}

.mode-btn span {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Plot Options (Legacy - keeping for compatibility) */
.plot-options {
    margin-bottom: 30px;
}

.plot-options h4 {
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.option-item:hover {
    background: #f8f9fa;
}

.option-item input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.option-item input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.option-item input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Generate Section */
.generate-section {
    text-align: center;
    margin-bottom: 30px;
}

.generate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 35px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* Plots Container */
.plots-container h4 {
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.plot-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.plot-placeholder {
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    color: #666;
}

.plot-placeholder i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 15px;
}

/* AI Analysis */
.ai-analysis-intro {
    background: #e3f2fd;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    border-left: 4px solid #2196F3;
}

.ai-analysis-intro p {
    color: #1976D2;
    margin: 0;
}

.analysis-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.analysis-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.analysis-section h4 {
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.placeholder-content {
    color: #666;
}

.placeholder-content i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 10px;
}

.ai-controls {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
}

.api-key-section {
    margin-bottom: 20px;
}

.api-key-section label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.api-key-section input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 8px;
}

.api-key-section small {
    color: #666;
    font-size: 0.9rem;
}

.api-key-section small a {
    color: #667eea;
    text-decoration: none;
}

.api-key-section small a:hover {
    text-decoration: underline;
}

.api-info {
    background: #e3f2fd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #2196F3;
}

.api-info p {
    color: #1976D2;
    margin: 0 0 5px 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.api-info small {
    color: #1565C0;
    font-size: 0.9rem;
}

/* AI Options */
.ai-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.ai-option-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.ai-option-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.ai-option-icon {
    margin-bottom: 15px;
}

.ai-option-icon i {
    font-size: 2.5rem;
    color: #667eea;
}

.ai-option-card h4 {
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.ai-option-card p {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.ai-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

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

.chatbot-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
}

.chatbot-btn:hover {
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.report-btn {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    box-shadow: 0 2px 10px rgba(255, 152, 0, 0.3);
}

.report-btn:hover {
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

/* Chatbot Modal */
.chatbot-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.chatbot-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    min-width: 400px;
    height: 600px; /* Fixed height instead of 80vh */
    max-height: 600px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    position: relative;
    transition: all 0.3s ease;
    user-select: none;
    overflow: hidden; /* Prevent content from overflowing */
}

.chatbot-content.dragging {
    transition: none;
}

.chatbot-content.zoomed {
    transform-origin: center center;
}

.chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.chatbot-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.chatbot-zoom-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
}

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

.chatbot-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    min-height: 0; /* Important for flex child to shrink */
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
    max-height: calc(600px - 140px); /* Fixed height minus header and input area */
    min-height: 300px;
    box-sizing: border-box;
}

.message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.user-message {
    justify-content: flex-end;
}

.user-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 5px 15px;
    max-width: 70%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.ai-message .message-content {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-radius: 15px 15px 15px 5px;
    max-width: 80%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message-content {
    padding: 12px 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0; /* Allow flex item to shrink */
    box-sizing: border-box;
}

.message-content i {
    margin-top: 2px;
    font-size: 1rem;
    color: #667eea;
}

.user-message .message-content i {
    color: white;
}

.message-content p {
    margin: 0;
    line-height: 1.5;
    font-size: 0.95rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap; /* Preserve line breaks and wrap text */
    max-width: 100%;
    overflow: hidden;
}

.chat-input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.chat-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#chat-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s ease;
}

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

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

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.chat-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.chat-action-btn {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-action-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
    color: #666;
    font-style: italic;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #667eea;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Group Selection Styles */
.group-selection-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    border-left: 4px solid #667eea;
}

.group-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.group-selection-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.group-selection-item:hover {
    border-color: #667eea;
}

.group-selection-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.group-selection-item label {
    flex: 1;
    margin: 0;
    font-weight: 500;
    color: #333;
    cursor: pointer;
}

.group-selection-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.selection-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.selection-btn:hover {
    background: #764ba2;
    transform: translateY(-1px);
}

.selection-btn.primary {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.selection-btn.primary:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
}


.analyze-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 15px 35px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
}

.analysis-results {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
}

.analysis-results h4 {
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.loading-spinner {
    text-align: center;
    color: #666;
}

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

/* PPT Section */
.ppt-intro {
    background: #fff3e0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    border-left: 4px solid #FF9800;
}

.ppt-intro p {
    color: #F57C00;
    margin: 0;
}

.ppt-sections {
    margin-bottom: 30px;
}

.ppt-section {
    margin-bottom: 30px;
}

.ppt-section h4 {
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.template-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.template-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.template-card i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 10px;
}

.template-card h5 {
    color: #333;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.template-card p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

.content-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.customization-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.custom-field {
    display: flex;
    flex-direction: column;
}

.custom-field label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.custom-field input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.generate-ppt {
    text-align: center;
}

.generate-ppt-btn {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    border: none;
    padding: 15px 35px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

.generate-ppt-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.6);
}

.ppt-status {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    margin-top: 20px;
}

.status-content {
    color: #666;
}

.status-content i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 15px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header {
        padding: 20px;
        margin: 15px 0;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .experiment-grid {
        grid-template-columns: 1fr;
    }
    
    .function-nav {
        flex-direction: column;
        gap: 5px;
    }
    
    .nav-btn {
        justify-content: center;
    }
    
    .phases-grid,
    .parameters-grid {
        grid-template-columns: 1fr;
    }
    
    .options-grid,
    .content-options {
        grid-template-columns: 1fr;
    }
    
    .template-grid {
        grid-template-columns: 1fr;
    }
    
    .customization-options {
        grid-template-columns: 1fr;
    }
}

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

.fa-spin {
    animation: spin 1s linear infinite;
}

/* Plot and Table Styles */
.plot-container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.plot-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.plot-header h4 {
    color: #333;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.plot-header p {
    color: #666;
    font-size: 0.95rem;
    margin: 0;
}

.plot-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

#mpe-plot {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
}

/* Data Tables */
.data-tables {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-top: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.tables-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.tables-header h4 {
    color: #333;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.tables-content {
    display: grid;
    gap: 25px;
}

.summary-tables {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.group-tables {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.averages-table {
    max-width: 400px;
    margin: 0 auto;
}

.table-container {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border-left: 4px solid #667eea;
}

.table-container h5 {
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.data-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.data-table th {
    padding: 12px 15px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
    color: #333;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
    transform: scale(1.01);
    transition: all 0.2s ease;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

.notification-success {
    background: #4CAF50;
    color: white;
}

.notification-error {
    background: #f44336;
    color: white;
}

.notification-warning {
    background: #ff9800;
    color: white;
}

.notification-info {
    background: #2196F3;
    color: white;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Responsive Table Styles */
@media (max-width: 768px) {
    .summary-tables,
    .group-tables {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 0.85rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    #mpe-plot {
        width: 100%;
        height: 300px;
    }
}

/* Help Button and Modal */
.help-button {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.help-button:hover {
    background: #764ba2;
    transform: scale(1.1);
}

.help-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.help-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-content {
    background: white;
    border-radius: 15px;
    padding: 0;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

.help-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.help-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

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

.help-body {
    padding: 25px;
    color: #333;
    line-height: 1.6;
}

.help-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.help-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.help-section h4 {
    color: #667eea;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-section p {
    margin-bottom: 10px;
    color: #666;
}

.help-formula {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 15px;
    margin: 10px 0;
    border-radius: 0 8px 8px 0;
    font-family: 'Courier New', monospace;
    color: #333;
}

.help-formula code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.help-list {
    margin: 10px 0;
    padding-left: 20px;
}

.help-list li {
    margin-bottom: 8px;
    color: #666;
}

.help-note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    color: #856404;
}

.help-note strong {
    color: #533f03;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Analysis Container Updates */
.analysis-container {
    position: relative;
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-top: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.analysis-container h4 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.analysis-tables {
    display: grid;
    gap: 25px;
}

/* Table Options */
.table-options {
    margin-bottom: 30px;
}

/* Table Summary Styles */
.table-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    border-left: 4px solid #667eea;
}

.table-summary h6 {
    color: #333;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-summary p {
    color: #666;
    margin-bottom: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.table-summary p:last-child {
    margin-bottom: 0;
}

.table-summary strong {
    color: #333;
    font-weight: 600;
}

/* Smooth Transitions */
* {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

