@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css');

/* 기본 레이아웃 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

html, body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', Arial, sans-serif;
    background-color: #ffffff;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    /* padding-top removed, will be handled by .main-content-after-navbar */
}

.container, .container-fluid {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0;
    background-color: #f4f7f6;
    flex: 1 0 auto;
    border-radius: 0;
    box-shadow: none;
}

/* Navbar specific container-fluid override */
.navbar .container-fluid {
    background-color: transparent;
}

/* Footer 스타일 */
.container-fluid {
    width: 100vw;
    padding: 0;
    margin: 0;
    max-width: none;
}

.footer {
    width: 100%;
    background-color: #0A2342;
    color: white;
    flex-shrink: 0;
    margin-top: 2rem;
}

.footer .container-fluid {
    background-color: transparent; /* Ensure the parent footer's background color shows through */
}

.footer a {
    color: #a8c6fa;
    text-decoration: none;
    transition: color 0.2s;
}

.footer a:hover {
    color: white;
    text-decoration: underline;
}

.footer h5 {
    color: white;
    font-weight: 600;
    margin-bottom: 1.2rem;
}

.footer hr {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 1.5rem 0;
}

.footer .social-icons a {
    color: white;
    font-size: 1.2rem;
    transition: opacity 0.2s;
}

.footer .social-icons a:hover {
    opacity: 0.8;
    text-decoration: none;
}

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

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

/* 섹션 헤더 스타일 */
.section-header {
    background-color: #f8f9fa;
    padding: 20px 30px;
    border-bottom: 1px solid #e1e4e8;
    width: 100%;
    margin-bottom: 20px;
}

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

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

.container-fluid.p-4 {
    background-color: #fff;
    margin-bottom: 30px;
    width: 100%;
}

/* 버튼 스타일 */
.form-actions {
    margin-top: 30px;
    text-align: center;
}

.btn-primary, button#calculateBtn {
    background-color: #1a73e8;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    font-weight: 500;
    height: 48px;
}

.btn-primary i, button#calculateBtn i {
    margin-right: 10px;
    font-size: 18px;
}

.btn-primary:hover, button#calculateBtn:hover {
    background-color: #1558b0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

/* 입력 필드 스타일 */
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;
    background-color: #f9fafc;
    height: 40px;
}

input[type="number"] {
    text-align: left;
    padding-left: 15px;
}

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;
    background-color: #fff;
}

/* 버튼 스타일 */
button#calculateBtn:hover {
    background-color: #1558b0;
}

/* 결과 테이블 스타일 */
.result-section {
    margin-top: 40px;
    background-color: #fff;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 30px;
    width: 100%;
}

.result-section h2 {
    color: #003366;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    display: flex;
    align-items: center;
}

.result-section h2 i {
    margin-right: 10px;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    margin-bottom: 24px;
    font-size: 14px;
    background-color: #fff;
    border: 1px solid #e1e4e8;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.result-table th, .result-table td {
    border: 1px solid #e1e4e8;
    padding: 12px 15px;
    text-align: left;
}

.result-table th {
    background-color: #f8f9fa;
    color: #003366;
    font-weight: 600;
    position: sticky;
}
  
/* 저널 항목 스타일 */
.journal-entry-block {
border: 1px solid #e1e4e8;
padding: 20px;
margin-bottom: 25px;
border-radius: 6px;
background-color: #f8f9fa;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* 실습예제 데이터 버튼 스타일 */
.examples-section {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.examples-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.examples-title i {
    margin-right: 10px;
    color: #3498db;
}

.example-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
}

.example-button {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #555;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.example-button:hover {
    background-color: #f0f7ff;
    border-color: #3498db;
    color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.example-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Finance Lease 예제 버튼 스타일 */
.example-button[data-example="example1"],
.example-button[data-example="example2"],
.example-button[data-example="example3"],
.example-button[data-example="example4"],
.example-button[data-example="example5"] {
    border-left: 3px solid #e74c3c;
}

/* Operating Lease 예제 버튼 스타일 */
.example-button[data-example="example6"],
.example-button[data-example="example7"],
.example-button[data-example="example8"] {
    border-left: 3px solid #2ecc71;
}

.example-description {
    font-size: 14px;
    color: #666;
    margin-top: 15px;
    padding: 15px;
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    line-height: 1.5;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.journal-entry-block p {
    font-weight: 600;
    margin-bottom: 12px;
    color: #003366;
    font-size: 16px;
    display: flex;
    align-items: center;
}

.journal-entry-block p i {
    margin-right: 8px;
}

.journal-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

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

.journal-table td {
    background-color: #ffffff;
    padding: 10px 12px;
    border: 1px solid #e1e4e8;
    white-space: pre-wrap;
}

pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
}

/* 반응형 스타일 */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        width: 100%;
        padding: 0;
    }
    
    .container {
        padding: 15px;
    }
}

