@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css');

/* PSAR 페이지 전용 스타일 */

/* PSAR 컨테이너 스타일 */
.psar-container {
    max-width: 1000px;
    margin: auto;
    background-color: #fff;
    padding: 25px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* 입력 카드 스타일 */
.input-card {
    background-color: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.card-header {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e1e4e8;
}

.card-header h2 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
}

.card-header h2 i {
    margin-right: 10px;
    color: #003366;
}

/* 섹션 타이틀 */
.section-title {
    font-weight: 600;
    color: #003366;
    margin: 25px 0 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eaeaea;
    display: flex;
    align-items: center;
}

.section-title i {
    margin-right: 8px;
}

/* 폼 스타일 */
form {
    padding: 20px;
    margin-bottom: 0;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* 폼 레이아웃 */
.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px 15px;
    width: 100%;
    box-sizing: border-box;
}

.form-row .form-group {
    flex: 1;
    padding: 0 10px;
    min-width: 200px;
    margin-bottom: 15px;
}

/* 레이블 스타일 */
label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #444;
    font-size: 14px;
}

label i {
    margin-right: 5px;
    color: #003366;
}

/* 입력 필드 스타일 */
input[type="text"], 
input[type="number"],
select {
    width: 100%;
    padding: 10px 12px;
    box-sizing: border-box;
    border: 1px solid #cfd7e6;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus, 
input[type="number"]:focus,
select:focus {
    border-color: #007acc;
    box-shadow: 0 0 0 3px rgba(0, 122, 204, 0.15);
    outline: none;
}

/* 입력 필드 아이콘 */
.input-with-icon {
    position: relative;
}

.input-with-icon input {
    padding-right: 30px;
}

.input-with-icon:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.tooltip {
    position: absolute;
    top: -40px;
    left: 0;
    background-color: #003366;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 100;
    width: 200px;
}

.tooltip:after {
    content: "";
    position: absolute;
    top: 100%;
    left: 15px;
    border-width: 5px;
    border-style: solid;
    border-color: #003366 transparent transparent transparent;
}

/* 티커 검색 링크 */
.ticker-lookup {
    margin-top: 5px;
    font-size: 12px;
}

.ticker-lookup a {
    color: #007acc;
    text-decoration: none;
}

.ticker-lookup a:hover {
    text-decoration: underline;
}

/* 버튼 스타일 */
.submit-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #003366;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    border-radius: 4px;
    transition: background-color 0.2s;
    font-weight: 600;
    margin-top: 20px;
}

.submit-btn:hover {
    background-color: #004080;
}

.submit-btn i {
    margin-right: 8px;
}

/* 로딩 스피너 */
#loading {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    color: #003366;
    margin-bottom: 15px;
}

/* ============================================
   PSAR 교육 모듈 스타일
   ============================================ */

/* 단계 컨테이너 */
#wizard-steps {
    margin-top: 30px;
}

.step {
    display: none;
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(30, 64, 175, 0.1);
    animation: fadeInUp 0.5s ease;
}

.step.active {
    display: block;
}

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

.step h3 {
    color: #1e3a8a;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.step h3 i {
    color: #3b82f6;
}

.step-description {
    color: #64748b;
    margin-bottom: 25px;
    font-size: 1rem;
    line-height: 1.6;
}

/* 설명 박스 */
.explanation-box {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
}

