/* /public/css/character.css */

/* 캐릭터 생성 모달 */
.character-creation-modal {
    width: 600px;
    max-width: 100%;
}

.worldview-selection {
    margin-bottom: 32px;
}

.worldview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.worldview-card {
    background: var(--background);
    border: 2px solid var(--surface-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.worldview-card:hover {
    border-color: var(--primary-color);
    transform: scale(1.02);
}

.worldview-card.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.worldview-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: linear-gradient(135deg, var(--surface-light), var(--primary-dark));
}

.worldview-info {
    padding: 16px;
}

.worldview-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.worldview-lore {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* 세계관 상세 정보 */
.worldview-detail {
    background: var(--background);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 24px;
}

.worldview-detail-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
}

.worldview-detail-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.worldview-detail-lore {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
}

.worldview-sections {
    display: grid;
    gap: 16px;
}

.worldview-section {
    background: var(--surface);
    padding: 16px;
    border-radius: 8px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-light);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.location-item,
.faction-item {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--surface-light);
}

.location-item:last-child,
.faction-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.item-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.item-description {
    font-size: 13px;
    color: var(--text-muted);
}

.difficulty-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.difficulty-easy {
    background: rgba(74, 222, 128, 0.2);
    color: var(--success);
}

.difficulty-normal {
    background: rgba(251, 191, 36, 0.2);
    color: var(--warning);
}

.difficulty-hard {
    background: rgba(251, 146, 60, 0.2);
    color: #fb923c;
}

.difficulty-extreme {
    background: rgba(248, 113, 113, 0.2);
    color: var(--error);
}

.difficulty-impossible {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

/* 캐릭터 입력 폼 */
.character-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-section {
    background: var(--background);
    padding: 20px;
    border-radius: var(--border-radius);
}

.section-header {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.character-count {
    font-size: 13px;
    color: var(--text-muted);
    text-align: right;
}

.image-upload-area {
    border: 2px dashed var(--surface-light);
    border-radius: var(--border-radius);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.image-upload-area:hover {
    border-color: var(--primary-color);
    background: var(--surface-light);
}

.image-upload-area.has-image {
    padding: 0;
    border: none;
}

.upload-icon {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.upload-text {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.upload-subtext {
    font-size: 13px;
    color: var(--text-muted);
}

.preview-image {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    display: block;
}

.remove-image {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(248, 113, 113, 0.9);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 16px;
}

.remove-image:hover {
    background: var(--error);
    transform: scale(1.1);
}

.file-input-hidden {
    display: none;
}

/* 제출 버튼 영역 */
.submit-section {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.cooldown-notice {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: var(--warning);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 프롬프트 인젝션 경고 스타일 */
.prompt-injection-warning {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid rgba(239, 68, 68, 0.4);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: warningPulse 2s ease-in-out infinite;
}

.prompt-injection-warning i {
    color: #ef4444;
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.prompt-injection-warning .warning-content {
    flex: 1;
}

.prompt-injection-warning .warning-content strong {
    display: block;
    color: #ef4444;
    font-size: 15px;
    margin-bottom: 6px;
    font-weight: 700;
}

.prompt-injection-warning .warning-content p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
}

.prompt-injection-warning .warning-content strong {
    color: #dc2626;
}

@keyframes warningPulse {
    0%, 100% {
        border-color: rgba(239, 68, 68, 0.4);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2);
    }
    50% {
        border-color: rgba(239, 68, 68, 0.6);
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
    }
}

/* 캐릭터 선택 모달 스타일 */
.character-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 20px;
    max-height: 450px;
    overflow-y: auto;
    padding: 4px;
}

.character-selection-card {
    background: var(--card-bg);
    border: 3px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.character-selection-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-color: var(--primary);
}

.character-selection-card.selected {
    border-color: var(--primary);
    border-width: 4px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.character-selection-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
}

.character-selection-info {
    width: 100%;
    text-align: center;
}

.character-selection-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 4px 0;
}

.character-selection-worldview {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
}

.character-selection-stats {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.character-selection-stats .stat-badge {
    font-size: 12px;
    padding: 4px 8px;
}

.modal-subtitle {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 14px;
}

.modal-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.target-character-info {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.target-character-info .modal-subtitle {
    margin: 0;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .character-creation-modal {
        width: 100%;
        max-height: 85vh;
    }
    
    .worldview-grid {
        grid-template-columns: 1fr;
    }
    
    .form-section {
        padding: 16px;
    }
    
    .character-selection-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    /* 모바일에서 경고 메시지 최적화 */
    .prompt-injection-warning {
        padding: 12px;
        gap: 10px;
    }
    
    .prompt-injection-warning i {
        font-size: 20px;
    }
    
    .prompt-injection-warning .warning-content strong {
        font-size: 14px;
    }
    
    .prompt-injection-warning .warning-content p {
        font-size: 12px;
    }
}
