.feedback-panel {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.feedback-panel.hidden {
    display: none;
}

.feedback-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.feedback-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
}

.feedback-header i {
    color: #FFC107;
    font-size: 1.4rem;
}

.feedback-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #2196F3;
}

.feedback-section h4 {
    margin: 0 0 0.8rem 0;
    color: #2196F3;
    font-size: 1.1rem;
}

.feedback-section h5 {
    margin: 1rem 0 0.5rem 0;
    color: #555;
    font-size: 1rem;
}

.feedback-rating {
    margin-bottom: 0.8rem;
}

.feedback-rating i {
    color: #ddd;
    margin-right: 0.3rem;
}

.feedback-rating i.filled {
    color: #FFC107;
}

.feedback-list {
    list-style: none;
    padding: 0;
    margin: 0.8rem 0;
}

.feedback-item {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.8rem;
    background: white;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.feedback-item i {
    color: #666;
    margin-top: 0.2rem;
}

.feedback-item span {
    color: #444;
    line-height: 1.4;
}

.original-text,
.corrected-text {
    padding: 0.8rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.original-text {
    background: rgba(0, 0, 0, 0.05);
    color: #666;
}

.corrected-text {
    background: rgba(46, 125, 50, 0.1);
    color: #2E7D32;
    border-left: 3px solid #4CAF50;
}

.feedback-highlight {
    color: #2196F3;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.next-steps {
    color: #666;
    font-style: italic;
}

.text-feedback {
    background: linear-gradient(to right, #f8f9fa, #ffffff);
    border-left: 4px solid #4CAF50;
    margin-bottom: 2rem;
    padding: 1.5rem;
}

.feedback-paragraph {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #2c3e50;
    margin-bottom: 1rem;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .feedback-panel {
        background: #1a1a1a;
    }

    .feedback-header {
        border-bottom-color: #333;
    }

    .feedback-section {
        background: #2a2a2a;
    }

    .feedback-item {
        background: #333;
    }

    .feedback-item span,
    .feedback-section h4,
    .feedback-section h5 {
        color: #eee;
    }

    .original-text {
        background: rgba(255, 255, 255, 0.1);
        color: #ccc;
    }

    .corrected-text {
        background: rgba(76, 175, 80, 0.2);
        color: #81C784;
    }
}

.edit-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.edit-button {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.edit-button:hover {
    background: var(--dark-blue);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.edit-button i {
    font-size: 1rem;
}

/* Updated Report Styles */
.message-group {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.feedback-entry {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.feedback-text {
    font-size: 1.1rem;
    color: var(--primary-blue);
    margin-bottom: 1rem;
    line-height: 1.5;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--gold);
}

.feedback-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.report-summary {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.stat-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
    display: block;
}

.stat-value {
    font-size: 1.5rem;
    color: var(--primary-blue);
    font-weight: 600;
    display: block;
}

@media (max-width: 768px) {
    .feedback-details {
        grid-template-columns: 1fr;
    }
    
    .summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Enhanced Report Styles */
.report-container {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 1200px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.report-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.report-header h2 {
    color: var(--primary-blue);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

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

.report-meta span {
    margin: 0 1rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.metric-card {
    background: linear-gradient(145deg, #f8f9fa, #ffffff);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

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

.metric-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

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

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin: 1.5rem 0;
}

.analysis-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
}

.analysis-card h4 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

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

.analysis-list li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
}

.analysis-list li:before {
    content: "•";
    color: var(--primary-blue);
    position: absolute;
    left: 0;
}

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

.mistake-card {
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    border-left: 4px solid var(--error-red);
}

.chart-container {
    height: 300px;
    margin: 1.5rem 0;
    padding: 1rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

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

.recommendation-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.recommendation-card h4 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.report-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #f0f0f0;
}

.action-button {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: none;
    background: #f0f0f0;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-button:hover {
    background: #e0e0e0;
}

.action-button.primary {
    background: var(--primary-blue);
    color: white;
}

.action-button.primary:hover {
    background: var(--primary-blue-dark);
}

@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .analysis-grid {
        grid-template-columns: 1fr;
    }

    .report-actions {
        flex-direction: column;
    }

    .action-button {
        width: 100%;
        justify-content: center;
    }
}

/* Enhanced Report Component Styles */
.strength-item, .improvement-item {
    background: #ffffff;
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

.strength-item:hover, .improvement-item:hover {
    transform: translateY(-2px);
}

.strength-item h5, .improvement-item h5 {
    color: var(--primary-blue);
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.strength-item h5:before {
    content: "✓";
    color: #4CAF50;
}

.improvement-item h5:before {
    content: "↗";
    color: var(--primary-blue);
}

.examples-list, .points-list {
    margin-top: 0.8rem;
    padding-left: 1.2rem;
}

.examples-list li, .points-list li {
    margin-bottom: 0.5rem;
    color: #666;
    line-height: 1.4;
}

.examples-section, .practice-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.examples-section h5, .practice-section h5 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}

.practice-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.8rem;
    position: relative;
}

.practice-item.beginner {
    border-left: 4px solid #4CAF50;
}

.practice-item.intermediate {
    border-left: 4px solid #2196F3;
}

.practice-item.advanced {
    border-left: 4px solid #9C27B0;
}

.difficulty-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.practice-item.beginner .difficulty-badge {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.practice-item.intermediate .difficulty-badge {
    background: rgba(33, 150, 243, 0.1);
    color: #2196F3;
}

.practice-item.advanced .difficulty-badge {
    background: rgba(156, 39, 176, 0.1);
    color: #9C27B0;
}

.score-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.score-label {
    font-size: 0.9rem;
    color: #666;
    max-width: 120px;
    margin: 0 auto;
}

.examples {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.8rem;
}

.examples small {
    color: #666;
    display: block;
    margin-bottom: 0.5rem;
}

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

.examples ul li {
    margin-bottom: 0.5rem;
    padding-left: 1.2rem;
    position: relative;
}

.examples ul li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary-blue);
}

/* Dark mode support for enhanced report */
@media (prefers-color-scheme: dark) {
    .strength-item, .improvement-item {
        background: #2a2a2a;
    }

    .practice-item {
        background: #333;
    }

    .examples {
        background: #333;
    }

    .score-value {
        color: #64B5F6;
    }

    .score-label {
        color: #aaa;
    }

    .strength-item h5, .improvement-item h5 {
        color: #64B5F6;
    }

    .examples-list li, .points-list li {
        color: #bbb;
    }

    .examples-section h5, .practice-section h5 {
        color: #aaa;
    }
}

/* Print styles for the report */
@media print {
    .report-container {
        box-shadow: none;
        margin: 0;
        padding: 1rem;
    }

    .action-button {
        display: none;
    }

    .practice-item {
        break-inside: avoid;
    }

    .strength-item, .improvement-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #eee;
    }
}

/* Conversation Feedback Styles */
.conversation-feedback {
    margin: 2rem 0;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.exchange-item {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid var(--primary-blue);
}

.exchange-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.exchange-number {
    font-weight: 600;
    color: var(--primary-blue);
}

.exchange-score {
    background: var(--primary-blue);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.9rem;
}

.user-input {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #eee;
}

.feedback-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.feedback-section {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #eee;
}

.feedback-section h5 {
    color: var(--primary-blue);
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.rating {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: rgba(33, 150, 243, 0.1);
    color: var(--primary-blue);
    border-radius: 4px;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
}

.issues, .suggestions {
    margin-top: 0.8rem;
}

.issues strong, .suggestions strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.issues ul, .suggestions ul {
    list-style: none;
    padding-left: 0;
}

.issues li, .suggestions li {
    margin-bottom: 0.5rem;
    padding-left: 1.2rem;
    position: relative;
    font-size: 0.9rem;
    color: #555;
}

.issues li:before {
    content: "!";
    color: #f44336;
    position: absolute;
    left: 0;
}

.suggestions li:before {
    content: "✓";
    color: #4caf50;
    position: absolute;
    left: 0;
}

/* Final Advice Styles */
.final-advice {
    margin-top: 3rem;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.final-advice h3 {
    color: var(--primary-blue);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.progress-summary {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(145deg, #f8f9fa, #ffffff);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.progress-summary h4 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.progress-summary p {
    font-size: 1.2rem;
    color: #333;
    line-height: 1.6;
}

.key-area {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.key-area h5 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.priority-high {
    color: #f44336;
}

.priority-medium {
    color: #ff9800;
}

.frequency {
    font-size: 0.8rem;
    color: #666;
    margin-left: 0.5rem;
}

.next-step-item {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid var(--primary-blue);
}

.next-step-item h5 {
    color: var(--primary-blue);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.next-step-item p {
    margin-bottom: 1rem;
    color: #555;
}

.next-step-item ul {
    list-style: none;
    padding-left: 0;
}

.next-step-item li {
    margin-bottom: 0.5rem;
    padding-left: 1.2rem;
    position: relative;
    color: #666;
}

.next-step-item li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary-blue);
}

@media (max-width: 768px) {
    .feedback-details {
        grid-template-columns: 1fr;
    }

    .exchange-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .exchange-score {
        align-self: flex-end;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .conversation-feedback,
    .final-advice {
        background: #1a1a1a;
    }

    .exchange-item,
    .key-area,
    .next-step-item {
        background: #2a2a2a;
    }

    .user-input,
    .feedback-section {
        background: #333;
        border-color: #444;
    }

    .progress-summary {
        background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    }

    .exchange-number,
    .feedback-section h5,
    .final-advice h3,
    .progress-summary h4,
    .key-area h5,
    .next-step-item h5 {
        color: #64B5F6;
    }

    .user-input {
        color: #eee;
    }

    .issues li,
    .suggestions li,
    .next-step-item li {
        color: #bbb;
    }

    .frequency {
        color: #999;
    }
}

/* Main container styles */
.conversation-interface {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100vh;
    padding: 1rem;
    background: var(--background);
    position: relative;
    overflow: hidden;
}

/* Header styles */
.conversation-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 2;
}

.conversation-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-blue);
}

/* Messages container styles */
.messages-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin: 0;
    min-height: 0; /* Important for flex child */
}

/* Message styles */
.message {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 0.8rem;
    margin-bottom: 1rem;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

.message.user {
    flex-direction: row-reverse;
    margin-left: auto;
    margin-right: 0;
}

.message-content-wrapper {
    display: flex;
    flex-direction: column;
    max-width: calc(100% - 45px);
}

.message-text {
    padding: 0.8rem 1.2rem;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 0.95rem;
    word-wrap: break-word;
    margin: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.message.user .message-text {
    background: linear-gradient(135deg, var(--primary-blue), #0056b3);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-text {
    background: white;
    color: var(--text-blue);
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

/* Feedback styles - only for user messages */
.message.user .message-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    justify-content: flex-end;
}

.message.assistant .message-actions {
    display: none;
}

.message-action-btn {
    background: rgba(0,123,255,0.1);
    border: none;
    color: var(--primary-blue);
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
}

.message-action-btn:hover {
    background: rgba(0,123,255,0.2);
    transform: translateY(-1px);
}

.translation-text {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(0,0,0,0.03);
    border-radius: 6px;
    font-size: 0.9rem;
    direction: rtl;
    color: #666;
}

/* Welcome message styles */
.welcome-message {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 1rem;
    animation: fadeIn 0.5s ease;
}

.welcome-message h2 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.welcome-message p {
    color: var(--text-blue);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

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

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .conversation-interface {
        background: #1a1a1a;
    }
    
    .conversation-header,
    .messages-container,
    .chat-input-container {
        background: #2a2a2a;
    }
    
    .message.assistant .message-text {
        background: #333;
        border-color: #444;
    }
    
    #userInput {
        background: #333;
        border-color: #444;
        color: #fff;
    }
    
    .translation-text {
        background: rgba(255,255,255,0.05);
    }
}

/* Tutor Cards Styling */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.character-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.3s ease;
    height: 80px;
    position: relative;
    overflow: hidden;
}

.character-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.character-card.selected {
    border: 2px solid var(--primary-blue);
    background: rgba(0,123,255,0.05);
}

.character-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.character-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
}

.character-name {
    font-size: 1.1rem;
    color: var(--text-blue);
    font-weight: 500;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.character-flag {
    width: 24px;
    height: 16px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Enhanced Conversation Interface */
.conversation-interface {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100vh;
    padding: 1rem;
    background: var(--background);
    position: relative;
    overflow: hidden;
}

.conversation-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 2;
}

.conversation-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-blue);
}

.messages-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin: 0;
    min-height: 0;
}

.message {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 0.8rem;
    margin-bottom: 1rem;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

.message.user {
    flex-direction: row-reverse;
    margin-left: auto;
    margin-right: 0;
}

.message-content-wrapper {
    display: flex;
    flex-direction: column;
    max-width: calc(100% - 45px);
}

.message-text {
    padding: 0.8rem 1.2rem;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 0.95rem;
    word-wrap: break-word;
    margin: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.message.user .message-text {
    background: linear-gradient(135deg, var(--primary-blue), #0056b3);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-text {
    background: white;
    color: var(--text-blue);
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.message-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    justify-content: flex-start;
}

.message-action-btn {
    background: rgba(0,123,255,0.1);
    border: none;
    color: var(--primary-blue);
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
}

.message-action-btn:hover {
    background: rgba(0,123,255,0.2);
    transform: translateY(-1px);
}

.chat-input-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1.2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-top: auto;
    z-index: 2;
}

.chat-input {
    display: flex;
    gap: 0.8rem;
    align-items: flex-end;
    width: 100%;
}

#userInput {
    flex: 1;
    min-height: 45px;
    max-height: 120px;
    padding: 0.8rem 1.2rem;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    resize: none;
    font-size: 0.95rem;
    line-height: 1.5;
    background: var(--background);
    margin: 0;
    transition: all 0.3s ease;
}

#userInput:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.voice-controls {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.5rem;
    width: 100%;
}

#recordButton {
    background: var(--primary-blue);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#recordButton:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#recordButton.listening {
    background: var(--error-red);
    animation: pulse 1.5s infinite;
}

#sendButton {
    background: var(--primary-blue);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#sendButton:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

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

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .character-card {
        background: #2a2a2a;
    }
    
    .conversation-interface {
        background: #1a1a1a;
    }
    
    .conversation-header,
    .messages-container,
    .chat-input-container {
        background: #2a2a2a;
    }
    
    .message.assistant .message-text {
        background: #333;
        border-color: #444;
    }
    
    #userInput {
        background: #333;
        border-color: #444;
        color: #fff;
    }
    
    .translation-text {
        background: rgba(255,255,255,0.05);
    }
} 