.explanation-box h4 {
    color: #0369a1;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.explanation-box h5 {
    color: #0c4a6e;
    font-size: 1rem;
    font-weight: 600;
    margin: 20px 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.explanation-box p {
    color: #334155;
    line-height: 1.7;
    margin-bottom: 12px;
}

.explanation-box ul, .explanation-box ol {
    color: #334155;
    padding-left: 20px;
    margin-bottom: 15px;
}

.explanation-box li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* 공식 박스 */
.formula-box {
    background: white;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    text-align: center;
    font-size: 1.2rem;
}

.formula-box.highlight {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    border: none;
    font-size: 1.3rem;
}

.formula-box strong {
    font-family: 'Courier New', monospace;
}

/* PSAR 시각적 가이드 */
.psar-visual-guide {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.guide-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    border-radius: 8px;
    flex: 1;
    min-width: 200px;
}

.guide-item.up {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.guide-item.down {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.psar-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.psar-dot.up {
    background: #26a69a;
}

.psar-dot.down {
    background: #ef5350;
}

/* 변수 설명 테이블 */
.variable-table {
    width: 100%;
    margin: 20px 0;
}

.variable-table th {
    background: #1e3a8a;
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
}

.variable-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.variable-table tr:hover {
    background: #f8fafc;
}

/* 키 인사이트 박스 */
.key-insight {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 80px;
}

.key-insight h5 {
    color: #92400e;
    margin-bottom: 10px;
}

.key-insight p {
    color: #78350f;
    margin: 0;
}

/* AF 설정 테이블 */
.settings-table {
    width: 100%;
    margin: 15px 0;
}

.settings-table th {
    background: #f1f5f9;
    color: #1e3a8a;
    padding: 10px 15px;
    text-align: left;
}

.settings-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #e2e8f0;
}

/* AF 동작 방식 */
.af-behavior {
    margin: 20px 0;
}

.af-behavior h5 {
    color: #0c4a6e;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.af-flow {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.af-flow-step {
    display: flex;
    gap: 15px;
    padding: 15px 20px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    align-items: center;
}

.af-flow-step.highlight {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #3b82f6;
}

.af-flow-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.af-flow-content {
    flex: 1;
}

.af-flow-content strong {
    display: block;
    color: #1e3a8a;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.af-flow-content p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.af-flow-arrow {
    text-align: center;
    color: #3b82f6;
    font-size: 1.2rem;
    padding: 5px 0;
}

/* AF 인사이트 그리드 */
.insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.insight-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.insight-item.highlight {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #3b82f6;
}

.insight-item strong {
    display: block;
    color: #1e3a8a;
    margin-bottom: 8px;
}

.insight-item p {
    font-size: 0.9rem;
    margin: 0;
}

/* EP 규칙 */
.ep-rules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.ep-rule {
    padding: 20px;
    border-radius: 12px;
}

.ep-rule.up {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.05) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.ep-rule.down {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.ep-rule h5 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.ep-rule.up h5 {
    color: #16a34a;
}

.ep-rule.down h5 {
    color: #dc2626;
}

/* 첫 PSAR 단계 */
.first-psar-steps {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.first-psar-step {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    align-items: flex-start;
}

.step-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.step-content strong {
    display: block;
    color: #1e3a8a;
    margin-bottom: 8px;
    font-size: 1rem;
}

.step-content p {
    margin: 0;
    color: #64748b;
    line-height: 1.6;
}

/* 반전 흐름도 */
.reversal-flow {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.flow-step {
    display: flex;
    gap: 15px;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    align-items: flex-start;
}

.flow-step.highlight {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #3b82f6;
}

.flow-number {
    width: 32px;
    height: 32px;
    background: #1e3a8a;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.flow-content strong {
    display: block;
    color: #1e3a8a;
    margin-bottom: 5px;
}

.flow-content p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.flow-arrow {
    text-align: center;
    color: #94a3b8;
    font-size: 1.2rem;
}

/* 반전 지점 버튼 */
.reversal-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.btn-reversal {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn-reversal.up {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.2) 100%);
    border: 1px solid rgba(34, 197, 94, 0.5);
    color: #16a34a;
}

.btn-reversal.down {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.2) 100%);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #dc2626;
}

.btn-reversal:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-reversal.up:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0.3) 100%);
}

.btn-reversal.down:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.3) 100%);
}

.reversal-date {
    font-size: 0.85rem;
    font-weight: 600;
}

.reversal-type {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* 사용법 그리드 */
.usage-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 15px 0;
}

