@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-color: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 15px;
    margin: 15px 0;
    border-radius: 0 8px 8px 0;
    font-size: 0.95rem;
    color: #495057;
}

/* 차트 컨테이너 */
.chart-container {
    margin: 20px 0;
    padding: 15px;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    text-align: center;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* 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-color: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.step.active {
    display: block;
}

.step h3 {
    color: #003366;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eaeaea;
}

/* 반응형 디자인 */
@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: collapse;
    margin-bottom: 20px;
    font-size: 14px;
}

.table th {
    background-color: #f8f9fa;
    color: #003366;
    font-weight: 600;
    text-align: left;
    padding: 12px;
    border: 1px solid #e1e4e8;
}

.table td {
    padding: 10px 12px;
    border: 1px solid #e1e4e8;
}

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

/* 테이블 반응형 */
.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;
}
