/* Enhanced Features CSS for HSPT Sentence Builder (Stats Modal Removed) */
/* Additional styles for enhanced features */

/* Mode Toggle Styles */
.mode-toggle {
    margin-bottom: 20px;
    text-align: center;
}

.mode-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.mode-btn {
    padding: 12px 24px;
    border: 2px solid #dee2e6;
    border-radius: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #495057;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mode-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-color: #007bff;
}

.mode-btn.active {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border-color: #007bff;
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0,123,255,0.3);
}

/* Type Mode Content Styles */
.type-mode-content {
    background: linear-gradient(135deg, white 0%, #f8f9fa 100%);
    border: 3px solid #e9ecef;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.type-mode-content h3 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    font-size: 20px;
}

.type-area {
    position: relative;
}

#sentenceTextarea {
    width: 100%;
    min-height: 80px;
    max-height: 120px;
    padding: 15px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    resize: none;
    transition: border-color 0.3s ease;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

#sentenceTextarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

#sentenceTextarea::placeholder {
    color: #6c757d;
    font-style: italic;
}

.type-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 12px;
    color: #6c757d;
}

.char-counter {
    font-weight: 500;
}

.type-hint {
    font-style: italic;
    max-width: 60%;
    text-align: right;
}

.new-words-btn {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%) !important;
    color: white !important;
    font-weight: 600;
}

.new-words-btn:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3);
}

.ai-only {
    background: linear-gradient(135deg, #6f42c1 0%, #5a2d91 100%) !important;
    color: white !important;
}

.ai-only:hover {
    background: linear-gradient(135deg, #5a2d91 0%, #4e2569 100%) !important;
}

.ai-enhanced {
    border: 2px solid #6f42c1 !important;
}

.ai-word {
    position: relative;
}

.ai-word.ai-recommended::after {
    content: '⭐';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 10px;
}

.ai-word.ai-good::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 10px;
    color: #28a745;
}

.theme-category {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.theme-title {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 8px 12px;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compatibility-badge {
    background: rgba(111, 66, 193, 0.1);
    color: #6f42c1;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.ai-insights-section {
    background: linear-gradient(135deg, rgba(111, 66, 193, 0.05) 0%, rgba(255, 255, 255, 0.9) 100%);
    border: 2px solid #6f42c1;
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
}

.ai-insights-header h3 {
    color: #6f42c1;
    margin-bottom: 5px;
}

.insight-item {
    margin-bottom: 8px;
    font-size: 14px;
}

.ai-feedback {
    border-left: 4px solid #6f42c1 !important;
}

.ai-notification {
    border-left: 4px solid #6f42c1;
    background: linear-gradient(135deg, rgba(111, 66, 193, 0.1) 0%, white 100%);
}

.ai-template-indicator {
    background: rgba(111, 66, 193, 0.1);
    border: 1px solid rgba(111, 66, 193, 0.3);
    padding: 8px;
    border-radius: 6px;
    font-size: 12px;
    color: #6f42c1;
    margin-bottom: 10px;
    font-weight: 600;
}

.ai-tips {
    background: rgba(111, 66, 193, 0.05);
    border-left: 4px solid #6f42c1;
}

.ai-drop-zone.prefers-common {
    border-color: #28a745 !important;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.ai-drop-zone.prefers-hspt {
    border-color: #007bff !important;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1) 0%, rgba(255, 255, 255, 0.9) 100%);
}

/* Word bank controls - Fixed overlapping issue */
.word-bank-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.word-bank-controls .btn-small {
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 12px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 65px;
    text-align: center;
    flex-shrink: 0;
}

.word-bank-controls .btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Filter button styles - Fixed active states */
.word-bank-controls .btn-small.active {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    font-weight: 600;
    transform: scale(1.05);
}

.word-bank-controls .btn-small:not(.active) {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    color: #495057;
}

.word-bank-controls .btn-small:not(.active):hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #ced4da;
}

/* Word section filtering */
.word-section {
    transition: opacity 0.3s ease, height 0.3s ease;
}

.word-section.hidden {
    opacity: 0;
    height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* NOTE: Stats modal styles removed as requested */

/* Enhanced connection status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 14px;
}

.status-indicator {
    font-size: 12px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Offline indicator */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Enhanced session stats */
.session-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.session-stats span {
    font-weight: 600;
    color: #007bff;
}

/* Enhanced error display */
.error-display {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.error-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    margin: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.error-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

/* Mobile responsiveness for mode toggle and word bank controls */
@media (max-width: 768px) {
    .mode-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .mode-btn {
        width: 200px;
        margin: 5px 0;
    }
    
    .type-info {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }
    
    .type-hint {
        max-width: 100%;
        text-align: left;
    }
    
    /* Fixed word bank controls for mobile */
    .word-bank-controls {
        padding: 8px;
        gap: 4px;
    }
    
    .word-bank-controls .btn-small {
        flex: 1;
        min-width: 60px;
        max-width: 80px;
        font-size: 10px;
        padding: 5px 8px;
        margin: 1px;
    }
    
    .ai-insights-section {
        padding: 10px;
    }
    
    .insight-item {
        font-size: 13px;
    }
    
    .session-stats {
        flex-direction: column;
        gap: 5px;
    }
    
    .error-content {
        margin: 10px;
        padding: 20px;
    }
    
    /* Ensure word sections don't overlap */
    .word-section {
        margin-bottom: 15px;
        clear: both;
    }
    
    .word-bank {
        overflow-x: hidden;
    }
}
