/* 시니어 접근성을 고려한 모바일 최적화 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
    background: linear-gradient(135deg, #0f4c75 0%, #3282b8 100%);
    color: #2c3e50;
    font-size: 18px; /* 시니어 접근성을 위해 큰 글자 */
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
    padding: 12px;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 480px; /* 시니어 친화적 너비 */
    background: white;
    border-radius: 25px;
    margin: 0 auto;
    padding: 35px 30px; /* 넉넉한 패딩 */
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    min-height: calc(100vh - 24px);
    border: 2px solid #e3f2fd;
}

/* 고급스러운 헤더 */
.header {
    text-align: center;
    margin-bottom: 35px;
    padding: 30px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    border: 1px solid #dee2e6;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1976d2, #42a5f5, #1976d2);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 18px;
}

.logo-icon {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    font-weight: 700;
    box-shadow: 0 5px 15px rgba(25, 118, 210, 0.3);
}

h1 {
    color: #1565c0;
    font-size: 34px; /* 큰 제목 */
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.subtitle {
    color: #546e7a;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.badge {
    display: inline-block;
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: white;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

h2 {
    color: #1565c0;
    font-size: 26px; /* 큰 글자 */
    font-weight: 700;
    margin-bottom: 18px;
    text-align: center;
}

h3 {
    color: #1565c0;
    font-size: 22px; /* 큰 글자 */
    font-weight: 600;
    margin-bottom: 15px;
}

/* 진행 표시기 */
.progress-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 15px;
}

.progress-step {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e0e0e0;
    transition: all 0.4s ease;
    position: relative;
}

.progress-step.active {
    background: #1976d2;
    transform: scale(1.4);
    box-shadow: 0 0 0 4px rgba(25, 118, 210, 0.2);
}

.progress-step.completed {
    background: #4caf50;
    transform: scale(1.2);
}

/* 폼 스타일 */
.form-group {
    margin-bottom: 28px;
}

label {
    display: block;
    font-size: 19px; /* 큰 라벨 */
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 12px;
}

input, select {
    width: 100%;
    padding: 20px 22px; /* 넉넉한 패딩 */
    font-size: 18px; /* 큰 글자 */
    border-radius: 15px;
    border: 2px solid #e0e0e0;
    background: #fafafa;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    font-weight: 500;
}

input:focus, select:focus {
    outline: none;
    border-color: #1976d2;
    background: white;
    box-shadow: 0 0 0 4px rgba(25, 118, 210, 0.1);
    transform: translateY(-1px);
}

/* 버튼 스타일 - 시니어 친화적 */
.btn {
    width: 100%;
    padding: 22px 28px; /* 큰 버튼 */
    font-size: 20px; /* 큰 글자 */
    font-weight: 700;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 22px;
    touch-action: manipulation;
    user-select: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-height: 60px; /* 최소 높이 보장 */
}

.btn-primary {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(25, 118, 210, 0.4);
}

.btn-primary:hover, .btn-primary:active {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(25, 118, 210, 0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, #f5f5f5 0%, #e9ecef 100%);
    color: #495057;
    border: 2px solid #dee2e6;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-recommend {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.btn-save {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
}

.btn-kakao {
    background: linear-gradient(135deg, #fee500 0%, #f9d71c 100%);
    color: #3c1e1e;
    box-shadow: 0 6px 20px rgba(254, 229, 0, 0.4);
}

.btn-group {
    display: flex;
    gap: 15px;
    margin-top: 28px;
}

.btn-group .btn {
    flex: 1;
    margin-top: 0;
    font-size: 18px;
    padding: 18px 22px;
}

/* 약물 선택 그리드 - 시니어 친화적 2열 */
.medicine-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin: 25px 0;
}

.medicine-btn {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 3px solid #e9ecef;
    border-radius: 18px;
    padding: 25px 15px; /* 넉넉한 패딩 */
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    touch-action: manipulation;
    user-select: none;
    min-height: 110px; /* 충분한 높이 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.medicine-btn:hover, .medicine-btn:active {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-color: #2196f3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.2);
}

.medicine-btn.selected {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    border-color: #4caf50;
    color: #2e7d32;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.3);
}

.medicine-name {
    font-size: 17px; /* 큰 글자 */
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}

.medicine-category {
    font-size: 12px;
    color: #666;
    background: rgba(255,255,255,0.8);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

/* 분석 결과 - 시니어 친화적 */
.result-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 18px;
    padding: 28px; /* 넉넉한 패딩 */
    margin: 22px 0;
    border-left: 6px solid #2196f3;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.result-card.warning {
    border-left-color: #f44336;
    background: linear-gradient(135deg, #fff5f5 0%, #ffebee 100%);
}

.result-card.success {
    border-left-color: #4caf50;
    background: linear-gradient(135deg, #f8fff8 0%, #e8f5e8 100%);
}

.warning-list {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

.warning-list li {
    padding: 10px 0; /* 큰 패딩 */
    color: #c62828;
    font-weight: 500;
    border-bottom: 1px solid rgba(244, 67, 54, 0.1);
    font-size: 16px; /* 큰 글자 */
}

.warning-list li:before {
    content: "⚠️ ";
    margin-right: 8px;
}

.warning-list li:last-child {
    border-bottom: none;
}

/* 타임라인 - 시니어 친화적 */
.timeline {
    margin: 22px 0;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 22px; /* 넉넉한 패딩 */
    border-radius: 15px;
    border-left: 5px solid #2196f3;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
}

.timeline-marker {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    font-weight: 700;
    font-size: 16px; /* 큰 글자 */
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(33, 150, 243, 0.3);
}

.timeline-content {
    flex: 1;
}

.item-name {
    font-weight: 700;
    color: #1565c0;
    font-size: 18px; /* 큰 글자 */
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.help-btn {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    touch-action: manipulation;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.help-btn:hover, .help-btn:active {
    background: linear-gradient(135deg, #f57c00 0%, #ef6c00 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

.item-timing {
    color: #388e3c;
    font-weight: 700;
    font-size: 16px; /* 큰 글자 */
    margin-bottom: 4px;
}

.item-category {
    color: #666;
    font-size: 14px;
    font-weight: 600;
}

/* 차트 컨테이너 */
.chart-container {
    width: 100%;
    height: 320px; /* 높이 증가 */
    margin: 28px 0;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 18px;
    border: 2px solid #e3f2fd;
    position: relative;
}

.chart-title {
    text-align: center;
    font-weight: 700;
    color: #1565c0;
    margin-bottom: 22px;
    font-size: 20px; /* 큰 글자 */
}

/* 추천 상품 - 시니어 친화적 */
.recommendation-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 18px;
    padding: 28px; /* 넉넉한 패딩 */
    margin: 22px 0;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.recommendation-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 35px rgba(0,0,0,0.15);
    border-color: #2196f3;
}

.recommendation-item h3 {
    color: #1565c0;
    margin-bottom: 15px;
    font-size: 22px; /* 큰 글자 */
}

.recommendation-item p {
    color: #546e7a;
    margin-bottom: 20px;
    line-height: 1.6;
    font-weight: 500;
    font-size: 16px; /* 큰 글자 */
}

.product-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 20px;
    border-radius: 12px;
    margin-top: 18px;
    border: 1px solid #90caf9;
}

.product-name {
    font-weight: 700;
    color: #1565c0;
    margin-bottom: 12px;
    font-size: 18px; /* 큰 글자 */
}

.price-btn {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    text-decoration: none;
    padding: 16px 26px; /* 큰 버튼 */
    border-radius: 25px;
    font-weight: 700;
    display: inline-block;
    margin-top: 15px;
    transition: all 0.3s ease;
    touch-action: manipulation;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 16px; /* 큰 글자 */
}

.price-btn:hover, .price-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.4);
}

/* 파트너 공지 */
.partner-notice {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #f39c12;
    padding: 20px;
    text-align: center;
    font-size: 16px; /* 큰 글자 */
    color: #8b4513;
    font-weight: 700;
    border-radius: 15px;
    margin-bottom: 28px;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.2);
}

/* 출처 정보 */
.source-info {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    border: 2px solid #4caf50;
    border-radius: 15px;
    padding: 25px;
    margin: 28px 0;
    text-align: center;
}

.source-title {
    font-weight: 700;
    color: #2e7d32;
    font-size: 18px; /* 큰 글자 */
    margin-bottom: 15px;
}

.source-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.source-list li {
    color: #388e3c;
    font-weight: 600;
    font-size: 15px; /* 큰 글자 */
    margin-bottom: 10px;
    padding: 10px 15px;
    background: rgba(255,255,255,0.7);
    border-radius: 8px;
    border-left: 3px solid #4caf50;
}

/* 모달 - 시니어 친화적 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 25px;
    padding: 35px; /* 넉넉한 패딩 */
    max-width: 420px; /* 큰 모달 */
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 15px 50px rgba(0,0,0,0.4);
    position: relative;
    border: 2px solid #e3f2fd;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #ff5252 0%, #f44336 100%);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    color: white;
    font-weight: 700;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    touch-action: manipulation;
    box-shadow: 0 3px 10px rgba(244, 67, 54, 0.3);
}

.modal-close:hover, .modal-close:active {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    transform: scale(1.1);
}

/* 저장 알림 모달 */
.save-modal {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    border: 3px solid #4caf50;
}

.save-modal h3 {
    color: #2e7d32;
    text-align: center;
    margin-bottom: 18px;
    font-size: 20px; /* 큰 글자 */
}

.save-location {
    background: rgba(255,255,255,0.8);
    padding: 18px;
    border-radius: 10px;
    margin: 18px 0;
    border-left: 4px solid #4caf50;
    font-size: 16px; /* 큰 글자 */
}

/* 반응형 - 작은 화면 */
@media (max-width: 400px) {
    .container {
        padding: 30px 22px;
    }
    
    h1 {
        font-size: 30px;
    }
    
    .medicine-grid {
        grid-template-columns: 1fr;
    }
    
    .btn {
        font-size: 18px;
        padding: 20px 24px;
    }
    
    .medicine-btn {
        padding: 22px 18px;
        min-height: 100px;
    }
}

/* 접근성 강화 */
.btn:focus, .medicine-btn:focus, input:focus, select:focus {
    outline: 4px solid #1976d2;
    outline-offset: 3px;
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
    .container {
        border: 3px solid #000;
    }
    
    .medicine-btn {
        border: 3px solid #000;
    }
    
    .btn-primary {
        background: #000;
        color: #fff;
    }
}

/* 터치 최적화 */
@media (hover: none) and (pointer: coarse) {
    .btn:hover, .medicine-btn:hover, .help-btn:hover {
        transform: none;
    }
    
    .btn:active, .medicine-btn:active {
        transform: scale(0.98);
    }
}
/* 기존 CSS + 다음 추가 스타일들 */

/* 상호작용 경고 색상 */
.interaction-warning-1 { border-color: #ff6666 !important; background: linear-gradient(135deg, #ffe6e6 0%, #ffcccc 100%) !important; }
.interaction-warning-2 { border-color: #ff9933 !important; background: linear-gradient(135deg, #fff2e6 0%, #ffe6cc 100%) !important; }
.interaction-warning-3 { border-color: #ffcc00 !important; background: linear-gradient(135deg, #fffae6 0%, #fff5cc 100%) !important; }
.interaction-warning-4 { border-color: #cc66ff !important; background: linear-gradient(135deg, #f2e6ff 0%, #e6ccff 100%) !important; }
.interaction-warning-5 { border-color: #66ccff !important; background: linear-gradient(135deg, #e6f5ff 0%, #ccebff 100%) !important; }

/* 개선된 영양소 분석 컨테이너 */
.nutrition-analysis-container {
    width: 100%;
    margin: 28px 0;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 18px;
    border: 2px solid #e3f2fd;
}

.nutrition-title {
    text-align: center;
    font-weight: 700;
    color: #1565c0;
    margin-bottom: 25px;
    font-size: 20px;
}

/* 영양소 분석 - 막대 차트와 리스트 조합 */
.nutrition-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.nutrition-bars {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.nutrition-bar-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.nutrition-label {
    min-width: 80px;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.nutrition-bar-bg {
    flex: 1;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.nutrition-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s ease;
    position: relative;
}

.nutrition-bar-fill.sufficient { background: linear-gradient(90deg, #4caf50, #66bb6a); }
.nutrition-bar-fill.moderate { background: linear-gradient(90deg, #ff9800, #ffb74d); }
.nutrition-bar-fill.insufficient { background: linear-gradient(90deg, #f44336, #ef5350); }

.nutrition-percentage {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 700;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.nutrition-status {
    min-width: 60px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    padding: 4px 8px;
    border-radius: 8px;
}

.nutrition-status.sufficient { background: #e8f5e8; color: #2e7d32; }
.nutrition-status.moderate { background: #fff3e0; color: #ef6c00; }
.nutrition-status.insufficient { background: #ffebee; color: #c62828; }

/* 영양소 범례 */
.nutrition-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #2c3e50;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

/* 부족한 영양소 리스트 */
.deficient-nutrients {
    background: linear-gradient(135deg, #fff5f5 0%, #ffebee 100%);
    border: 2px solid #f44336;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.deficient-title {
    color: #c62828;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.deficient-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.deficient-item {
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* 반응형 개선 */
@media (max-width: 400px) {
    .nutrition-content {
        gap: 20px;
    }
    
    .nutrition-bar-item {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .nutrition-label {
        min-width: auto;
    }
    
    .nutrition-legend {
        gap: 15px;
    }
    
    .deficient-list {
        grid-template-columns: 1fr;
    }
}

/* 접근성 강화 - 색맹 사용자를 위한 패턴 */
.nutrition-bar-fill.insufficient::after {
    content: '⚠️';
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
}

.timeline-item.interaction-warning-1::before,
.timeline-item.interaction-warning-2::before,
.timeline-item.interaction-warning-3::before,
.timeline-item.interaction-warning-4::before,
.timeline-item.interaction-warning-5::before {
    content: '⚠️';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 16px;
}
