/* AAC Communication Board Styles */

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

:root {
    --primary-color: #667eea;
    --primary-dark: #764ba2;
    --secondary-color: #2c3e50;
    --success-color: #667eea;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #667eea;
    --light-bg: #003476;
    --border-color: #e0e0e0;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 5px 20px rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation Bar */
.navbar {
    background: #003476;
    color: white;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1000;
}

.burger-menu {
    width: 30px;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    cursor: pointer;
    margin-right: 20px;
}

.burger-line {
    width: 100%;
    height: 3px;
    background: white;
    transition: all 0.3s ease;
}

.burger-menu.active .burger-line:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.burger-menu.active .burger-line:nth-child(2) {
    opacity: 0;
}

.burger-menu.active .burger-line:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.app-title {
    font-size: 24px;
    font-weight: bold;
    flex-grow: 1;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.language-selector {
    display: flex;
    gap: 10px;
    align-items: center;
}

.logout-btn {
    padding: 8px 16px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.logout-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.logout-btn:active {
    transform: translateY(0);
}

.persona-btn,
.fix-btn,
.translate-btn,
.copy-btn,
.lang-btn {
    background: white;
    color: #333;
    border: 2px solid #333;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 40px;
}

.persona-btn:hover,
.fix-btn:hover,
.translate-btn:hover,
.copy-btn:hover,
.lang-btn:hover {
    background: #f0f0f0;
    border-color: #555;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.persona-btn:active,
.fix-btn:active,
.translate-btn:active,
.copy-btn:active,
.lang-btn:active {
    transform: translateY(0);
}

.lang-btn {
    background: #e0e0e0;
    border-color: #666;
}

.lang-btn:hover {
    background: #d0d0d0;
    border-color: #555;
}

.lang-btn.active {
    border-color: #333;
    background: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.lang-btn.active .lang-text {
    color: #333;
}

.lang-text {
    color: #666;
    font-weight: 500;
}

.lang-btn.active .lang-text {
    color: #000;
    font-weight: 600;
}

/* Side Menu */
.side-menu {
    position: fixed;
    left: -300px;
    top: 0;
    width: 300px;
    height: 100vh;
    background: #eeeeee;
    color: white;
    transition: left 0.3s ease;
    z-index: 999;
    padding: 60px 20px 20px;
    overflow-y: auto;
}

.side-menu.active {
    left: 0;
}

.menu-item {
    padding: 15px 10px;
    cursor: pointer;
    border-bottom: 1px solid var(--secondary-color);
    transition: background 0.3s;
    color: black;
}

.menu-item:hover {
    background: #003476;
    color: white;
}

.menu-item-logout {
    margin-top: auto;
    border-top: 2px solid var(--secondary-color);
}

/* Main Container */
.main-container {
    flex: 1;
    padding: 20px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    background: white;
}

/* Sentence Box Area */
.sentence-area {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.sentence-box {
    width: 100%;
    min-height: 80px;
    padding: 15px;
    font-size: 24px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

.sentence-box:focus {
    outline: none;
    border-color: var(--primary-color);
}

.sentence-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.sentence-controls-right {
    margin-left: auto;
    display: flex;
    gap: 10px;
}

.control-btn {
    padding: 10px 20px;
    border: 2px solid #333;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: #333;
}

.control-btn:hover {
    transform: translateY(-2px);
    background: #f0f0f0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-speak {
    background: linear-gradient(135deg, #00aeef 0%, #00aeef 100%);
    color: white;
    border-color: #00aeef;
}

.btn-speak:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    border-color: #5568d3;
}

.btn-dictate {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border-color: #e74c3c;
}

.btn-dictate:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    border-color: #c0392b;
}

.btn-dictate.recording {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }
}

.btn-talk-to {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.btn-talk-to:hover {
    background: #2980b9;
    border-color: #2980b9;
}

.btn-clear {
    background: white;
    color: #333;
    border-color: #333;
}

.btn-clear:hover {
    background: #f0f0f0;
}

.btn-delete-word {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

.btn-delete-word:hover {
    background: #c0392b;
    border-color: #c0392b;
}

.btn-delete-letter {
    background: #ec7063;
    color: white;
    border-color: #ec7063;
}

.btn-delete-letter:hover {
    background: #e74c3c;
    border-color: #e74c3c;
}

/* Tabs Navigation */
.tabs-container {
    background: white;
    border-radius: 15px 15px 0 0;
    padding: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.tabs-nav {
    display: flex;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 15px;
    background: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.tab-btn.active {
    color: #000;
    background: #f9f9f9;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: #333;
}

/* Hide Chat and Group Chat tabs initially until a selection is made */
.tab-btn[data-tab="chat"],
.tab-btn[data-tab="group-chat"] {
    display: none;
}

/* Tab Content Areas */
.tab-content {
    background: white;
    border-radius: 0 0 15px 15px;
    padding: 20px;
    box-shadow: var(--shadow);
    min-height: 400px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Predictions Grid */
.predictions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
    position: relative;
    min-height: 100px;
}

.predictions-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 14px;
    font-style: italic;
}

/* Prediction legend */
.predictions-legend {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 11px;
    color: #666;
    align-items: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid;
}

.legend-color.autocomplete {
    background: #fff3e0;
    border-color: #ff9800;
}

.legend-color.dictionary {
    background: #ffebee;
    border-color: #f44336;
}

.legend-color.historical {
    background: #e8f5e9;
    border-color: #4caf50;
}

.legend-color.llm {
    background: #e3f2fd;
    border-color: #2196f3;
}

.legend-color.word_suggestion {
    background: #f3e5f5;
    border-color: #9c27b0;
}

.prediction-card {
    aspect-ratio: 1;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f5f5f5;
    padding: 7px;
}

.prediction-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.prediction-icon {
    font-size: 39px;
    margin-bottom: 3px;
}

.prediction-text {
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    word-break: break-word;
    color: black;
}

/* Source-based color coding for predictions */
.prediction-card.prediction-autocomplete {
    background: #fff3e0;
    border-color: #ff9800;
}

.prediction-card.prediction-autocomplete:hover {
    background: #ffe0b2;
    border-color: #f57c00;
}

.prediction-card.prediction-dictionary {
    background: #ffebee;
    border-color: #f44336;
}

.prediction-card.prediction-dictionary:hover {
    background: #ffcdd2;
    border-color: #d32f2f;
}

.prediction-card.prediction-historical {
    background: #e8f5e9;
    border-color: #4caf50;
}

.prediction-card.prediction-historical:hover {
    background: #c8e6c9;
    border-color: #388e3c;
}

.prediction-card.prediction-llm {
    background: #e3f2fd;
    border-color: #2196f3;
}

.prediction-card.prediction-llm:hover {
    background: #bbdefb;
    border-color: #1976d2;
}

.prediction-card.prediction-word_suggestion {
    background: #f3e5f5;
    border-color: #9c27b0;
}

.prediction-card.prediction-word_suggestion:hover {
    background: #e1bee7;
    border-color: #7b1fa2;
}

/* More button (for requesting AI predictions) */
.prediction-card.prediction-more {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    font-weight: 600;
}

.prediction-card.prediction-more:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    border-color: #764ba2;
    transform: translateY(-5px) scale(1.05);
}

.prediction-card.prediction-more .prediction-icon {
    font-size: 36px;
}

.prediction-card.prediction-more .prediction-text {
    font-size: 20px;
    color: white;
}

/* Probability badge */
.prediction-probability {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 8px;
    line-height: 1;
}

.prediction-card {
    position: relative;
}

/* Button Grid (Keyboard and Cards) */
.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 12px;
    justify-items: stretch;
    align-items: stretch;
}

.grid-btn {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    padding: 10px;
    min-height: 104px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    font-size: 31px;
    font-weight: 600;
    color: var(--text-primary);
}

.grid-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.grid-btn:active {
    transform: translateY(0);
}

.grid-btn.space-btn {
    background: #e0e0e0 !important;
    color: #555;
    font-size: 22px;
    font-weight: 700;
}

.grid-btn.space-btn:hover {
    background: #d0d0d0 !important;
}

.grid-btn.caps-btn {
    background: #f0f0f0 !important;
    color: #555;
    font-size: 22px;
    font-weight: 700;
}

.grid-btn.caps-btn:hover {
    background: #e0e0e0 !important;
}

.grid-btn.caps-btn.active {
    background: #4CAF50 !important;
    color: white;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.grid-btn.caps-btn.active:hover {
    background: #45a049 !important;
}

.card-icon {
    font-size: 42px;
    margin-bottom: 5px;
}

.card-text {
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
}

/* Category Colors */
.category-people { background: #ffe4b5 !important; }
.category-actions { background: #b5e7ff !important; }
.category-descriptors { background: #ffb5d4 !important; }
.category-objects { background: #b5ffb5 !important; }
.category-questions { background: #e6b5ff !important; }
.category-social { background: #ffd4b5 !important; }
.category-feelings { background: #ffcccc !important; }
.category-food { background: #ffffb5 !important; }
.category-places { background: #d4f1f4 !important; }
.category-school { background: #e8d5b7 !important; }
.category-travel { background: #c5e1a5 !important; }
.category-core { background: #ffe4b5 !important; }

/* Category Selector */
.category-selector {
    margin-bottom: 20px;
    text-align: center;
}

.category-selector-inline {
    display: flex;
    align-items: center;
}

.category-dropdown {
    padding: 10px 20px;
    font-size: 16px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    min-width: 200px;
}

/* Chat Interface */
.chat-container {
    height: 400px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 10px;
    margin-bottom: 15px;
}

.chat-bubble-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 15px;
    animation: slideIn 0.3s ease;
}

.chat-bubble-wrapper.user {
    justify-content: flex-end;
}

.chat-bubble-wrapper.ai {
    justify-content: flex-start;
}

.chat-icon {
    font-size: 28px;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: none;
    padding: 0;
    transition: all 0.3s ease;
}

.chat-icon.clickable {
    cursor: pointer;
}

.chat-icon.clickable:hover {
    background: var(--success-color);
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.chat-icon.clickable:active {
    transform: scale(0.95);
}

.chat-bubble-wrapper.user .chat-icon {
    order: 2;
}

.chat-bubble-wrapper.ai .chat-icon {
    order: 0;
}

.chat-bubble {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 18px;
    position: relative;
}

.chat-speak-btn {
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    flex-shrink: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.chat-speak-btn:hover {
    background: #229954;
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.chat-speak-btn:active {
    transform: scale(0.95);
}

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

.chat-bubble.user {
    background: var(--primary-color);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.chat-bubble.ai {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

/* Chat Content Wrapper */
.chat-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 70%;
}

/* Chat Options */
.chat-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.chat-option-btn {
    background: #003476;
    color: white;
    border: 2px solid #667eea;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    text-align: center;
}

.chat-option-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #5568d3 0%, #63408a 100%);
    border-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.chat-option-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

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

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 18px;
    margin-bottom: 15px;
    max-width: 70px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

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

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

@keyframes typingDot {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-5px);
    }
}

.chat-input-area {
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.chat-input:focus {
    border-color: var(--primary-color);
}

.chat-send-btn {
    padding: 12px 24px;
    background: #333;
    color: white;
    border: 2px solid #333;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.chat-send-btn:hover {
    background: #555;
    border-color: #555;
    transform: scale(1.05);
}

/* Loading indicator */
.loading {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.loading.active {
    display: block;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--text-primary);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: var(--shadow-hover);
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.3s ease;
    z-index: 10000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .predictions,
    .button-grid {
        grid-template-columns: repeat(auto-fill, minmax(91px, 1fr));
    }
}

@media (max-width: 768px) {
    .app-title {
        font-size: 18px;
    }

    .predictions,
    .button-grid {
        grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
        gap: 8px;
    }

    .grid-btn {
        min-height: 78px;
        font-size: 26px;
    }

    .card-icon {
        font-size: 31px;
    }

    .card-text {
        font-size: 14px;
    }

    .prediction-icon {
        font-size: 31px;
    }

    .prediction-text {
        font-size: 13px;
    }

    .sentence-box {
        font-size: 20px;
    }

    .control-btn {
        font-size: 14px;
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 10px;
    }

    .sentence-area {
        padding: 15px;
    }

    .language-selector {
        gap: 5px;
    }

    .lang-btn {
        padding: 3px 8px;
        font-size: 14px;
    }
}

/* Modal Overlay for Menu Pages */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow-y: auto;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

.modal-page h1 {
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.modal-page h2 {
    color: var(--secondary-color);
    margin-top: 20px;
    margin-bottom: 10px;
}

.modal-page h3 {
    color: var(--text-primary);
    margin-top: 15px;
    margin-bottom: 8px;
}

.modal-page p {
    line-height: 1.6;
    margin-bottom: 10px;
}

.modal-page ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.modal-page li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.modal-close-btn {
    margin-top: 20px;
    padding: 12px 30px;
    background: #333;
    color: white;
    border: 2px solid #333;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.modal-close-btn:hover {
    background: #555;
    border-color: #555;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.action-btn {
    padding: 10px 20px;
    background: #666;
    color: white;
    border: 2px solid #666;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.action-btn:hover {
    background: #888;
    border-color: #888;
    transform: translateY(-2px);
}

/* Settings Page */
.settings-section {
    margin-bottom: 25px;
}

.setting-item {
    margin: 15px 0;
    padding: 10px;
    background: white;
    border-radius: 8px;
}

.setting-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.setting-item input[type="checkbox"] {
    margin-right: 10px;
}

.setting-item input[type="number"],
.setting-item select {
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin-left: 10px;
}

.setting-item input[type="range"] {
    width: 200px;
    margin-left: 10px;
    margin-right: 10px;
}

.setting-description {
    margin: 5px 0 0 0;
    padding: 5px 0 0 25px;
    font-size: 0.85em;
    color: #666;
    font-style: italic;
}

/* Profile Page */
.profile-section {
    margin-bottom: 25px;
    padding: 15px;
    background: var(--light-bg);
    border-radius: 8px;
}

.profile-section p {
    margin: 8px 0;
}

/* Stats Page */
.stats-section {
    margin-bottom: 25px;
}

.stat-card {
    display: inline-block;
    padding: 20px;
    margin: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    text-align: center;
    min-width: 150px;
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

/* Dictionary Page */
.dictionary-section {
    margin-bottom: 25px;
    padding: 15px;
    background: var(--light-bg);
    border-radius: 8px;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.category-badge {
    padding: 8px 15px;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* Themes Page */
.themes-section {
    margin-bottom: 25px;
}

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

.theme-option {
    height: 100px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.theme-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.theme-option span {
    color: white;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Speech Settings Page */
.speech-section {
    margin-bottom: 25px;
}

/* Help Page */
.help-section {
    line-height: 1.8;
}

/* About Page */
.about-section {
    line-height: 1.8;
}

.about-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
    text-align: center;
    color: var(--primary-color);
}

/* Accent Selection Modal */
.accent-modal {
    display: none;
    position: fixed;
    z-index: 10002;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.accent-modal.active {
    display: flex;
}

.accent-modal-content {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    max-height: 80%;
    overflow-y: auto;
}

.accent-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.accent-option {
    width: 80px;
    height: 80px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    font-size: 36px;
    font-weight: 600;
    color: var(--text-primary);
}

.accent-option:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
    background: var(--light-bg);
}

.accent-option:active {
    transform: scale(0.95);
}

/* Fix Sentence Modal */
.fix-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.fix-modal.active {
    display: flex;
}

.fix-modal-content {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

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

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

.fix-modal-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.fix-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 32px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 0;
}

.fix-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.fix-modal-body {
    padding: 25px;
    overflow-y: auto;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 15px;
}

.loading-spinner .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--light-bg);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-spinner p {
    color: var(--text-secondary);
    font-size: 16px;
    margin: 0;
}

.fix-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fix-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 20px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fix-option:hover {
    background: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
    transform: translateX(5px);
}

.fix-option:active {
    transform: translateX(5px) scale(0.98);
}

.fix-option-number {
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
}

.fix-option-keep .fix-option-number {
    background: var(--text-secondary);
    font-size: 20px;
}

.fix-option-text {
    flex: 1;
    font-size: 16px;
    color: var(--text-primary);
    line-height: 1.5;
}

.fix-option-keep {
    border-color: var(--text-secondary);
    background: #f0f0f0;
    margin-top: 10px;
}

.fix-option-keep:hover {
    border-color: var(--text-secondary);
    background: #e8e8e8;
}

/* Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .grid-btn,
    .prediction-card {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   Category Management Page
   ======================================== */

.category-management-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.category-management-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
}

.category-management-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

.category-selector-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 15px;
}

.form-group select,
.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.3s;
}

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

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.words-textarea {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.button-group {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.btn-primary:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.btn-danger {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.btn-danger:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.category-words-display {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.category-words-display h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: var(--text-primary);
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.word-card-mini {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s;
    cursor: default;
}

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

.word-icon-mini {
    font-size: 32px;
    margin-bottom: 8px;
}

.word-text-mini {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Category words header with controls */
.category-words-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.category-words-header h3 {
    margin: 0;
    padding: 0;
    border: none;
}

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

.btn-select-all,
.btn-delete-selected {
    padding: 8px 15px;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: white;
    color: #667eea;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-select-all:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.btn-delete-selected {
    border-color: #e74c3c;
    color: #e74c3c;
}

.btn-delete-selected:hover:not(:disabled) {
    background: #e74c3c;
    color: white;
    transform: translateY(-2px);
}

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

/* Word card with checkbox */
.word-card-mini {
    position: relative;
}

.word-card-mini.selected {
    background: #e8eaff;
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.word-checkbox {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Home Tab - Category Grid */
.home-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    padding: 20px;
    max-height: calc(100vh - 400px);
    overflow-y: auto;
}

.home-category-card {
    background: white;
    border: 3px solid #ddd;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 140px;
}

.home-category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.home-category-card:active {
    transform: translateY(-2px);
}

.home-category-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.home-category-name {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    word-wrap: break-word;
}

.loading-spinner-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: #667eea;
    font-weight: 500;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.hidden {
    display: none !important;
}

.back-to-app {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 20px;
    padding: 10px 15px;
    border-radius: 8px;
    transition: background 0.3s;
}

.back-to-app:hover {
    background: #f0f0f0;
}

/* Persona Selection Modal */
.persona-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2001;
    backdrop-filter: blur(4px);
}

.persona-modal.active {
    display: flex;
}

.persona-modal-content {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

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

.persona-modal-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: white;
}

.persona-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 32px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 0;
}

.persona-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.persona-modal-body {
    padding: 30px;
    overflow-y: auto;
}

.persona-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.persona-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-height: 140px;
}

.persona-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.persona-card:hover .persona-name {
    color: white;
}

.persona-card.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.persona-card.selected .persona-name {
    color: white;
}

.persona-emoji {
    font-size: 48px;
    margin-bottom: 5px;
}

.persona-name {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    transition: color 0.3s;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .words-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .button-group {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .persona-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 15px;
    }

    .persona-card {
        min-height: 120px;
        padding: 15px;
    }

    .persona-emoji {
        font-size: 40px;
    }

    .persona-name {
        font-size: 13px;
    }
}

/* ============================================
   GROUP CHAT TAB STYLES
   ============================================ */

/* Group Chat Container */
.group-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
    gap: 15px;
}

/* Group Chat Header with Selector */
.group-chat-header {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
}

.group-chat-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.group-chat-selector label {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

.group-chat-select {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.group-chat-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.group-chat-search {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.group-chat-search:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Group Chat Container */
.group-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
}

/* Group Chat Messages Area */
.group-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 400px;
    scroll-behavior: smooth;
}

.group-chat-welcome {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.group-chat-welcome h3 {
    font-size: 28px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.group-chat-welcome p {
    font-size: 16px;
}

/* Group Chat Message Styles */
.group-chat-message {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.group-chat-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.group-chat-message-username {
    font-weight: 600;
    color: var(--primary-color);
}

.group-chat-message-time {
    font-size: 12px;
}

.group-chat-message-bubble {
    background: #f0f0f0;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.4;
    max-width: 75%;
    word-wrap: break-word;
}

.group-chat-message.own-message {
    align-items: flex-end;
}

.group-chat-message.own-message .group-chat-message-bubble {
    background: var(--primary-color);
    color: white;
}

.group-chat-message.own-message .group-chat-message-username {
    color: var(--primary-dark);
}

/* Group Chat Input Area */
.group-chat-input-area {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
}

.group-chat-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    resize: none;
    font-family: inherit;
    min-height: 60px;
    max-height: 120px;
    background: white;
}

.group-chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.group-chat-send {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    align-self: flex-end;
}

.group-chat-send:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.group-chat-send:active {
    transform: translateY(0);
}

/* Chat Selector Button in Navbar */
.chat-selector-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 10px;
}

.chat-selector-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Chat Selector Modal */
.chat-selector-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.chat-selector-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-selector-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.chat-selector-modal-header h3 {
    color: var(--primary-color);
    font-size: 24px;
    margin: 0;
}

.chat-selector-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.chat-selector-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.chat-selector-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Chat Selector Tabs */
.chat-selector-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.chat-selector-tab {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-selector-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.chat-selector-tab:hover {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

/* Chat Selector Sections */
.chat-selector-section {
    display: none;
}

.chat-selector-section.active {
    display: block;
}

/* Speaking Alone Section */
.speaking-alone-content {
    text-align: center;
    padding: 60px 40px;
}

.speaking-alone-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.speaking-alone-content h3 {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.speaking-alone-content p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.5;
}

.speaking-alone-select-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.speaking-alone-select-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.speaking-alone-select-btn:active {
    transform: translateY(0);
}

/* AI Personas Grid */
.chat-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.chat-selector-ai-card {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-selector-ai-card:hover {
    background: #e3f2fd;
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.chat-selector-ai-emoji {
    font-size: 48px;
    margin-bottom: 10px;
}

.chat-selector-ai-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

/* Chat Groups List */
.chat-selector-search {
    margin-bottom: 15px;
}

.chat-selector-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.chat-selector-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.chat-selector-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-selector-group-item {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-selector-group-item:hover {
    background: #e3f2fd;
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.chat-selector-group-name {
    font-weight: 600;
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.chat-selector-group-description {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Chat Group Selection Modal (keep for backward compatibility) */
.chat-group-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.chat-group-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-group-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.chat-group-modal-header h3 {
    color: var(--primary-color);
    font-size: 24px;
    margin: 0;
}

.chat-group-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.chat-group-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.chat-group-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Responsive adjustments for group chat */
@media (max-width: 768px) {
    .group-chat-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .group-chat-select,
    .group-chat-search {
        width: 100%;
    }

    .chat-group-btn {
        font-size: 14px;
        padding: 6px 12px;
    }
}
