/* ============================================
   기본 스타일 (모바일 우선)
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
    font-size: 14px;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 15px;
    text-align: center;
}

.header h1 {
    font-size: 22px;
    margin-bottom: 8px;
    line-height: 1.3;
}

.header p {
    font-size: 13px;
    opacity: 0.9;
}

.disclaimer {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px;
    margin: 15px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.6;
}

.disclaimer strong {
    color: #856404;
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
}

.content {
    padding: 20px 15px;
}

.tab-menu {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.tab-menu::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.tab-btn {
    padding: 8px 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 40px; /* 터치 영역 확보 */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.3;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

/* 탭 텍스트 반응형 처리 */
.tab-text-short {
    display: none;
}

.tab-text-full {
    display: inline;
}

/* 작은 화면에서 짧은 텍스트 표시 */
@media (max-width: 600px) {
    .tab-text-short {
        display: inline;
    }
    
    .tab-text-full {
        display: none;
    }
}

/* 작은 모바일 화면 (480px 이하) */
@media (max-width: 480px) {
    .tab-menu {
        gap: 5px;
    }
    
    .tab-btn {
        padding: 7px 9px;
        font-size: 11px;
        min-height: 38px;
    }
}

/* 매우 작은 화면에서 추가 최적화 */
@media (max-width: 360px) {
    .tab-menu {
        gap: 4px;
    }
    
    .tab-btn {
        padding: 6px 6px;
        font-size: 10px;
        min-height: 36px;
    }
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

select, input[type="file"], textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px; /* iOS 줌 방지 */
    transition: border-color 0.3s;
    -webkit-appearance: none;
    appearance: none;
}

select:focus, textarea:focus {
    outline: none;
    border-color: #667eea;
}

textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.upload-options {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.upload-option-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
}

.upload-option-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.upload-option-btn:active {
    transform: translateY(0);
}

.upload-option-icon {
    font-size: 18px;
}