.usage-item {
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.usage-item.up {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.05) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.usage-item.down {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.usage-item i {
    font-size: 2rem;
    margin-bottom: 10px;
}

.usage-item.up i {
    color: #16a34a;
}

.usage-item.down i {
    color: #dc2626;
}

.usage-item strong {
    display: block;
    margin-bottom: 8px;
    color: #1e293b;
}

.usage-item p {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
}

/* 신호 버튼 */
.usage-buttons {
    margin: 25px 0;
    text-align: center;
}

.usage-buttons h4 {
    margin-bottom: 15px;
    color: #1e3a8a;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.btn-signal {
    padding: 15px 25px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-signal.up {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: white;
}

.btn-signal.down {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: white;
}

.btn-signal.trailing {
    background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
    color: white;
}

.btn-signal:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* 신호 메시지 */
.signal-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

.signal-message.up {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #16a34a;
}

.signal-message.down {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

.signal-message.trailing {
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.3);
    color: #ea580c;
}

/* 보조지표 카드 */
.indicator-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.indicator-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.indicator-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
}

.indicator-card h6 {
    color: #1e3a8a;
    font-size: 1rem;
    margin-bottom: 10px;
}

.indicator-card p {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 10px;
    line-height: 1.5;
}

.indicator-tag {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* 조합 팁 */
.combination-tips {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.combination-tips h5 {
    color: #166534;
    margin-bottom: 15px;
}

.combination-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.combination-tips li {
    padding: 10px 15px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 3px solid #22c55e;
    color: #166534;
}

/* 차트 컨테이너 */
.chart-container {
    margin: 28px 0;
    padding: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
    border: 1px solid rgba(30, 64, 175, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.chart-container > div {
    min-height: 450px;
    width: 100%;
}

.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1e40af, #1e3a8a);
    border-radius: 16px 16px 0 0;
}

.chart-container:hover {
    box-shadow: 0 8px 32px rgba(30, 64, 175, 0.15);
    transform: translateY(-2px);
}

/* 계산 디스플레이 */
.calculation-display {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    min-height: 100px;
}

.calculation-placeholder {
    text-align: center;
    color: #94a3b8;
    padding: 30px;
}

.calculation-placeholder i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

/* 상태 카드 */
.status-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.status-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.status-label {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 8px;
}

.status-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3a8a;
}

.status-value.trend-up {
    color: #16a34a;
}

.status-value.trend-down {
    color: #dc2626;
}

/* 분석 해석 */
.analysis-interpretation {
    margin-top: 20px;
}

.interpretation {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    border-radius: 10px;
    font-size: 1rem;
    line-height: 1.6;
}

.interpretation.up {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.05) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #166534;
}

.interpretation.down {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #991b1b;
}

.interpretation i {
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* 다음 단계 버튼 */
/* 다음 단계 버튼 - 가운데 정렬 */
.next-step {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 30px;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 25px auto 0 auto;
    width: fit-content;
}

.next-step:hover {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.3);
}

.next-step i {
    transition: transform 0.3s ease;
}

.next-step:hover i {
    transform: translateX(5px);
}

/* 샘플 계산 테이블 */
.sample-calculations-table {
    margin: 25px 0;
}

.sample-calculations-table h4 {
    color: #1e3a8a;
    margin-bottom: 15px;
}

.sample-calculations-table .table {
    width: 100%;
    border-collapse: collapse;
}

.sample-calculations-table th {
    background: #1e3a8a;
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
}

.sample-calculations-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
}

.sample-calculations-table tr:hover {
    background: #f8fafc;
}

.sample-row {
    cursor: pointer;
    transition: background 0.2s;
}

.sample-row:hover {
    background: #e0f2fe !important;
}

/* Step 5 상세 정보 테이블 */
.point-detail-table {
    margin: 25px 0;
    padding: 20px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.point-detail-table h4 {
    color: #1e3a8a;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.point-detail-table .table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.point-detail-table th,
.point-detail-table td {
    width: 16.66%;
    text-align: center;
}

.point-detail-table th {
    background: #1e3a8a;
    color: white;
    padding: 12px 15px;
    font-weight: 600;
}

.point-detail-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
}

/* EP 테이블 (6열) */
.ep-table th,
.ep-table td {
    width: 16.66%;
}

/* 선택된 행 파란색 하이라이트 */
.point-detail-table .selected-row {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
    font-weight: 600;
}

.point-detail-table .selected-row td {
    color: #1e3a8a;
    border-top: 2px solid #3b82f6;
    border-bottom: 2px solid #3b82f6;
}

/* 선택된 행의 추세 색상 유지 */
.point-detail-table .selected-row td.trend-up {
    color: #16a34a !important;
}

.point-detail-table .selected-row td.trend-down {
    color: #dc2626 !important;
}

/* 추세 표시 */
td.trend-up {
    color: #16a34a;
    font-weight: 600;
}

td.trend-down {
    color: #dc2626;
    font-weight: 600;
}

/* 버튼 기본 스타일 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.85rem;
}

.btn-primary {
    background: #1e40af;
    color: white;
}

.btn-primary:hover {
    background: #1e3a8a;
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid #1e40af;
    color: #1e40af;
}

.btn-outline-primary:hover {
    background: #1e40af;
    color: white;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .form-row .form-group {
        flex: 100%;
        min-width: 100%;
        padding: 0 5px;
    }
    
    .psar-container {
        padding: 15px;
        margin: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .form-row {
        margin: 0 -5px 15px;
    }
    
    .input-card {
        margin: 0 0 20px 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .chart-container {
        margin: 10px -15px;
        padding: 10px 15px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .step {
        padding: 20px 15px;
        border-radius: 10px;
    }
    
    .step h3 {
        font-size: 1.2rem;
    }
    
    .ep-rules {
        grid-template-columns: 1fr;
    }
    
    .usage-grid {
        grid-template-columns: 1fr;
    }
    
    .insight-grid {
        grid-template-columns: 1fr;
    }
    
    .status-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn-signal {
        width: 100%;
        justify-content: center;
    }
}

/* Mobile chart optimizations */
@media (max-width: 768px) {
    .chart-container {
        margin: 10px 0;
        padding: 10px;
    }
    
    .chart-container canvas,
    .chart-container svg,
    .chart-container .js-plotly-plot {
        max-width: 100% !important;
        max-height: 300px !important;
        width: auto !important;
        height: auto !important;
    }
}

/* 전체 페이지 overflow 방지 */
body {
    overflow-x: hidden;
}

/* 모든 컨테이너에 기본 overflow 설정 */
* {
    box-sizing: border-box;
}

/* 알림 메시지 */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

.alert i {
    font-size: 1.2rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Step 3 인터랙티브 AF 섹션 */
.interactive-af-section {
    margin: 30px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    border: 1px solid #7dd3fc;
}

.interactive-af-section h4 {
    color: #0369a1;
    margin-bottom: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.interactive-af-section .click-instruction {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.interactive-af-section .chart-container {
    margin: 15px 0 0 0;
    background: white;
}

/* 현재 AF 상태 섹션 */
.current-af-status {
    margin: 25px 0;
}

.current-af-status h4 {
    color: #1e3a8a;
    margin-bottom: 15px;
    font-weight: 600;
}

.current-af-status .status-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.current-af-status .status-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.current-af-status .status-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
}

.current-af-status .status-label {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 10px;
    font-weight: 500;
}

.current-af-status .status-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e3a8a;
    transition: color 0.3s ease;
}

.current-af-status .status-value.trend-up {
    color: #16a34a;
}

.current-af-status .status-value.trend-down {
    color: #dc2626;
}

/* 선택 애니메이션 */
@keyframes afValueUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.current-af-status .status-value.updated {
    animation: afValueUpdate 0.3s ease;
}

/* 보정 설명 섹션 스타일 */
.correction-insight {
    padding: 25px !important;
}

.correction-insight h5 {
    margin-bottom: 20px;
}

.correction-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #e1e4e8;
}

.correction-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.correction-section h6 {
    color: #003366;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.correction-section h6 i {
    color: #1a73e8;
}

.correction-section ul {
    margin: 10px 0;
    padding-left: 25px;
}

.correction-section ul li {
    margin-bottom: 6px;
    line-height: 1.6;
}

.correction-section .highlight-text {
    background: linear-gradient(135deg, #e8f4fd 0%, #d4e8f8 100%);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #1a73e8;
    margin-top: 15px;
}

.correction-formula {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.correction-formula.up {
    border-left: 4px solid #22c55e;
}

.correction-formula.down {
    border-left: 4px solid #ef4444;
}

.correction-formula strong {
    display: block;
    margin-bottom: 8px;
    color: #003366;
}

.correction-formula .formula-mini {
    background: #fff;
    padding: 12px 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    text-align: center;
    margin: 10px 0;
    border: 1px solid #e1e4e8;
}

.correction-formula .formula-desc {
    font-size: 0.9rem;
    color: #555;
    margin: 8px 0 0 0;
}

.process-order {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.process-order .order-step {
    background: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    border: 2px solid #e1e4e8;
    color: #333;
}

.process-order .order-step.highlight {
    background: linear-gradient(135deg, #1a73e8 0%, #0d5bbd 100%);
    color: #fff;
    border-color: #1a73e8;
}

.process-order i {
    color: #999;
}

/* 반응형 */
@media (max-width: 768px) {
    .current-af-status .status-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .current-af-status .status-card {
        padding: 15px 10px;
    }
    
    .current-af-status .status-value {
        font-size: 1.3rem;
    }
    
    .current-af-status .status-label {
        font-size: 0.75rem;
    }
    
    .process-order {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .process-order .order-step {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}
