@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');

/* Bollinger Bands 페이지 전용 스타일 */

/* Bollinger 컨테이너 스타일 */
.bollinger-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;
}

/* 단계별 설명 - 금융적 스타일 */
.step-description {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    color: white;
    padding: 20px 24px;
    margin: 20px 0;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.step-description::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.step-description:hover::before {
    left: 100%;
}

.step-description:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.4);
}

.step-description p {
    margin: 0;
    line-height: 1.6;
}

/* 차트 컨테이너 - 현대적 스타일 */
.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: hidden;
    border: 1px solid rgba(30, 64, 175, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.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);
}

/* 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;
    }
}

/* 헤더 섹션 */
.bollinger-container .header-section {
    margin-bottom: 30px;
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 20px;
    margin-top: 4rem;
    margin-bottom: 4rem;
}

h1 {
    text-align: left !important;
    color: #003366;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 28px;
}

h2, h3 {
    color: #003366;
    margin-top: 0;
}

.model-description {
    text-align: left !important;
    color: #666;
    font-size: 14px;
    max-width: 700px;
    margin: 0;
}

/* 입력 카드 스타일 */
.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;
}

/* 도움말 텍스트 */
.helper-text {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* 버튼 스타일 */
.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;
}

/* 결과 섹션 - 현대적 카드 스타일 */
.step {
    display: none; /* 기본적으로 숨김 */
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    scroll-margin-top: 100px; /* navbar 높이 고려 */
    position: relative;
}

.step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1e40af, #1e3a8a, #3b82f6);
    border-radius: 20px 20px 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.step.active {
    display: block; /* 활성 단계만 표시 */
    border-color: rgba(30, 64, 175, 0.4);
    box-shadow: 0 8px 32px rgba(30, 64, 175, 0.2);
    transform: translateY(-4px);
}

.step.active::before {
    opacity: 1;
}

.step h3 {
    color: #1e293b;
    margin-top: 0;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.step h3 i {
    color: #1e40af;
    font-size: 1.8rem;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .form-row .form-group {
        flex: 100%;
        min-width: 100%;
        padding: 0 5px;
    }
    
    .bollinger-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;
    }
    
    .step {
        margin: 0 0 15px 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 15px;
    }
    
    .chart-container {
        margin: 10px -15px;
        padding: 10px 15px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}

/* 테이블 스타일 - 금융적 디자인 */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 24px;
    font-size: 14px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.table th {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    font-weight: 700;
    text-align: left;
    padding: 16px;
    border: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

.table th:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.table td {
    padding: 14px 16px;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    color: #475569;
    transition: all 0.2s ease;
}

.table tbody tr {
    transition: all 0.2s ease;
    background: white;
}

.table tbody tr:nth-child(even) {
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f5f9 100%);
}

.table tbody tr:hover {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* 테이블 반응형 */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    box-sizing: border-box;
}

/* 볼린저밴드 특정 스타일 */
.bollinger-band-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.band-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #1e3a8a;
    transition: all 0.2s ease;
}

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

.band-card.upper {
    border-left-color: #ef4444;
}

.band-card.middle {
    border-left-color: #1e3a8a;
}

.band-card.lower {
    border-left-color: #22c55e;
}

.band-card .band-label {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 500;
}

.band-card .band-value {
    font-size: 24px;
    font-weight: 700;
    color: #1e3a8a;
}

.band-card.upper .band-value {
    color: #ef4444;
}

.band-card.lower .band-value {
    color: #22c55e;
}

/* 신호 표시 스타일 */
.signal-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.signal-indicator.buy {
    background-color: #dcfce7;
    color: #16a34a;
}

.signal-indicator.sell {
    background-color: #fef2f2;
    color: #dc2626;
}

.signal-indicator.neutral {
    background-color: #fef3c7;
    color: #d97706;
}