/* 오류 메시지 */
.error {
    color: #d32f2f;
    background-color: #fdecea;
    padding: 12px 15px;
    border-radius: 4px;
    margin-top: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.error i {
    margin-right: 8px;
}
  
/* 영어 레이블 스타일 */
.eng-label {
    display: block;
    font-size: 12px;
    color: #666;
    font-weight: normal;
    margin-top: 2px;
}

/* 섹션 타이틀 스타일 수정 */
.section-title {
    font-weight: 600;
    color: #003366;
    margin: 35px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eaeaea;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 18px;
}

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

/* Styles for Lease Example Buttons Section Redesign */
.example-buttons-container {
  display: flex;
  gap: 24px; /* Gap between the two category columns */
  margin-top: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap; /* Allow columns to wrap on smaller screens */
}

.lease-category {
  flex: 1 1 45%; /* Each category takes up roughly half the space, allows wrapping */
  min-width: 280px; /* Minimum width before wrapping */
  background-color: #ffffff; /* Clean white background for the category box */
  border: 1px solid #dee2e6; /* Standard border color */
  border-radius: 8px; /* Rounded corners for the category box */
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* Subtle shadow for depth */
}

.lease-category h5 {
  margin-top: 0;
  margin-bottom: 18px;
  font-size: 1.1rem; /* Slightly larger font for category titles */
  font-weight: 600;
  color: #004085; /* Dark, corporate blue for category titles */
  display: flex;
  align-items: center;
  border-bottom: 1px solid #dee2e6; /* Separator line under the title */
  padding-bottom: 12px;
}

.lease-category h5 i {
  margin-right: 10px;
  color: #007bff; /* Bootstrap primary blue for icons */
}

.button-group {
  display: flex; /* Use flex to stack buttons vertically */
  flex-direction: column;
  gap: 12px; /* Space between buttons in a category */
}

.example-button {
  background-color: #f8f9fa; /* Light gray, less stark than pure white */
  color: #212529; /* Default dark text color for readability */
  border: 1px solid #ced4da; /* Standard input border color */
  padding: 12px 15px;
  font-size: 0.9rem; /* Slightly smaller font to accommodate longer titles */
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  text-align: left;
  width: 100%; /* Buttons take full width of their column */
  font-weight: 500;
  line-height: 1.5; /* Improved line height for wrapped text */
  white-space: normal; /* Allow button text to wrap */
  word-wrap: break-word; /* Break words if necessary */
  display: block; /* Ensure it behaves as a block element for layout */
  min-height: 48px; /* Minimum button height for consistency */
  box-shadow: 0 1px 2px rgba(0,0,0,0.03); /* Very subtle shadow */
}

.example-button:hover {
  background-color: #e9ecef; /* Slightly darker gray on hover */
  border-color: #adb5bd; /* Darker border on hover */
  color: #0056b3; /* Darker blue text on hover for emphasis */
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.example-button.active {
  background-color: #007bff; /* Bootstrap primary blue for active state */
  color: #ffffff; /* White text for active state */
  border-color: #007bff; /* Matching border color */
  font-weight: 600; /* Bolder text for active button */
  box-shadow: 0 2px 5px rgba(0, 123, 255, 0.25); /* More prominent shadow for active state */
}

/* Styling for the example description area below buttons */
.example-description {
    margin-top: 25px;
    padding: 15px;
    background-color: #e9f2ff; /* Light, informative blue background */
    border-left: 4px solid #007bff; /* Accent border */
    color: #004085; /* Dark blue text, matching category titles */
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Styles for Lease Classification Table */
.classification-table {
  margin-top: 15px; /* Space above the table */
  border-collapse: separate; /* Allows for border-spacing and rounded corners on table */
  border-spacing: 0;
  width: 100%;
  border: 1px solid #dee2e6; /* Outer border for the table */
  border-radius: 8px; /* Rounded corners for the table */
  overflow: hidden; /* Ensures child elements conform to rounded corners */
  box-shadow: 0 2px 4px rgba(0,0,0,0.03); /* Subtle shadow */
}

.classification-table th,
.classification-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #e9ecef; /* Lighter border for inner rows */
  font-size: 0.9rem;
}

.classification-table th {
  background-color: #f8f9fa; /* Light gray header background */
  color: #495057; /* Darker gray text for header */
  font-weight: 600;
  border-top: none; /* Remove top border for header cells if using outer border */
}

.classification-table tbody tr:last-child td {
  border-bottom: none; /* Remove bottom border for the last row */
}

.classification-table tbody tr:hover {
  background-color: #eef2f7; /* Light blue hover for rows */
}

.classification-table td.classification-value {
  color: #333; /* Standard text color for result values */
  font-weight: 500;
}

.classification-table td.final-classification-result {
  font-weight: bold;
  /* Removed fixed padding, border-radius, display, margin - will be full cell */
  /* Text color will be set by specific lease type rules below */
  text-align: center; /* Center the text in the result cell */
}

/* Specific styling for Lease Type Result background and text colors */
.classification-table td.final-classification-result.result-finance-lease {
  background-color: #d4edda; /* Light pastel green */
  color: #155724; /* Dark green text */
}

.classification-table td.final-classification-result.result-operating-lease {
  background-color: #d1ecf1; /* Light pastel blue/teal */
  color: #0c5460; /* Dark blue/teal text */
}

.classification-table td.final-classification-result.result-sales-type-lease {
  background-color: #cce5ff; /* Light pastel blue */
  color: #004085; /* Dark blue text */
}

.classification-table td.final-classification-result.result-direct-financing-lease {
  background-color: #ffe8cc; /* Light pastel orange */
  color: #856404; /* Dark orange/brown text */
}
/* Add more specific types if needed */

/* Styles for Journal Entry Sections */
.journal-entry-block {
  background-color: #fff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.3s ease;
}

.journal-entry-block:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.journal-entry-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #343a40;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #ced4da; /* Dashed line for a ledger feel */
}

.journal-entry-title .eng-header {
    font-size: 0.85em;
    color: #6c757d;
    font-weight: normal;
    display: block;
    margin-top: 2px;
}

.journal-entry-table {
  width: 100%;
  border-collapse: separate; /* Use separate for rounded corners on cells if needed */
  border-spacing: 0;
  margin-top: 0; /* Reset margin if inheriting from .result-table */
}

.journal-entry-table th,
.journal-entry-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f3f5; /* Lighter border for internal rows */
  font-size: 0.9rem;
}