.upload-option-text {
    font-size: 14px;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    background: #f8f9ff;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 120px;
    position: relative;
    overflow: hidden;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.upload-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-area:hover {
    background: #f0f2ff;
    border-color: #5568d3;
}

.upload-area.dragover {
    background: #e8ebff;
    border-color: #4556c0;
}

.upload-icon {
    font-size: 40px;
    color: #667eea;
    margin-bottom: 8px;
}

.upload-area p {
    font-size: 14px;
    margin: 4px 0;
}

.preview-image {
    max-width: 100%;
    height: auto;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: block;
}

.remove-image-btn {
    padding: 8px 16px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.remove-image-btn:hover {
    background: #ff5252;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.btn {
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    min-height: 44px; /* 터치 영역 확보 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.result-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 15px;
}

.result-card h3 {
    color: #667eea;
    margin-bottom: 12px;
    font-size: 16px;
}

.result-card p {
    line-height: 1.7;
    color: #555;
    margin-bottom: 8px;
    font-size: 14px;
}

.color-analysis {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.color-chip {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.history-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.history-item:active {
    transform: scale(0.98);
}

.history-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.history-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.history-date {
    font-weight: 600;
    color: #667eea;
    font-size: 14px;
}

.history-age {
    background: #e8ebff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    color: #667eea;
}

.history-delete-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.history-delete-btn:hover {
    background: #ff5252;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.history-delete-btn:active {
    transform: scale(0.95);
}

.history-thumbnail {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
}

.comparison-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.comparison-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
}

.comparison-item h4 {
    color: #667eea;
    margin-bottom: 8px;
    font-size: 15px;
}

.comparison-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
}

.pattern-chart {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
}

.pattern-bar {
    background: #e0e0e0;
    height: 28px;
    border-radius: 14px;
    margin-bottom: 12px;
    overflow: hidden;
    position: relative;
}

.pattern-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: white;
    font-size: 11px;
    font-weight: 600;
}

/* 로딩 모달 */
.loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.loading-modal-content {
    background: white;
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    min-width: 280px;
    max-width: 90%;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.loading-subtext {
    font-size: 14px;
    color: #666;
    margin: 0;
}

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

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.empty-state p {
    font-size: 14px;
    margin: 8px 0;
}

.final-disclaimer {
    background: #f0f2ff;
    border-left: 4px solid #667eea;
    padding: 15px;
    margin-top: 20px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.7;
    color: #555;
}

.final-disclaimer strong {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #667eea;
}

/* 결과 페이지 스타일 */
.result-page {
    margin-top: 20px;
}

.result-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.result-age-label {
    font-size: 24px;
    color: #667eea;
    margin-bottom: 20px;
    font-weight: 600;
}

.result-image-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.result-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    object-fit: contain;
}

.result-content {
    margin-top: 20px;
}

.result-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* 레이더 차트 스타일 */
.radar-chart-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    margin-top: 20px;
}

.radar-chart {
    display: block;
    margin: 0 auto;
}

/* ============================================
   태블릿 (481px ~ 768px)
   ============================================ */
@media (min-width: 481px) {
    body {
        padding: 15px;
        font-size: 15px;
    }

    .container {
        border-radius: 16px;
    }

    .header {
        padding: 25px 20px;
    }

    .header h1 {
        font-size: 24px;
    }

    .header p {
        font-size: 14px;
    }

    .disclaimer {
        padding: 15px;
        margin: 20px;
        font-size: 13px;
    }

    .content {
        padding: 25px 20px;
    }

    .tab-menu {
        gap: 6px;
        margin-bottom: 25px;
    }

    .tab-btn {
        padding: 9px 12px;
        font-size: 13px;
        min-height: 42px;
    }

    .upload-options {
        gap: 12px;
    }

    .upload-option-btn {
        padding: 14px 18px;
        font-size: 15px;
    }

    .upload-option-icon {
        font-size: 20px;
    }

    .upload-area {
        padding: 35px 25px;
    }
    
    .camera-container {
        min-height: 450px;
    }

    .upload-icon {
        font-size: 44px;
    }

    .preview-image {
        max-height: 350px;
    }

    .result-card {
        padding: 20px;
    }

    .result-card h3 {
        font-size: 17px;
    }

    .result-card p {
        font-size: 15px;
    }

    .color-chip {
        width: 55px;
        height: 55px;
    }

    .history-item {
        padding: 18px;
    }

    .history-header {
        gap: 6px;
    }

    .history-delete-btn {
        padding: 5px 8px;
        font-size: 14px;
        min-width: 32px;
        min-height: 32px;
    }

    .history-thumbnail {
        height: 140px;
    }

    .comparison-item {
        padding: 18px;
    }

    .comparison-image {
        height: 180px;
    }

    .pattern-bar {
        height: 30px;
    }

    .pattern-fill {
        font-size: 12px;
        padding: 0 15px;
    }
}

/* ============================================
   태블릿 큰 화면 / 작은 데스크톱 (769px ~ 1024px)
   ============================================ */
@media (min-width: 769px) {
    body {
        padding: 20px;
        font-size: 16px;
    }

    .container {
        border-radius: 20px;
        box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    }

    .header {
        padding: 30px;
    }

    .header h1 {
        font-size: 28px;
        margin-bottom: 10px;
    }

    .header p {
        font-size: 14px;
    }

    .disclaimer {
        padding: 15px;
        margin: 20px;
        font-size: 13px;
    }

    .content {
        padding: 30px;
    }

    .tab-menu {
        gap: 10px;
        margin-bottom: 30px;
        overflow-x: visible; /* 가로 스크롤 제거 */
    }

    .tab-btn {
        padding: 12px 24px;
        font-size: 15px;
    }

    .upload-options {
        gap: 15px;
    }

    .upload-option-btn {
        padding: 14px 20px;
        font-size: 15px;
    }

    .upload-area {
        padding: 40px;
    }
    
    .camera-container {
        min-height: 500px;
    }

    .upload-icon {
        font-size: 48px;
    }

    .preview-image {
        max-height: 400px;
    }

    .result-card {
        padding: 25px;
        margin-bottom: 20px;
    }

    .result-card h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .result-card p {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .color-analysis {
        gap: 10px;
        margin-top: 15px;
    }

    .color-chip {
        width: 60px;
        height: 60px;
    }

    .history-item {
        padding: 20px;
        margin-bottom: 15px;
    }

    .history-delete-btn {
        padding: 7px 12px;
        font-size: 18px;
    }

    .history-thumbnail {
        height: 150px;
    }

    .comparison-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        margin-top: 20px;
    }

    .comparison-item {
        padding: 20px;
    }

    .comparison-image {
        height: 200px;
    }

    .pattern-chart {
        padding: 20px;
        margin-top: 20px;
    }

    .pattern-bar {
        height: 30px;
        margin-bottom: 15px;
    }

    .pattern-fill {
        font-size: 12px;
        padding: 0 15px;
    }

    .loading-modal-content {
        padding: 30px 20px;
        min-width: 240px;
    }

    .loading-spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }

    .loading-text {
        font-size: 16px;
    }

    .loading-subtext {
        font-size: 13px;
    }

    .empty-state {
        padding: 60px 20px;
    }

    .empty-state-icon {
        font-size: 64px;
        margin-bottom: 20px;
    }

    .final-disclaimer {
        padding: 20px;
        margin-top: 30px;
        font-size: 13px;
    }
}

/* ============================================
   데스크톱 (1025px 이상)
   ============================================ */
@media (min-width: 1025px) {
    .container {
        max-width: 1000px;
    }

    .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    }

    .history-item:hover {
        border-color: #667eea;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    }
}

/* ============================================
   매우 작은 모바일 (320px 이하)
   ============================================ */
@media (max-width: 320px) {
    body {
        padding: 8px;
    }

    .container {
        border-radius: 8px;
    }

    .header {
        padding: 15px 12px;
    }

    .header h1 {
        font-size: 18px;
    }

    .header p {
        font-size: 12px;
    }

    .disclaimer {
        padding: 10px;
        margin: 12px;
        font-size: 11px;
    }

    .content {
        padding: 15px 12px;
    }

    .tab-menu {
        gap: 4px;
        margin-bottom: 15px;
    }

    .tab-btn {
        padding: 6px 8px;
        font-size: 11px;
        min-height: 38px;
        gap: 2px;
    }
    
    .upload-options {
        flex-direction: column;
        gap: 8px;
    }
    
    .upload-option-btn {
        width: 100%;
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .upload-option-icon {
        font-size: 16px;
    }
    
    .camera-modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .camera-container {
        min-height: 300px;
        max-height: 50vh;
    }
    
    .camera-controls {
        flex-direction: column;
        padding: 15px;
    }
    
    .camera-btn {
        width: 100%;
    }

    .upload-area {
        padding: 20px 15px;
    }

    .upload-icon {
        font-size: 36px;
    }

    .result-card {
        padding: 15px;
    }

    .result-card h3 {
        font-size: 15px;
    }

    .color-chip {
        width: 45px;
        height: 45px;
    }
}

/* ============================================
   가로 모드 (Landscape) 최적화
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: 15px 20px;
    }

    .header h1 {
        font-size: 20px;
        margin-bottom: 4px;
    }

    .content {
        padding: 15px 20px;
    }

    .upload-area {
        padding: 20px;
        min-height: 100px;
    }

    .preview-image {
        max-height: 200px;
    }
}

/* ============================================
   접근성 개선
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 카메라 모달 */
.camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.camera-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.camera-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.camera-modal-header h3 {
    margin: 0;
    color: #667eea;
    font-size: 18px;
}

.camera-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.camera-close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.camera-container {
    position: relative;
    width: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    max-height: 60vh;
}

#cameraVideo {
    width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: contain;
}

.camera-controls {
    display: flex;
    gap: 10px;
    padding: 20px;
    justify-content: center;
}

.camera-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 44px;
    min-width: 120px;
}

