/* 통계 카드 개선 */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
}

.stat-card:hover {
    border-color: var(--mbti-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: var(--mbti-primary);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #666;
}

/* 메인 레이아웃 */
.main-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.stats-column {
    flex: 0 0 280px;
    min-width: 280px;
}

.content-column {
    flex: 1;
    min-width: 0;
}

/* 통계 섹션 스타일 */
.stats-section {
    background: white;
    border: 2px solid var(--mbti-primary);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.stats-section h3 {
    margin: 0 0 15px 0;
    color: var(--mbti-primary);
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 카테고리 통계 개선 */
.category-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.category-stat {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    position: relative;
}

.category-stat:hover {
    background: var(--mbti-light);
    border-color: var(--mbti-primary);
    transform: translateX(5px);
}

.category-stat.selected {
    background: var(--mbti-light);
    border-color: var(--mbti-primary);
    font-weight: bold;
}

.category-stat-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 10px;
}

/* 최근 활동 */
.recent-activities {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-item {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 12px;
    border-left: 3px solid var(--mbti-primary);
}

.activity-time {
    font-size: 10px;
    color: #666;
    margin-bottom: 4px;
}

.activity-text {
    color: #333;
}

/* 진행 상황 표시 */
.progress-indicators {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #666;
}

.progress-icon {
    font-size: 10px;
}

/* 빠른 템플릿 개선 */
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
    }
    
    .stats-column {
        flex: 1 1 auto;
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .content-column {
        width: 100%;
    }
}

/* 반응형 - 모바일 */
@media (max-width: 768px) {
    .stats-column {
        grid-template-columns: 1fr;
    }

    .category-stat {
        font-size: 12px;
        padding: 6px 10px;
    }
}
/* 나머지 기존 스타일... */
:root {
    --mbti-primary: #667eea;
    --mbti-secondary: #764ba2;
    --mbti-light: #f0f4ff;
    --mbti-gradient: linear-gradient(135deg, var(--mbti-primary), var(--mbti-secondary));
}

.mbti-analysis-section {
    background: var(--mbti-light);
    border: 2px solid var(--mbti-primary);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.mbti-comparison {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mbti-person {
    flex: 1;
    min-width: 200px;
    background: white;
    padding: 15px;
    border-radius: 12px;
    border: 2px solid #e0e7ff;
    transition: all 0.3s;
}

.mbti-person:hover {
    border-color: var(--mbti-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.mbti-person h5 {
    margin: 0 0 10px 0;
    color: var(--mbti-primary);
    font-weight: bold;
}

.mbti-select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.mbti-select:focus {
    border-color: var(--mbti-primary);
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.4);
    outline: none;
}

.mbti-vs {
    font-size: 32px;
    font-weight: bold;
    color: var(--mbti-primary);
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-width: 50px;
    text-align: center;
}
.compatibility-meter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.scenario-preview-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.scenario-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.scenario-content-preview {
    background: #f8f9fa;
    padding: 18px;
    border-radius: 10px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
}

.scenario-json-preview {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 18px;
    border-radius: 10px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 12px;
    border: 1px solid #34495e;
}

/* .mbti-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.mbti-stat-item {
    background: white;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #f0f0f0;
    transition: all 0.3s;
}

.mbti-stat-item:hover {
    border-color: var(--mbti-primary);
    background: var(--mbti-light);
}

.mbti-stat-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.mbti-stat-value {
    font-size: 18px;
    font-weight: bold;
    color: var(--mbti-primary);
} */

/* ========================================
   MBTI AI 페이지 전용 스타일
   ======================================== */

/* MBTI 타입별 분포 - 2열 그리드 */
 
/* ========================================
   MBTI AI 페이지 전용 스타일
   ======================================== */
/* 시나리오 미리보기 카드 */
.scenario-preview-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
/* 반응형 디자인 */
@media (max-width: 768px) {
    .scenario-config {
        grid-template-columns: 1fr;
    }
    
    .mbti-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .main-container {
        flex-direction: column;
    }
    
    .button-group {
        flex-direction: column;
        width: 100%;
    }
    
    .button-group button {
        width: 100%;
    }
}

.category-stat-count {
    font-weight: bold;
    color: var(--mbti-primary);
    margin-right: 8px;
}
.category-need-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-left: 8px;
}

.category-need-indicator.red {
    background: #e74c3c;
}

.category-need-indicator.yellow {
    background: #f39c12;
}

.category-need-indicator.green {
    background: #27ae60;
}

.quick-templates-section {
    background: var(--mbti-light);
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border: 2px solid var(--mbti-primary);
}

.quick-templates-section h3 {
    margin: 0 0 10px 0;
    color: var(--mbti-primary);
    font-size: 18px;
}

.quick-templates-section p {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #666;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.template-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e0e7ff;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.template-card:hover {
    border-color: var(--mbti-primary);
    background: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25);
}

.template-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.template-title {
    font-weight: bold;
    color: var(--mbti-primary);
    margin-bottom: 5px;
    font-size: 14px;
}

.template-desc {
    font-size: 12px;
    color: #666;
}

/* 로딩 애니메이션 개선 */
.loading-pulse {
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* ========================================
   MBTI AI 페이지 전용 스타일
   ======================================== */

/* MBTI 타입별 분포 - 2열 그리드 */
.mbti-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.mbti-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f5f5f5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mbti-stat-item:hover {
    background: var(--mbti-light);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.mbti-stat-label {
    font-weight: 600;
    color: #333;
}

.mbti-stat-value {
    background: var(--mbti-primary);
    color: white;
    padding: 2px 10px;
    border-radius: 15px;
    font-size: 0.9em;
}

/* AI 시나리오 설정 - 1행 레이아웃 */
.scenario-config {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 15px;
    align-items: start;
    margin-bottom: 20px;
}

/* 폼 그리드 레이아웃 추가 */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: end;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.form-group select,
.form-group input {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
    width: 100%;
}

.form-group select:hover,
.form-group select:focus,
.form-group input:hover,
.form-group input:focus {
    border-color: var(--mbti-primary);
    outline: none;
}

/* 생성 개수 입력 필드 */
.form-group input[type="number"] {
    width: 80px;
}

.config-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.config-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
}

.config-group select {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.config-group select:hover,
.config-group select:focus {
    border-color: var(--mbti-primary);
    outline: none;
}

/* MBTI 선택 분석 섹션 */
#mbti-insights {
    grid-column: span 4;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 10px;
    margin-top: 10px;
}

.compatibility-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.compatibility-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4);
    transition: width 0.5s ease;
}

/* 프롬프트 입력 영역 */
.prompt-section {
    margin: 20px 0;
}

.prompt-section textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.prompt-section textarea:focus {
    border-color: var(--mbti-primary);
    outline: none;
}

/* 버튼 그룹 */
.button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.btn-primary, .btn-secondary, .btn-warning, .btn-success {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--mbti-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--mbti-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1.1em;
}

/* 빠른 템플릿 */
.template-item {
    cursor: pointer;
    padding: 12px;
    margin: 8px 0;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.template-item:hover {
    background: var(--mbti-light);
    transform: translateX(5px);
}

/* 시나리오 미리보기 카드 */
.scenario-preview-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;  /* 전체 너비 사용 */
}

/* 시나리오 미리보기 컨테이너 */
#scenario-previews {
    display: flex;
    flex-direction: column;  /* 세로 정렬 */
    gap: 20px;
    width: 100%;
}

.scenario-mbti-pair {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mbti-badge {
    background: var(--mbti-primary);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
}

.mbti-vs {
    color: #999;
    font-weight: 600;
}

/* 메시지 스타일 */
.message {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    animation: slideInRight 0.5s ease-out;
}

.message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 애니메이션 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .scenario-config {
        grid-template-columns: 1fr;
    }
    
    .mbti-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .main-container {
        flex-direction: column;
    }
    
    .button-group {
        flex-direction: column;
        width: 100%;
    }
    
    .button-group button {
        width: 100%;
    }
}