/**
 * Re:Beauty Studio - 성형 시뮬레이션 스타일
 * 성형외과 클리닉 컨셉 디자인 (4열 레이아웃)
 */

:root {
    --primary: #0D9488;
    --primary-light: #14B8A6;
    --primary-dark: #0F766E;
    --accent: #06B6D4;
    --bg-main: #F8FAFB;
    --bg-card: #FFFFFF;
    --bg-hover: #F0FDFA;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    --border-focus: #0D9488;
    --success: #10B981;
    --error: #EF4444;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

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

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.app-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 헤더 */
.header {
    text-align: center;
    padding: 24px 0;
    margin-bottom: 24px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo svg {
    color: var(--primary);
}

.logo h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
}

.tagline {
    color: var(--text-secondary);
    font-size: 14px;
}

.header {
    position: relative;
}

.logs-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.logs-link:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.logs-link svg {
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.logs-link:hover svg {
    color: var(--primary);
}

/* 헤더 액션 영역 */
.header-actions {
    position: absolute;
    top: 24px;
    right: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
}

.user-info svg {
    color: var(--primary);
}

.logout-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: var(--bg-card);
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.logout-link:hover {
    background: #FEF2F2;
    border-color: #FECACA;
    color: var(--error);
}

.logout-link:hover svg {
    color: var(--error);
}

/* ゲストモード */
.user-info.guest-mode {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    color: #92400E;
    border: 1px solid #F59E0B;
}

.user-info.guest-mode svg {
    color: #D97706;
}

.login-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #FFFFFF;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    border: none;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.login-link:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.login-link svg {
    color: #FFFFFF;
}

/* メインコンテンツ */
.main-content {
    flex: 1;
}

/* 4열 이미지 섹션 */
.image-section {
    display: grid;
    grid-template-columns: 1fr 1fr minmax(220px, 280px) 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.image-column {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.column-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.step-number {
    width: 26px;
    height: 26px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.column-header h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 업로드 영역 */
.upload-area {
    position: relative;
    aspect-ratio: 3/4;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-main);
}

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

.upload-area.dragover {
    border-color: var(--primary);
    background: var(--bg-hover);
    border-style: solid;
}

.upload-area.has-image {
    border-style: solid;
    border-color: var(--primary);
}

.upload-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

.upload-placeholder svg {
    color: var(--text-muted);
    margin-bottom: 12px;
}

.upload-placeholder p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 6px;
}

.upload-placeholder .file-types {
    color: var(--text-muted);
    font-size: 11px;
}

.preview-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.upload-area.has-image .upload-placeholder {
    display: none;
}

.upload-area.has-image .preview-image {
    display: block;
}

.remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-btn svg {
    color: white;
}

.remove-btn:hover {
    background: var(--error);
}

.upload-area.has-image .remove-btn {
    display: flex;
}

/* 3열: 부위 선택 컬럼 */
.options-column {
    background: linear-gradient(135deg, #F0FDFA 0%, #E0F2FE 100%);
}

.surgery-options-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-card-mini {
    cursor: pointer;
    display: block;
}

.option-card-mini input {
    display: none;
}

.option-content-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.option-card-mini:hover .option-content-mini {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.option-card-mini input:checked + .option-content-mini {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.option-icon-mini {
    width: 36px;
    height: 36px;
    background: var(--bg-main);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.option-icon-mini svg {
    color: var(--primary);
}

.option-name-mini {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.option-check-mini {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.option-check-mini svg {
    color: white;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.option-card-mini input:checked + .option-content-mini .option-check-mini {
    background: var(--primary);
    border-color: var(--primary);
}

.option-card-mini input:checked + .option-content-mini .option-check-mini svg {
    opacity: 1;
}

/* 인라인 시뮬레이션 버튼 */
.simulate-btn-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    margin-top: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.4);
}

.simulate-btn-inline:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.5);
}

.simulate-btn-inline:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

/* 결과 영역 */
.result-column {
    background: linear-gradient(135deg, #F0FDFA 0%, #ECFEFF 100%);
}

.result-area {
    position: relative;
    aspect-ratio: 3/4;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: white;
}

.result-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

.result-placeholder svg {
    color: var(--primary);
    opacity: 0.5;
    margin-bottom: 12px;
}

.result-placeholder p {
    color: var(--text-muted);
    font-size: 13px;
}

.result-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.result-area.has-result .result-placeholder {
    display: none;
}

.result-area.has-result .result-image {
    display: block;
}

/* 결과 아래 정보 영역 */
.result-info {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.result-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.duration-info {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.duration-info svg {
    color: var(--primary);
}

.created-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.result-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
}

.download-btn {
    background: var(--bg-main);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.download-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.ba-btn {
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
}

.ba-btn:hover {
    background: #0891B2;
}

.merge-btn {
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
}

.merge-btn:hover {
    background: var(--primary-dark);
}

/* 로딩 오버레이 */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    text-align: center;
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-content p {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

#loadingText {
    transition: opacity 0.3s ease;
    min-height: 27px;
}

.loading-content span {
    color: var(--text-secondary);
    font-size: 14px;
}

/* 모달 */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.modal-icon {
    margin-bottom: 20px;
}

.modal-icon.error svg {
    color: var(--error);
}

.modal-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.modal-btn {
    padding: 12px 32px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.modal-btn:hover {
    background: var(--primary-dark);
}

/* 연예인 선택 버튼 */
.select-celebrity-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    margin-top: 12px;
    background: linear-gradient(135deg, #EC4899 0%, #DB2777 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.4);
    position: relative;
    z-index: 10;
}

.select-celebrity-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.5);
}

.celebrity-name {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* 연예인 선택 모달 */
.celebrity-modal-content {
    max-width: 700px;
    width: 95%;
    padding: 24px;
    max-height: 85vh;
    overflow-y: auto;
}

.celebrity-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.celebrity-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.close-modal-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-modal-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.celebrity-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.celebrity-item {
    cursor: pointer;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    background: var(--bg-main);
}

.celebrity-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.celebrity-item img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
}

.celebrity-item span {
    display: block;
    text-align: center;
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-card);
}

@media (max-width: 768px) {
    .celebrity-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

@media (max-width: 640px) {
    .celebrity-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .celebrity-modal-content {
        padding: 16px;
    }
    .celebrity-item span {
        font-size: 12px;
        padding: 8px 4px;
    }
}

/* 푸터 */
.footer {
    text-align: center;
    padding: 24px 0;
    margin-top: 24px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    background: var(--bg-main);
}

.footer p {
    color: var(--text-muted);
    font-size: 12px;
    margin: 0;
}

.footer .disclaimer {
    margin-top: 6px;
    font-size: 11px;
}

/* 반응형 */
@media (max-width: 1200px) {
    .image-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .options-column {
        order: 3;
    }

    .result-column {
        order: 4;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 16px;
    }

    .image-section {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .image-column {
        max-width: 100%;
    }

    .options-column {
        order: 3;
    }

    .result-column {
        order: 4;
    }
}

/* ==================== 모드 선택 탭 ==================== */
.mode-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding: 6px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.mode-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    min-width: 160px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.mode-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.mode-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.mode-tab.active svg {
    color: white;
}

.mode-tab svg {
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.mode-tab:hover svg {
    color: var(--primary);
}

/* 모드 콘텐츠 */
.image-section.mode-content {
    display: none !important;
}

.image-section.mode-content.active {
    display: grid !important;
}

/* ==================== 성형외과 의사 모드 ==================== */
.doctor-mode {
    grid-template-columns: 1fr 1fr 1.5fr 1fr;
}

.doctor-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #F0FDFA 0%, #ECFEFF 100%);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--primary-dark);
    font-weight: 500;
}

.doctor-badge svg {
    color: var(--primary);
    flex-shrink: 0;
}

/* 카테고리 리스트 (2열 - 1depth) */
.category-column {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 30%, #FCD34D 100%);
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.category-btn:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.category-btn.active {
    border-color: var(--primary);
    background: var(--bg-hover);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.category-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-main);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.category-icon svg {
    color: var(--primary);
}

.category-btn.active .category-icon {
    background: var(--primary);
}

.category-btn.active .category-icon svg {
    color: white;
}

.category-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.category-count {
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: var(--bg-main);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-count.has-selection {
    background: var(--primary);
    color: white;
}

.category-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.category-btn.active .category-arrow {
    color: var(--primary);
}

/* 시술 리스트 (3열 - 2depth) */
.procedure-column {
    background: linear-gradient(135deg, #E0F2FE 0%, #BAE6FD 100%);
}

.procedure-list {
    max-height: 450px;
    overflow-y: auto;
    padding-right: 4px;
}

.procedure-list::-webkit-scrollbar {
    width: 6px;
}

.procedure-list::-webkit-scrollbar-track {
    background: var(--bg-main);
    border-radius: 3px;
}

.procedure-list::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

.procedure-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.procedure-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    min-height: 300px;
}

.procedure-placeholder svg {
    color: var(--primary);
    opacity: 0.4;
    margin-bottom: 16px;
}

.procedure-placeholder p {
    color: var(--text-muted);
    font-size: 14px;
}

.procedure-group {
    display: none;
}

.procedure-group.active {
    display: block;
}

.procedure-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

.procedure-group-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-dark);
}

.selected-count {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.procedure-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.procedure-item {
    display: block;
    cursor: pointer;
}

.procedure-item input {
    display: none;
}

.procedure-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.procedure-item:hover .procedure-content {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.procedure-item input:checked + .procedure-content {
    border-color: var(--primary);
    background: linear-gradient(135deg, #F0FDFA 0%, #CCFBF1 100%);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.procedure-info {
    flex: 1;
}

.procedure-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.procedure-desc {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.procedure-check {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.procedure-check svg {
    color: white;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.procedure-item input:checked + .procedure-content .procedure-check {
    background: var(--primary);
    border-color: var(--primary);
}

.procedure-item input:checked + .procedure-content .procedure-check svg {
    opacity: 1;
}

/* 선택 요약 & 시뮬레이션 버튼 */
.selected-summary {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.summary-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.clear-all-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.clear-all-btn:hover {
    border-color: var(--error);
    color: var(--error);
    background: #FEF2F2;
}

.summary-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    min-height: 32px;
}

.no-selection {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

.summary-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg-hover);
    border: 1px solid var(--primary);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--primary-dark);
}

.tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.tag-remove svg {
    color: var(--text-muted);
}

.tag-remove:hover {
    background: var(--error);
}

.tag-remove:hover svg {
    color: white;
}

/* 의사 모드 시뮬레이션 버튼 */
.simulate-btn-doctor {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
    font-family: inherit;
}

.simulate-btn-doctor:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
}

.simulate-btn-doctor:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

/* 의사 모드 결과 영역 */
.doctor-mode .result-column {
    background: linear-gradient(135deg, #F3E8FF 0%, #E9D5FF 100%);
}

.doctor-note {
    display: block;
    margin-top: 8px;
    font-size: 11px;
    color: var(--primary);
    font-weight: 500;
}

/* 반応型 - 美容外科医モード */
@media (max-width: 1100px) {
    .doctor-mode {
        grid-template-columns: repeat(2, 1fr);
    }

    .doctor-mode .category-column {
        order: 2;
    }

    .doctor-mode .procedure-column {
        order: 3;
    }

    .doctor-mode .result-column {
        order: 4;
    }
}

@media (max-width: 768px) {
    .mode-tabs {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .mode-tab {
        justify-content: center;
        padding: 14px;
        min-width: unset;
        width: 100%;
    }

    .doctor-mode {
        grid-template-columns: 1fr;
    }

    .procedure-list {
        max-height: 350px;
    }
}

/* ==================== AI相談チャットボット ==================== */

.chatbot-section {
    display: none !important;
}

.chatbot-section.active {
    display: block !important;
    width: 100%;
}

.chatbot-container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    height: calc(100vh - 320px);
    min-height: 550px;
    max-height: 800px;
}

/* チャットエリア */
.chat-area {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #F0FDFA 0%, #E0F2FE 100%);
    flex-shrink: 0;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.ai-info h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.ai-status {
    font-size: 12px;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.chat-clear-btn {
    padding: 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-clear-btn:hover {
    background: var(--bg-hover);
    color: var(--error);
    border-color: var(--error);
}

/* チャットメッセージエリア */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

.chat-message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

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

.chat-message.ai-message {
    align-self: flex-start;
}

.chat-message.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-message .message-avatar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
}

.user-message .message-avatar {
    background: var(--text-secondary);
    color: white;
}

.message-content {
    background: var(--bg-main);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    position: relative;
}

.ai-message .message-content {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-top-left-radius: 4px;
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-top-right-radius: 4px;
}

.message-content p {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 8px;
}

.message-content p:last-of-type {
    margin-bottom: 0;
}

.message-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.message-content li {
    font-size: 13px;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.ai-message .message-content li {
    color: var(--text-secondary);
}

.user-message .message-content li {
    color: rgba(255, 255, 255, 0.9);
}

.message-time {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}

.user-message .message-time {
    color: rgba(255, 255, 255, 0.7);
}

/* タイピングインジケーター */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 18px;
}

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

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

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

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

/* チャット入力エリア */
.chat-input-area {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chat-input-wrapper textarea {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    resize: none;
    min-height: 48px;
    max-height: 120px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.chat-input-wrapper textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.send-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.send-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

.chat-disclaimer {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    margin-bottom: 0;
    text-align: center;
    line-height: 1.4;
}

/* チャットサイドバー */
.chat-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.quick-questions {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.quick-questions h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-question-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quick-question-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    font-family: inherit;
}

.quick-question-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.quick-question-btn svg {
    color: var(--primary);
    flex-shrink: 0;
}

/* 情報ボックス */
.chat-info-box {
    background: linear-gradient(135deg, #F0FDFA 0%, #E0F2FE 100%);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border);
}

.chat-info-box .info-icon {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.chat-info-box h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.chat-info-box p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 14px;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.contact-link:hover {
    background: var(--primary-dark);
}

/* チャットボットレスポンシブ */
@media (max-width: 1100px) {
    .chatbot-container {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
        min-height: auto;
    }

    .chat-area {
        height: 500px;
        min-height: 500px;
    }

    .chat-sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .chatbot-container {
        gap: 16px;
    }

    .chat-area {
        height: 450px;
        min-height: 450px;
    }

    .chat-sidebar {
        grid-template-columns: 1fr;
    }

    .chat-message {
        max-width: 95%;
    }

    .quick-question-btn {
        font-size: 12px;
        padding: 10px 12px;
    }

    .chat-input-wrapper textarea {
        font-size: 16px; /* iOS 줌 방지 */
    }

    .chat-input-area {
        padding: 12px 16px;
    }

    .chat-disclaimer {
        font-size: 10px;
        margin-top: 6px;
    }
}
