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

/* 기본 레이아웃 */
body {
    font-family: 'Inter', Arial, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 20px;
    color: #333;
    line-height: 1.6;
}

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

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

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

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

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

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

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

/* 폼 레이아웃 */
.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px 15px;
}

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

/* 비율 컨테이너 */
.rate-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 슬라이더 스타일 */
input[type="range"] {
    flex: 1;
    height: 5px;
    -webkit-appearance: none;
    appearance: none;
    background: #e1e4e8;
    border-radius: 5px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #003366;
    cursor: pointer;
}

/* 비율 입력 필드 */
.rate-container input[type="text"] {
    width: 80px;
    text-align: center;
}

/* 퍼센트 표시 */
.rate-container span {
    width: 50px;
    font-weight: bold;
    color: #003366;
}

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

.step.active {
    display: block;
}

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

/* 다음 단계 버튼 */
.next-step,
.show-all {
    display: inline-block;
    background-color: #007bff; /* Primary blue */
    color: white;
    border: none;
    padding: 12px 24px; /* Slightly larger padding */
    border-radius: 5px; /* Rounded corners */
    cursor: pointer;
    margin-top: 20px; /* Consistent margin */
    font-weight: 600; /* Bolder text */
    font-size: 1rem; /* Standard font size */
    text-align: center;
    text-decoration: none; /* Remove underline if it's an <a> tag */
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}

.next-step:hover,
.show-all:hover {
    background-color: #0056b3; /* Darker blue on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); /* Slightly larger shadow on hover */
}

.next-step:active,
.show-all:active {
    background-color: #004085; /* Even darker blue on click */
    transform: translateY(1px); /* Slight press down effect */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); /* Smaller shadow on click */
}

.next-step i,
.show-all i {
    margin-left: 8px; /* Space for icon if present */
}

/* Ensure buttons are centered if they are the only element in their line */
.step > .next-step,
.step > .show-all {
    display: block;
    width: fit-content; /* Or a specific max-width */
    margin-left: auto;
    margin-right: auto;
}

/* 테이블 스타일 */
.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;
}

/* 차트 컨테이너 */
.chart-container {
    margin: 20px 0;
    padding: 15px;
    background-color: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
}

/* 반응형 디자인 */
@media (max-width: 0px) {
    .form-row .form-group {
        flex: 100%;
    }
    
    .container {
        padding: 15px;
    }
}

/* Wizard 버튼 중앙 정렬 was here, styles are now consolidated above */
.next-step:hover,
.show-all:hover {
  background-color: #2980b9;
}

/* 테이블 반응형 */
.table-responsive {
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  border: 1px solid #ddd;
  padding: 8px 12px;
  text-align: center;
}
.table th {
  background: #f9f9f9;
  font-weight: 600;
}

/* Plotly 차트 컨테이너 */
#sensitivity-plot {
  width: 100% !important;
  height: 400px;
  margin-bottom: 20px;
}

/* 설명문 스타일 */
.explanation {
  margin: 15px 0;
  font-size: 0.95rem;
  color: #333;
  line-height: 1.5;
}

/* 로딩 스피너 */
#loading {
  text-align: center;
  margin: 20px 0;
}
.spinner-border {
  width: 50px;
  height: 50px;
}

/* Input Summary 스타일 */
.input-summary-card {
  background-color: #f8fafc;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.summary-section {
  margin-bottom: 20px;
  border-bottom: 1px solid #eaeaea;
  padding-bottom: 15px;
}

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

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

.section-title i {
  color: #0056b3;
}

.summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 10px;
}

.summary-item {
  flex: 1;
  min-width: 250px;
  background-color: #fff;
  border-radius: 6px;
  padding: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.summary-item label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: #444;
  margin-bottom: 6px;
  font-size: 14px;
}

.summary-item label i {
  color: #0056b3;
  font-size: 12px;
}

.summary-item .value {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.summary-item .value.changed {
  color: #0056b3;
}

.summary-item .changed-value {
  font-size: 14px;
  color: #28a745;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.summary-item .change-reason {
  font-size: 12px;
  color: #666;
  font-style: italic;
  margin-top: 2px;
}

.summary-item .explanation {
  font-size: 12px;
  color: #666;
  line-height: 1.4;
}

.industry-info {
  background-color: #e6f3ff;
  padding: 12px 15px;
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 14px;
  color: #0056b3;
}

.industry-message {
  margin-top: 6px;
  font-size: 13px;
  color: #555;
  font-style: italic;
}
