/* AI Characters Selector Styles */

.ai-character-selector {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.selector-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
}

.selector-header h3 {
    margin: 0 0 10px 0;
    font-size: 1.8em;
    font-weight: 600;
}

.selector-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1em;
}

.difficulty-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
    background: #f8f9fa;
    padding: 8px;
    border-radius: 12px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.difficulty-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95em;
    transition: all 0.3s ease;
    color: #666;
}

.difficulty-tab:hover {
    background: #e9ecef;
    color: #333;
}

.difficulty-tab.active {
    background: #667eea;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.character-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
}

.character-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.character-card.selected {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.25);
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
}

.character-card.selected::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.character-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5em;
    margin: 0 auto 15px;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #667eea20, #764ba220);
}

.character-info {
    text-align: center;
}

.character-name {
    margin: 0 0 8px 0;
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
}

.character-description {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 0.95em;
    line-height: 1.4;
}

.character-difficulty {
    margin-bottom: 15px;
}

.difficulty-stars {
    display: flex;
    justify-content: center;
    gap: 2px;
}

.star {
    font-size: 1.1em;
    transition: color 0.2s ease;
}

.star.filled {
    color: #ffc107;
}

.star.empty {
    color: #e9ecef;
}

.character-traits {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 15px;
}

.trait {
    background: #f8f9fa;
    color: #495057;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    border: 1px solid #e9ecef;
}

.character-card.selected .trait {
    background: #e3f2fd;
    color: #1976d2;
    border-color: #bbdefb;
}

.character-select-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #28a745;
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8em;
}

.character-card.selected .character-select-indicator {
    display: flex;
}

/* Selection Info Panel */
.selection-info {
    background: white;
    border: 2px solid #667eea;
    border-radius: 16px;
    padding: 25px;
    margin-top: 20px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.selection-info.hidden {
    display: none;
}

.selected-character-preview {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.character-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    background: linear-gradient(135deg, #667eea20, #764ba220);
    border: 3px solid #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.character-details {
    flex: 1;
}

.character-details h4 {
    margin: 0 0 8px 0;
    font-size: 1.5em;
    color: #333;
}

.character-details p {
    margin: 0 0 15px 0;
    color: #666;
    line-height: 1.5;
}

.character-stats {
    display: flex;
    gap: 30px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    font-weight: 500;
    color: #495057;
}

.stat-value {
    color: #667eea;
    font-weight: 600;
}

.selection-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #e9ecef;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .difficulty-tabs {
        flex-direction: column;
        gap: 4px;
    }
    
    .difficulty-tab {
        text-align: center;
    }
    
    .characters-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .selected-character-preview {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .character-stats {
        justify-content: center;
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .selection-actions {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .selector-header {
        padding: 15px;
    }
    
    .selector-header h3 {
        font-size: 1.5em;
    }
    
    .character-card {
        padding: 15px;
    }
    
    .character-avatar {
        width: 60px;
        height: 60px;
        font-size: 2em;
    }
    
    .character-avatar-large {
        width: 80px;
        height: 80px;
        font-size: 2.5em;
    }
    
    .selection-info {
        padding: 20px;
    }
}

/* Animation for character selection */
@keyframes selectPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.character-card.selected {
    animation: selectPulse 0.6s ease-in-out;
}

/* Hover effects for better UX */
.character-card:hover .character-avatar {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.character-card:hover .trait {
    background: #e3f2fd;
    color: #1976d2;
    border-color: #bbdefb;
}

/* Loading animation */
.characters-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.characters-loading::after {
    content: "⚡";
    display: inline-block;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}