.camera-capture-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.camera-capture-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.camera-cancel-btn {
    background: #e0e0e0;
    color: #333;
}

.camera-cancel-btn:hover {
    background: #d0d0d0;
}

.camera-hint {
    text-align: center;
    padding: 10px 20px;
    font-size: 12px;
    color: #999;
    margin: 0;
}

/* 포커스 스타일 개선 */
.tab-btn:focus,
.btn:focus,
.upload-option-btn:focus,
.camera-btn:focus,
select:focus,
textarea:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }

    .result-card {
        border: 1px solid #ddd;
    }
}

/* ============================================
   분석 결과 모달
   ============================================ */
.result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    backdrop-filter: blur(4px);
    padding: 20px;
    overflow-y: auto;
}

.result-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.result-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.result-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: white;
}

.result-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    flex-shrink: 0;
}

.result-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.result-modal-close:active {
    transform: scale(0.95);
}

.result-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* 유아기 분석 결과 특별 스타일 */
.analysis-category {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.analysis-category-title {
    color: #667eea;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.analysis-section {
    margin-bottom: 16px;
}

.analysis-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.analysis-section-content {
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    line-height: 1.7;
    color: #555;
    font-size: 14px;
}

.analysis-section.extractable .analysis-section-title {
    color: #28a745;
}

.analysis-section.limited .analysis-section-title {
    color: #ffc107;
}

.risk-summary {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 16px;
    border-radius: 8px;
    margin-top: 20px;
}

.risk-summary-title {
    color: #856404;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.risk-summary-content {
    color: #856404;
    line-height: 1.7;
    font-size: 14px;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .result-modal {
        padding: 10px;
    }

    .result-modal-content {
        max-height: 95vh;
        border-radius: 12px;
    }

    .result-modal-header {
        padding: 16px 20px;
    }

    .result-modal-title {
        font-size: 18px;
    }

    .result-modal-body {
        padding: 20px 16px;
    }

    .analysis-category {
        padding: 16px;
        margin-bottom: 16px;
    }

    .analysis-category-title {
        font-size: 16px;
    }

    .analysis-section-content {
        padding: 10px 12px;
        font-size: 13px;
    }
}