/* 추가 모바일 최적화 */
@media (max-width: 480px) {
    .bollinger-container {
        padding: 10px;
    }
    
    .form-row .form-group {
        padding: 0 2px;
    }
    
    .form-row {
        margin: 0 -2px 10px;
    }
    
    .bollinger-band-info {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .band-card {
        padding: 15px;
    }
    
    .band-card .band-value {
        font-size: 20px;
    }
}

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

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

/* 특정 요소들의 overflow 방지 */
.bollinger-container,
.input-card,
.step,
.chart-container,
.table-responsive {
    max-width: 100%;
    overflow-x: hidden;
}

/* 계산 표시 스타일 - 인터랙티브 */
.calculation-display {
    margin: 24px 0;
    min-height: 200px;
}

.calculation-placeholder {
    text-align: center;
    color: #64748b;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    border: 2px dashed #cbd5e1;
    transition: all 0.3s ease;
}

.calculation-placeholder:hover {
    border-color: #1e40af;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.calculation-placeholder i {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: block;
    color: #1e40af;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.calculation-placeholder p {
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
    font-weight: 500;
}

.calculation-details {
    margin-top: 1.5rem;
    animation: fadeInUp 0.5s ease;
}

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

.calc-step {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 20px 24px;
    margin-bottom: 16px;
    border-radius: 12px;
    border-left: 5px solid #1e40af;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.calc-step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #1e40af, #1e3a8a);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.calc-step:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(30, 64, 175, 0.2);
    border-left-width: 6px;
}

.calc-step:hover::before {
    transform: scaleY(1);
}

.calc-step strong {
    color: #1e293b;
    display: block;
    margin-bottom: 12px;
    font-size: 1.05rem;
    font-weight: 700;
}

.calc-result {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 12px;
    font-weight: 700;
    color: #0c4a6e;
    font-size: 1.1rem;
    border: 2px solid #0ea5e9;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2);
    text-align: center;
}

.calc-summary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px 24px;
    border-radius: 12px;
    margin-top: 20px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.calc-summary p {
    margin: 12px 0;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.7;
}

.calc-summary p:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.calc-summary strong {
    color: #1e293b;
    font-weight: 700;
}

.instruction-text {
    color: #495057;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #e7f3ff;
    border-radius: 6px;
}

.table-instruction {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.75rem;
    font-style: italic;
}

.interactive-table {
    cursor: pointer;
}

.interactive-table .calc-value {
    font-weight: 500;
    color: #475569;
}

.interactive-table .calc-result-value {
    font-weight: 700;
    color: #1e40af;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}

/* 샘플 행 클릭 효과 */
.sample-row {
    cursor: pointer;
    transition: all 0.2s ease;
}

.sample-row:hover {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%) !important;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.sample-row.selected {
    background: linear-gradient(135deg, #bae6fd 0%, #7dd3fc 100%) !important;
    border-left: 4px solid #0ea5e9;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.4);
}

.table-explanation {
    margin-top: 20px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    border-left: 5px solid #0ea5e9;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.15);
    transition: all 0.3s ease;
}

.table-explanation:hover {
    border-left-width: 6px;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.25);
    transform: translateX(4px);
}

.table-explanation p {
    margin: 0;
    color: #0c4a6e;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.7;
}

.table-explanation strong {
    color: #1e293b;
    font-weight: 700;
}

/* 다음 단계 버튼 스타일 (다른 교육 모듈과 동일) */
.next-step {
    display: block;
    width: fit-content;
    background-color: #007bff; /* Primary blue */
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    margin: 20px auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.next-step:hover {
    background-color: #0056b3; /* Darker blue on hover */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: white;
}

.next-step:active {
    transform: translateY(0);
}

.next-step i {
    font-size: 14px;
    transition: transform 0.2s ease;
}

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

/* 미니 계산 테이블 스타일 (표준편차 계산 2단계/3단계용) */
.mini-table-container {
    margin: 10px 0;
    max-height: 300px;
    overflow-y: auto;
}

.mini-calculation-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background-color: #fff;
    border: 1px solid #ddd;
}

.mini-calculation-table thead {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mini-calculation-table th {
    padding: 8px;
    text-align: center;
    border: 1px solid #ddd;
    font-weight: 600;
    color: #495057;
}

.mini-calculation-table td {
    padding: 6px 8px;
    text-align: right;
    border: 1px solid #ddd;
    color: #333;
}

.mini-calculation-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.mini-calculation-table tbody tr:hover {
    background-color: #e9ecef;
}

/* %B 테이블 및 밴드폭 테이블 인터랙티브 효과 개선 */
.percent-b-table tbody tr,
.bandwidth-table tbody tr {
    cursor: pointer;
    transition: all 0.25s ease;
}

.percent-b-table tbody tr:hover,
.bandwidth-table tbody tr:hover {
    background-color: #e3f2fd !important;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

.percent-b-table tbody tr.selected,
.bandwidth-table tbody tr.selected {
    background-color: #bbdefb !important;
    border-left: 4px solid #007bff;
    font-weight: 500;
}

.percent-b-table tbody tr.selected td:first-child,
.bandwidth-table tbody tr.selected td:first-child {
    padding-left: 8px;
}

/* 차트에서 보기 버튼 개선 */
.chart-view-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

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

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

.chart-view-btn.active {
    background: linear-gradient(135deg, #f6416c 0%, #ff5858 100%);
    box-shadow: 0 4px 12px rgba(246, 65, 108, 0.4);
}

/* 패턴 버튼 개선 */
.pattern-btn {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(17, 153, 142, 0.3);
    margin: 5px;
}

.pattern-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(17, 153, 142, 0.4);
}

.pattern-btn:active {
    transform: translateY(-1px);
}

.pattern-btn.w-bottom {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.pattern-btn.w-bottom:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.pattern-btn.m-top {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 8px rgba(245, 87, 108, 0.3);
}

.pattern-btn.m-top:hover {
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

/* 알림 메시지 애니메이션 */
#pattern-message .alert {
    animation: fadeInUp 0.4s ease;
}

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


/* 서브 차트 스타일 */
.sub-chart-container {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.sub-chart-container h5 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 15px;
}

/* 설명 박스 - 금융적 카드 스타일 */
.explanation-box {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 16px;
    padding: 28px;
    margin: 24px 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.explanation-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1e40af, #1e3a8a, #3b82f6);
}

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

.explanation-box h4 {
    color: #1e293b;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.explanation-box h4 i {
    color: #1e40af;
    font-size: 1.4rem;
}

.explanation-box p {
    color: #475569;
    line-height: 1.8;
    margin-bottom: 12px;
    font-size: 1rem;
}

.explanation-box p:last-child {
    margin-bottom: 0;
}

.explanation-box strong {
    color: #1e293b;
    font-weight: 600;
}

/* 리스트 스타일 개선 */
.explanation-box ul,
.explanation-box ol {
    margin: 16px 0;
    padding-left: 28px;
}

.explanation-box ul li,
.explanation-box ol li {
    margin-bottom: 12px;
    line-height: 1.8;
    color: #475569;
    font-size: 1rem;
    position: relative;
    padding-left: 8px;
}

.explanation-box ul li::marker {
    color: #667eea;
    font-weight: 700;
}

.explanation-box ul li strong {
    color: #1e293b;
    font-weight: 700;
}

.explanation-box ul li:last-child {
    margin-bottom: 0;
}

/* 공식 박스 - 인터랙티브 스타일 */
.formula-box {
    background: white;
    border-radius: 12px;
    padding: 20px 24px;
    margin: 20px 0;
    border-left: 5px solid #1e40af;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.15);
    transition: all 0.3s ease;
    position: relative;
}

.formula-box:hover {
    border-left-width: 6px;
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.25);
    transform: translateX(4px);
}

.formula-box strong {
    color: #1e293b;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 12px;
    font-weight: 700;
}

.formula-box .formula {
    display: block;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 12px 16px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    color: #1e293b;
    margin-top: 8px;
    border: 1px solid #dee2e6;
}

.formula-box ol {
    margin: 16px 0 0 0;
    padding-left: 24px;
}

.formula-box ol li {
    margin-bottom: 10px;
    line-height: 1.7;
    color: #475569;
    font-size: 0.95rem;
}

.formula-box ol li strong {
    color: #1e40af;
    font-weight: 600;
    display: inline;
}

/* 현재 상태 카드 - 금융 대시보드 스타일 */
.current-status {
    margin: 30px 0;
}

.current-status h4 {
    color: #1e293b;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.current-status h4::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
    border-radius: 2px;
}

.status-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.status-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(30, 64, 175, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.status-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1e40af, #1e3a8a);
}

.status-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 30px rgba(30, 64, 175, 0.2);
    border-color: rgba(30, 64, 175, 0.4);
}

.status-card:nth-child(1)::before {
    background: linear-gradient(90deg, #1e293b, #475569);
}

.status-card:nth-child(2)::before {
    background: linear-gradient(90deg, #1e40af, #3b82f6);
}

.status-card:nth-child(3)::before {
    background: linear-gradient(90deg, #dc2626, #ef4444);
}

.status-card:nth-child(4)::before {
    background: linear-gradient(90deg, #16a34a, #22c55e);
}

.status-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.status-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e293b;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* %B 현재값 표시 - 인터랙티브 */
.current-percent-b {
    margin: 30px 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(30, 64, 175, 0.2);
}

.current-percent-b h4 {
    color: #1e293b;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.current-percent-b h4::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
    border-radius: 2px;
}

.percent-b-display {
    position: relative;
}

.percent-b-value {
    font-size: 3rem;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    margin-bottom: 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s ease-in-out infinite;
}

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

.percent-b-bar {
    width: 100%;
    height: 32px;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.percent-b-fill {
    height: 100%;
    background: linear-gradient(90deg, #1e40af 0%, #1e3a8a 50%, #3b82f6 100%);
    border-radius: 16px;
    transition: width 1s ease-out;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.4);
}

.percent-b-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.percent-b-interpretation {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 16px 20px;
    border-radius: 12px;
    color: #0c4a6e;
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
    border-left: 4px solid #0ea5e9;
    font-weight: 500;
}

/* 밴드폭 현재값 표시 */
.current-bandwidth {
    margin: 30px 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(30, 64, 175, 0.2);
}

.current-bandwidth h4 {
    color: #1e293b;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.current-bandwidth h4::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
    border-radius: 2px;
}

.bandwidth-display {
    text-align: center;
}

.bandwidth-value {
    font-size: 3rem;
    font-weight: 700;
    color: #1e293b;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #11998e, #38ef7d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s ease-in-out infinite;
}

/* 지시 텍스트 개선 */
.instruction-text {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0c4a6e;
    font-size: 1rem;
    margin-bottom: 20px;
    padding: 16px 20px;
    border-radius: 12px;
    border-left: 4px solid #0ea5e9;
    font-weight: 500;
    line-height: 1.7;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.15);
}

/* 인터랙티브 섹션 */
.interactive-section {
    margin: 24px 0;
}

.interactive-section h4 {
    color: #1e293b;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.interactive-section h4 i {
    color: #1e40af;
    font-size: 1.3rem;
}

/* 샘플 계산 테이블 제목 */
.sample-calculations-table h4 {
    color: #1e293b;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sample-calculations-table h4::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
    border-radius: 2px;
}

/* 테이블 설명 개선 */
.table-instruction {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    font-size: 0.95rem;
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid #f59e0b;
    font-weight: 500;
    font-style: normal;
}

/* 반응형 개선 */
@media (max-width: 768px) {
    .status-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .status-card {
        padding: 20px;
    }
    
    .status-value {
        font-size: 1.5rem;
    }
    
    .percent-b-value,
    .bandwidth-value {
        font-size: 2.5rem;
    }
    
    .explanation-box {
        padding: 20px;
    }
    
    .formula-box {
        padding: 16px 20px;
    }
    
    .current-percent-b,
    .current-bandwidth {
        padding: 20px;
    }
}