.journal-entry-table tr:last-child th,
.journal-entry-table tr:last-child td {
  border-bottom: none;
}

.journal-entry-table th {
  width: 30%; /* Give more space to account details */
  text-align: left;
  font-weight: 600;
  color: #495057;
  background-color: #f8f9fa; /* Light background for Debit/Credit labels */
  vertical-align: top; /* Align with top of pre content */
  line-height: 1.3;
  border-right: 1px solid #e9ecef;
}

.journal-entry-table th .eng-header {
  font-size: 0.9em;
  color: #6c757d;
  font-weight: normal;
  display: block;
}

.journal-entry-table td {
  text-align: left;
  vertical-align: top; /* Align with top of Debit/Credit label */
}

.journal-entry-table td pre {
  margin: 0;
  padding: 0;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; /* Monospace font */
  font-size: 0.85rem;
  background-color: transparent;
  border: none;
  white-space: pre-wrap; /* Allow wrapping but preserve spaces */
  word-break: break-all; /* Break long strings if necessary */
  color: #212529;
}

.journal-entry-table tbody tr:hover {
  background-color: #f8f9fa; /* Light hover effect for rows */
}

/* Styles for Amortization Schedule Tables */
.amortization-schedule-table {
  margin-top: 15px;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.amortization-schedule-table th,
.amortization-schedule-table td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid #e9ecef;
  font-size: 0.85rem;
  /* white-space: nowrap; Removed to allow wrapping for multi-line headers */
}

.amortization-schedule-table th:first-child,
.amortization-schedule-table td:first-child {
  text-align: center;
}

.amortization-schedule-table th {
  background-color: #f8f9fa;
  color: #495057;
  font-weight: 600;
  border-top: none;
  text-align: center;
  line-height: 1.3; /* Adjust line-height for two lines of text */
  vertical-align: middle; /* Ensure text is vertically centered if padding creates extra space */
}

.amortization-schedule-table th .eng-header {
  font-size: 0.9em; /* Make English part slightly smaller */
  color: #6c757d; /* Slightly lighter color for English part */
  font-weight: normal; /* Normal weight for English part */
  display: block; /* Ensures it takes its own line if not already forced by <br> */
}

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

.amortization-schedule-table tbody tr:hover {
  background-color: #eef2f7;
}

.amortization-schedule-table td {
  color: #333;
  font-weight: normal;
}
