/* US 기업 재무제표 페이지 스타일 */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css');

/* 로딩 스피너 애니메이션 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

/* 드롭다운 로딩 상태 스타일 */
select:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

/* Select2 로딩 상태 스타일 - 기본 디자인 유지하면서 스피너만 추가 */
.input-with-icon.loading .select2-container--bootstrap-5 .select2-selection--single::after {
    content: "⟳";
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    animation: spin 1s linear infinite;
    color: #007bff;
    font-size: 16px;
    z-index: 10;
    pointer-events: none;
}

.input-with-icon.loading .select2-container--bootstrap-5 .select2-selection__arrow {
    display: none;
}

/* Global body styles removed to prevent conflicts with base.css */

.page-header {
    margin-bottom: 2rem;
    margin-top: 2rem;
    text-align: center;
}

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

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

/* 입력 카드 스타일 */
.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;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

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

/* 콘텐츠 섹션 스타일 */
.content-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

/* 폼 스타일 */
form {
    padding: 20px;
    margin-bottom: 0;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

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

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #444;
    font-size: 14px;
}

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

.input-with-icon {
    position: relative;
}

input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
}

.tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 10;
    margin-bottom: 5px;
    pointer-events: none;
}

.input-with-icon:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-2px);
}

.form-actions {
    text-align: center;
    margin-top: 20px;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #0069d9;
}

.download-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background-color 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.download-btn:hover {
    background-color: #218838;
}

/* 결과 콘텐츠 */
.result-content {
    padding: 20px;
}

/* 테이블 스타일 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 13px;
    border: 1px solid #ddd;
}

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

th {
    padding: 12px 8px;
    text-align: center;
    border: 1px solid #ddd;
    font-weight: 600;
    color: #333;
    background-color: #f8f9fa;
    white-space: nowrap;
}

td {
    padding: 10px 8px;
    border: 1px solid #ddd;
    text-align: center;
}

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

tr:hover {
    background-color: #f1f1f1;
    -webkit-overflow-scrolling: touch;
}

/* 기존 테이블 스타일과 구분됨 */

/* 전문적인 재무제표 스타일 */
.financial-statement {
    border-collapse: separate;
    border-spacing: 0;
    margin: 25px auto;
    width: 100%;
    font-size: 14px;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e8ed;
}

.financial-statement th,
.financial-statement td {
    border: none;
    border-bottom: 1px solid #e8eef2;
    padding: 14px 16px;
    text-align: center;
    position: relative;
}

.financial-statement th {
    background: linear-gradient(135deg, #1a365d 0%, #2d5a87 100%);
    color: #ffffff;
    font-weight: 600;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 3px solid #0f2a44;
    position: sticky;
    top: 0;
    z-index: 10;
}

.financial-statement th:first-child {
    border-top-left-radius: 8px;
}

.financial-statement th:last-child {
    border-top-right-radius: 8px;
}

.financial-statement tbody tr {
    transition: all 0.2s ease;
}

.financial-statement tbody tr:hover {
    background-color: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.financial-statement tr:nth-child(even) td {
    background-color: #fafbfc;
}

.financial-statement tr:nth-child(odd) td {
    background-color: #ffffff;
}

/* 계정명 스타일 - 왼쪽 정렬 및 계층구조 */
.financial-statement td:first-child {
    text-align: left;
    padding-left: 20px;
    white-space: normal;
    font-weight: 500;
    color: #2d3748;
    min-width: 200px;
}

/* 들여쓰기된 계정 (세부 항목) */
.financial-statement td.account-indented {
    padding-left: 40px;
    font-weight: 400;
    color: #4a5568;
    font-size: 13px;
}

/* 금액 컬럼 스타일 */
.financial-statement td:not(:first-child) {
    text-align: right;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
    padding-right: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
    min-width: 120px;
}

/* 음수 금액 스타일 */
.financial-statement td.negative-amount {
    color: #e53e3e;
}

/* 양수 금액 스타일 */
.financial-statement td.positive-amount {
    color: #38a169;
}

/* 카테고리 헤더 스타일 */
.financial-statement .category-header td {
    background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
    font-weight: 700;
    color: #1a202c;
    border-top: 2px solid #4299e1;
    border-bottom: 2px solid #4299e1;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px 20px;
}

.financial-statement .category-header td:first-child {
    text-align: left;
    padding-left: 20px;
}

/* 총계/합계 행 스타일 */
.financial-statement .total-row td {
    background-color: #f7fafc;
    font-weight: 700;
    color: #1a202c;
    border-top: 2px solid #4a5568;
    border-bottom: 2px solid #4a5568;
    font-size: 15px;
}

.financial-statement .total-row td:first-child {
    text-align: left;
    padding-left: 20px;
}

/* 소계 행 스타일 */
.financial-statement .subtotal-row td {
    background-color: #f1f5f9;
    font-weight: 600;
    color: #2d3748;
    border-top: 1px solid #cbd5e0;
    border-bottom: 1px solid #cbd5e0;
    font-size: 14px;
}

.financial-statement .subtotal-row td:first-child {
    text-align: left;
    padding-left: 30px;
}

/* 헤더 장식 효과 */
.financial-statement th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4299e1 0%, #63b3ed 50%, #4299e1 100%);
}

.financial-statement .amount-header {
    text-align: center;
    font-weight: 600;
    color: #ffffff;
}

/* 금액 포맷팅 */
.financial-statement .amount {
    position: relative;
}

/* 천단위 구분자 스타일 */
.financial-statement .formatted-number {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

/* 계정과목 아이콘 */
.financial-statement .account-icon {
    display: inline-block;
    width: 4px;
    height: 4px;
    background-color: #4299e1;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

/* 카테고리별 색상 구분 */
.financial-statement .assets-category .category-header td {
    border-color: #38a169;
    background: linear-gradient(135deg, #f0fff4 0%, #e6fffa 100%);
    color: #22543d;
}

.financial-statement .liabilities-category .category-header td {
    border-color: #e53e3e;
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    color: #742a2a;
}

.financial-statement .equity-category .category-header td {
    border-color: #4299e1;
    background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%);
    color: #2a4365;
}

.financial-statement .revenue-category .category-header td {
    border-color: #9f7aea;
    background: linear-gradient(135deg, #faf5ff 0%, #e9d8fd 100%);
    color: #553c9a;
}

.financial-statement .expense-category .category-header td {
    border-color: #ed8936;
    background: linear-gradient(135deg, #fffaf0 0%, #feebc8 100%);
    color: #9c4221;
}

/* 재무제표 컴팩트 모드 */
.financial-statement.compact {
    font-size: 13px;
    margin: 15px auto;
}

.financial-statement.compact td {
    padding: 10px 14px;
}

.financial-statement.compact .category-header td {
    font-size: 14px;
    padding: 14px 16px;
}

.financial-statement.compact td:first-child {
    padding-left: 16px;
}

.financial-statement.compact td.account-indented {
    padding-left: 32px;
}

.financial-statement.compact td:not(:first-child) {
    font-size: 13px;
    padding-right: 16px;
}

/* 프린트 스타일 */
@media print {
    .financial-statement {
        box-shadow: none;
        border: 1px solid #000;
        font-size: 12px;
    }
    
    .financial-statement th {
        background: #f0f0f0 !important;
        color: #000 !important;
    }
    
    .financial-statement .category-header td {
        background: #f5f5f5 !important;
        color: #000 !important;
    }
    
    .financial-statement tbody tr:hover {
        background-color: transparent !important;
        transform: none !important;
        box-shadow: none !important;
    }
}

/* 테이블 제목 스타일 */
.financial-statement-title {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: #1a202c;
    margin: 20px 0 10px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 8px;
    border-left: 4px solid #4299e1;
}

/* 테이블 메타데이터 */
.financial-statement-meta {
    text-align: center;
    font-size: 14px;
    color: #718096;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f8fafc;
    border-radius: 6px;
}

/* 로딩 상태 스타일 */
.financial-statement.loading {
    opacity: 0.6;
    pointer-events: none;
}

.financial-statement.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #4299e1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 반응형 디자인 개선 */
@media (max-width: 1200px) {
    .financial-statement {
        font-size: 13px;
    }
    
    .financial-statement td:first-child {
        min-width: 180px;
    }
    
    .financial-statement td:not(:first-child) {
        min-width: 100px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .financial-statement {
        font-size: 12px;
        margin: 15px auto;
        border-radius: 6px;
    }
    
    .financial-statement th {
        font-size: 13px;
        padding: 12px 10px;
    }
    
    .financial-statement td {
        padding: 10px 8px;
    }
    
    .financial-statement td:first-child {
        padding-left: 12px;
        min-width: 150px;
        font-size: 12px;
    }
    
    .financial-statement td.account-indented {
        padding-left: 24px;
        font-size: 11px;
    }
    
    .financial-statement td:not(:first-child) {
        padding-right: 12px;
        font-size: 12px;
        min-width: 80px;
    }
    
    .financial-statement .category-header td {
        font-size: 13px;
        padding: 12px 10px;
    }
    
    .financial-statement-title {
        font-size: 16px;
        margin: 15px 0 8px 0;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .financial-statement {
        font-size: 11px;
    }
    
    .financial-statement th {
        font-size: 12px;
        padding: 10px 6px;
    }
    
    .financial-statement td {
        padding: 8px 6px;
    }
    
    .financial-statement td:first-child {
        padding-left: 8px;
        min-width: 120px;
    }
    
    .financial-statement td.account-indented {
        padding-left: 16px;
    }
    
    .financial-statement td:not(:first-child) {
        padding-right: 8px;
        min-width: 70px;
    }
    
    .financial-statement .category-header td {
        font-size: 12px;
        padding: 10px 8px;
    }
}

/* 메인 탭 스타일 */
.main-tab-container {
    display: flex;
    border-bottom: 2px solid #e1e4e8;
    margin-bottom: 20px;
}

.main-tab-button {
    background-color: #f8f9fa;
    border: 1px solid #e1e4e8;
    border-bottom: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    border-radius: 5px 5px 0 0;
    margin-right: 2px;
}

.main-tab-button:hover {
    background-color: #e9ecef;
    color: #333;
}

.main-tab-button.active {
    background-color: #fff;
    color: #003366;
    border-bottom: 2px solid #fff;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.main-tab-button i {
    margin-right: 8px;
}

/* 탭 스타일 */
.tab-container {
  overflow: hidden;
  margin-bottom: 20px;
}

.tab-container button {
  background-color: #f1f1f1;
  float: left;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 10px 16px;
  transition: 0.3s;
  font-size: 14px;
  border-radius: 5px 5px 0 0;
  margin-right: 5px;
  color: #333;
}

.tab-container button:hover {
  background-color: #ddd;
}

.tab-container button.active {
  background-color: #003366;
  color: white;
  font-weight: 600;
}

.tab-content {
  display: none;
  padding: 20px;
  border: 1px solid #ccc;
}

.tab-content.active {
    display: block;
}

/* 로딩 스타일 */
#loading {
    padding: 2rem 0;
    text-align: center;
}

#loading .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* results 요소는 JavaScript에서 제어 */
#results.show {
    display: block !important;
}

/* 탭 컨테이너 강제 표시 */
.tab-container {
    display: block !important;
}

#tables-tab-content {
    display: block !important;
}

#tables-preview {
    display: block !important;
}

/* 반응형 스타일 */
@media (max-width: 768px) {
    .card-header {
        flex-direction: column;
    }
    
    .card-header form {
        margin-top: 1rem;
    }
}

/* 테이블 반응형 스타일 */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 버튼 스타일 */
.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

/* 알림 메시지 스타일 */
.alert {
    border-radius: 0.25rem;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* 테이블 정보 스타일 */
.table-info {
    background-color: #f8f9fa;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.9rem;
}

/* 메인 컨텐츠 여백 조정 */
.main-content {
    margin-bottom: 3rem;
}

/* 분석 탭 스타일 */
.analysis-container {
    padding: 20px;
}

.analysis-card {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    height: 100%;
}

.analysis-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-bottom: 1px solid #e1e4e8;
}

.analysis-card-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.analysis-card-header p {
    margin: 5px 0 0 0;
    font-size: 13px;
    opacity: 0.9;
}

.analysis-card-body {
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

/* 분석 차트 그리드 레이아웃 */
.analysis-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 차트 컴테이너 스타일 - 균등한 크기 */
.chart-container {
    position: relative;
    width: 100%;
    height: 350px; /* 모든 차트 동일한 높이 */
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 15px;
    box-sizing: border-box;
}

/* 차트 캔버스 스타일 */
.chart-container canvas {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
}

/* 반응형 차트 */
@media (max-width: 768px) {
    .analysis-charts {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 15px;
    }
    
    .chart-container {
        height: 300px;
    }
}

@media (max-width: 576px) {
    .chart-container {
        height: 250px;
        padding: 10px;
    }
}

/* 재무제표 탭 스타일 개선 */
.financial-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 25px;
    padding: 8px;
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.financial-tab {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

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

.financial-tab:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #2d3748;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.financial-tab:hover::before {
    left: 100%;
}

.financial-tab.active {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: #ffffff;
    border-color: #3182ce;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.financial-tab.active::before {
    display: none;
}

.financial-tab i {
    margin-right: 6px;
    font-size: 12px;
}

/* 탭 반응형 */
@media (max-width: 768px) {
    .financial-tabs {
        padding: 6px;
        gap: 3px;
    }
    
    .financial-tab {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .financial-tab i {
        margin-right: 4px;
    }
}

/* 네비게이션 탭 스타일 유지 */
.nav-tabs {
    border-bottom: 2px solid #e1e4e8;
    margin-bottom: 0;
}

.nav-tabs .nav-link {
    border: none;
    color: #666;
    font-weight: 500;
    padding: 12px 20px;
    border-radius: 0;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    color: #4299e1;
    background-color: #f8f9fa;
}

.nav-tabs .nav-link.active {
    color: #4299e1;
    background-color: transparent;
    border-bottom: 3px solid #4299e1;
    font-weight: 600;
}

.tab-content {
    background: #fff;
    border-radius: 0 0 8px 8px;
}

/* 하이라이트 효과 */
.financial-statement tbody tr.highlighted {
    background-color: #e6f3ff !important;
    border-left: 4px solid #4299e1;
    box-shadow: 0 2px 8px rgba(66, 153, 225, 0.2);
}

/* 애니메이션 효과 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.financial-statement tbody tr {
    animation: fadeIn 0.3s ease-out;
}

.financial-statement tbody tr:nth-child(n) {
    animation-delay: calc(var(--row-index, 0) * 0.05s);
}

/* 포커스 효과 */
.financial-statement tbody tr:focus {
    outline: 2px solid #4299e1;
    outline-offset: -2px;
}

/* 차트 반응형 스타일 */
@media (max-width: 768px) {
    .analysis-card-body {
        padding: 15px;
        min-height: 250px;
    }
    
    .analysis-container {
        padding: 15px;
    }
    
    .nav-tabs .nav-link {
        padding: 10px 15px;
        font-size: 14px;
    }
}

/* 재무비율 스타일 */
.ratios-container {
    padding: 20px;
}

.ratios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.ratio-category {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ratio-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.ratio-header {
    padding: 20px;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ratio-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.1;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="white"/><circle cx="80" cy="20" r="2" fill="white"/><circle cx="20" cy="80" r="2" fill="white"/><circle cx="80" cy="80" r="2" fill="white"/></svg>');
}

.ratio-header.profitability {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ratio-header.stability {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.ratio-header.activity {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.ratio-header.growth {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.ratio-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.ratio-header i {
    margin-right: 8px;
    font-size: 1.1rem;
}

.ratio-content {
    padding: 20px;
    min-height: 120px;
}

.ratio-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ratio-item:last-child {
    border-bottom: none;
}

.ratio-name {
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.ratio-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
}

.ratio-placeholder {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
}

/* 재무비율 반응형 디자인 */
@media (max-width: 768px) {
    .ratios-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .ratio-category {
        margin-bottom: 15px;
    }
    
    .ratio-header {
        padding: 15px;
    }
    
    .ratio-content {
        padding: 15px;
    }
    
    .ratio-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .ratio-value {
        font-size: 1.2rem;
    }
}

/* 데이터 없음 메시지 스타일 */
.no-data-message {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 5px;
    margin: 10px 0;
}

/* 재무비율 더 보기 버튼 스타일 */
.ratio-toggle-button {
    text-align: center;
    margin-top: 15px;
    padding: 10px 0;
    border-top: 1px solid #e9ecef;
}

.ratio-toggle-button .btn {
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.ratio-toggle-button .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,123,255,0.2);
}

.ratio-toggle-button .btn i {
    margin-right: 5px;
    transition: transform 0.3s ease;
}

.ratio-toggle-button .btn:hover i {
    transform: scale(1.1);
}

/* 재무제표 용어 설명 툴팁 스타일 */
.financial-tooltip {
    position: fixed;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 15px;
    max-width: 350px;
    z-index: 1000;
    font-size: 0.875rem;
    line-height: 1.4;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    will-change: opacity, transform;
}

.financial-term-tooltip .term-header {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.financial-term-tooltip .term-header strong {
    color: #2c3e50;
    font-size: 1rem;
    margin-right: 8px;
}

.financial-term-tooltip .term-category {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.financial-term-tooltip .term-description {
    color: #555;
    margin-bottom: 10px;
}

.financial-term-tooltip .term-benchmark {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid #007bff;
}

.financial-term-tooltip .benchmark-value {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.financial-term-tooltip .benchmark-interpretation {
    font-weight: 600;
    margin-bottom: 5px;
}

.financial-term-tooltip .benchmark-interpretation.양호 {
    color: #28a745;
}

.financial-term-tooltip .benchmark-interpretation.보통 {
    color: #ffc107;
}

.financial-term-tooltip .benchmark-interpretation.개선-필요,
.financial-term-tooltip .benchmark-interpretation.needs-improvement {
    color: #dc3545;
}

.financial-term-tooltip .benchmark-standards {
    font-size: 0.75rem;
    color: #6c757d;
    line-height: 1.3;
}

/* 툴팁이 있는 요소 스타일 */
.has-tooltip {
    cursor: help;
    position: relative;
    transition: background-color 0.2s ease, border-radius 0.2s ease;
}

.has-tooltip:hover {
    background-color: #f8f9fa;
    border-radius: 4px;
}

/* 툴팁 화살표 */
.financial-tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #ddd;
}

.financial-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #fff;
    margin-top: -1px;
}

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

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

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

