:root {
    /* 충돌이 발생한 primary, background 관련 변수는 제거되었습니다. */
    /* 나머지 고유 변수들은 유지됩니다. */
    --surface-light: #ffffff;
    --text-dark: #2c3e50;
    --text-medium: #555;
    --text-light: #7f8c8d;
    --border-color: #e0e0e0;
    --shadow-subtle: 0 2px 5px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 4px 10px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 8px 20px rgba(0, 0, 0, 0.2);

    /* Incident Type Colors */
    --type-ransomware: #e74c3c; /* Red */
    --type-data-breach: #0056b3; /* Dark Blue */
    --type-hacking: #8e44ad; /* Dark Purple */
    --type-supply-chain: #16a085; /* Teal */
    --type-vulnerability: #00bfae ; /* Orange */
    --type-system-failure: #34495e; /* Dark Blue/Grey */
    --type-other: #6c757d; /* Medium Grey - 더 밝게 변경 */

    /* Year and Country Filter Colors */
    --year-filter-color: #f39c12; /* Orange */
    --country-filter-color: #16a085; /* Teal */

    /* Impact Colors */
    --impact-critical: #c0392b; /* Darker Red */
    --impact-high: #d35400; /* Dark Orange */
    --impact-medium: #f39c12; /* Orange */

    /* Filter Tag Colors */
    --filter-tag-bg: #e9ecef; /* Light Grey */
    --filter-tag-text: var(--text-dark);
    --filter-tag-bg-selected: var(--primary-color);
    --filter-tag-text-selected: white;
    --filter-tag-clear-bg: #adb5bd;
    --filter-tag-clear-bg-hover: #6c757d;

    /* Export Button/Menu */
    --export-button-bg: #607d8b; /* Blue Grey */
    --export-button-hover-bg: #546e7a;
    --export-menu-bg: var(--surface-light);
    --export-option-hover-bg: #f0f0f0;

    /* Modal */
    --modal-overlay-bg: rgba(0, 0, 0, 0.6);
    --modal-content-bg: var(--surface-light);
    --modal-border-color: var(--border-color);
}

/* Modal Actions (Buttons) - :root 밖으로 이동하여 문법 수정 */
.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px; /* 버튼 사이 간격 */
    margin-top: 20px;
    width: 100%; /* 부모 요소에 맞게 너비 설정 */
    flex-wrap: wrap; /* 작은 화면에서 줄바꿈 허용 */
}

.modal-download-button {
    padding: 12px 25px;
    font-size: 1em;
    color: white;
    border: none;
    border-radius: 8px; /* 더 둥근 모서리 */
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* 그림자 추가 */
    flex-shrink: 0; /* 버튼이 줄어들지 않도록 */
}

.modal-download-button:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); /* 호버 시 그림자 강화 */
    transform: translateY(-2px); /* 살짝 위로 이동 */
}

.modal-download-button:active {
    transform: translateY(0); /* 클릭 시 원래 위치로 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 클릭 시 그림자 약화 */
}

/* 설명 토글 버튼 */
#modal-toggle-description-btn {
    background-color: #6c757d; /* Darker grey */
}

#modal-toggle-description-btn:hover {
    background-color: #5a6268; /* Even darker grey on hover */
}

/* PNG 다운로드 버튼 */
#modal-download-png-btn {
    background-color: var(--primary-color); /* Primary blue */
}

#modal-download-png-btn:hover {
    background-color: var(--primary-dark); /* Darker blue on hover */
}


/* Section Heading for Year (Table View) */
.year-section {
    margin-top: 40px;
    margin-bottom: 20px;
}

.year-section h2 {
    font-size: 1.8em;
    margin: 0;
    color: var(--text-dark);
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
    padding-bottom: 5px;
}

/* Table Styling - Only for table view */
#timeline-container table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    background-color: var(--surface-light);
    box-shadow: var(--shadow-medium);
    border-radius: 8px;
    overflow: hidden;
    table-layout: fixed; /* 테이블 레이아웃 고정 */
}

/* 반응형 테이블 컨테이너 */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
    margin-bottom: 30px;
    position: relative;
}

/* 스크롤 표시기 */
.table-responsive::after {
    content: '← 스크롤하여 더 많은 내용을 확인하세요 →';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8em;
    color: var(--text-light);
    white-space: nowrap;
    opacity: 0.7;
}

/* 스크롤바 스타일링 */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

#timeline-table-container {
    min-width: 100%;
    background-color: var(--surface-light);
}

#timeline-table-container table {
    width: 100%;
    min-width: 800px; /* 최소 너비 설정 */
    border-collapse: collapse;
    margin: 0;
    background-color: var(--surface-light);
    border-radius: 8px;
    overflow: hidden;
    table-layout: fixed; /* 테이블 레이아웃 고정 */
}

#timeline-container th,
#timeline-container td {
    padding: 14px 20px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#timeline-table-container th,
#timeline-table-container td {
    padding: 14px 20px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#timeline-container th {
    background-color: #f0f3f7;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
}

#timeline-container tbody tr:nth-child(even) {
    background-color: #fcfdff;
}

#timeline-container tbody tr:hover {
    background-color: #f5f8ff;
}

/* Column specific styles */
.date-col { width: 100px; }
.country-col { width: 80px; }
.company-col { width: 120px; }
.type-col { width: 100px; }
.impact-col { width: 120px; }
.description-col { min-width: 200px; }
.articles-col,
.regulatory-col { width: 150px; }

.articles-col a,
.regulatory-col a {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    margin-bottom: 8px;
    font-size: 0.9em;
    line-height: 1.4;
}

.articles-col a:hover,
.regulatory-col a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Column Widths (Table View) - 고정 레이아웃용 */
#timeline-container .date-col { width: 12%; }
#timeline-container .country-col { width: 10%; }
#timeline-container .company-col { width: 18%; }
#timeline-container .type-col { width: 15%; }
#timeline-container .impact-col { width: 12%; }
#timeline-container .description-col { width: 33%; }

/* 반응형 테이블 컬럼 너비 - 고정 레이아웃용 */
#timeline-table-container .date-col { width: 12%; }
#timeline-table-container .country-col { width: 10%; }
#timeline-table-container .company-col { width: 18%; }
#timeline-table-container .type-col { width: 15%; }
#timeline-table-container .impact-col { width: 12%; }
#timeline-table-container .description-col { width: 33%; }

/* 모바일에서 컬럼 너비 조정 */
@media (max-width: 768px) {
    #timeline-container .date-col { width: 15%; }
    #timeline-container .country-col { width: 12%; }
    #timeline-container .company-col { width: 20%; }
    #timeline-container .type-col { width: 18%; }
    #timeline-container .impact-col { width: 15%; }
    #timeline-container .description-col { width: 20%; }
    
    #timeline-table-container .date-col { width: 15%; }
    #timeline-table-container .country-col { width: 12%; }
    #timeline-table-container .company-col { width: 20%; }
    #timeline-table-container .type-col { width: 18%; }
    #timeline-table-container .impact-col { width: 15%; }
    #timeline-table-container .description-col { width: 20%; }
}

/* Incident type styles */
.incident-type {
    padding: 5px 10px;
    border-radius: 20px;
    color: white;
    font-weight: 600;
    font-size: 0.85em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 5px;
    margin-bottom: 3px;
    white-space: nowrap;
    background-color: #495057;
}

.incident-type.ransomware { background-color: var(--type-ransomware); }
.incident-type.data-breach { background-color: var(--type-data-breach); }
.incident-type.hacking { background-color: var(--type-hacking); }
.incident-type.supply-chain { background-color: var(--type-supply-chain); }
.incident-type.vulnerability { background-color: var(--type-vulnerability); }
.incident-type.system-failure { background-color: var(--type-system-failure); }
.incident-type.other { background-color: var(--type-other); }

/* Impact styles */
.impact-critical { color: var(--impact-critical); font-weight: 700; }
.impact-high { color: var(--impact-high); font-weight: 700; }
.impact-medium { color: var(--impact-medium); font-weight: 700; }
.impact-critical, .impact-high, .impact-medium {
    text-shadow: 0 0 2px rgba(255,255,255,0.5);
}

/* Filter Tag Styling */
.filter-tags-container {
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 20px;
    background-color: var(--surface-light);
    border-radius: 8px;
    box-shadow: var(--shadow-subtle);
}

.filter-tags-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-dark);
    font-size: 1.2em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* ================================================================ */
/* ============== 버튼 디자인 수정 (시작) =========================== */
/* ================================================================ */

/* Buttons Container Styling */
.buttons-container {
    margin-top: 10px;
    padding-top: 5px;
    display: flex;
    justify-content: flex-end; /* 오른쪽 정렬 */
    align-items: center;
    position: relative;
    z-index: 10; /* 다른 요소들 위에 표시 */
}

.option-group {
    display: flex;
    gap: 12px; /* 버튼 사이 간격 */
    flex-wrap: wrap; /* 작은 화면에서 줄바꿈 */
    justify-content: flex-end; /* 오른쪽 정렬 */
    position: relative;
    z-index: 10;
}

.option-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center; /* 아이콘과 텍스트 중앙 정렬 보장 */
    gap: 8px;
    padding: 12px 24px; /* 좌우 여백 확장 */
    color: white;
    border: none;
    border-radius: 10px; /* 모서리를 좀 더 둥글게 */
    font-size: 1em; /* 폰트 크기 표준화 */
    font-weight: 600; /* 폰트 굵게 */
    letter-spacing: 0.3px; /* 글자 간격 추가 */
    cursor: pointer;
    /* 더 부드럽고 탄성있는 트랜지션과 세련된 그림자 */
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    z-index: 10;
    pointer-events: auto; /* 클릭 가능하도록 강제 설정 */
}

.option-btn:hover {
    /* 더 역동적인 호버 효과 */
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15), 0 4px 8px rgba(0, 0, 0, 0.08);
}

.option-btn:active {
    /* 눌리는 느낌을 강조 */
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.option-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    /* 아이콘에도 트랜지션 적용 */
    transition: transform 0.2s ease-in-out;
}

.option-btn:hover svg {
    transform: scale(1.1);
}

/* 특정 버튼별 스타일 */
/* 기본 버튼 (파란색) */
.option-btn {
    background: linear-gradient(140deg, var(--primary-color), var(--primary-dark));
}
.option-btn:hover {
     background: linear-gradient(140deg, #4ea8e1, var(--primary-dark));
}

/* 인포그래픽 버튼 (초록색) */
#open-infographic-modal-btn {
    background: linear-gradient(140deg, #2ecc71, #27ae60);
}
#open-infographic-modal-btn:hover {
    background: linear-gradient(140deg, #58d68d, #28b463); /* 호버 시 더 밝은 톤 */
}

/* 가로형 인포그래픽 버튼 (보라색) */
#open-infographic-modal-horizontal-btn {
    background: linear-gradient(140deg, #9b59b6, #8e44ad);
}
#open-infographic-modal-horizontal-btn:hover {
    background: linear-gradient(140deg, #af7ac5, #9b59b6); /* 호버 시 더 밝은 톤 */
}

/* JSON 내보내기 버튼 (주황색) */
#export-json-btn {
    background: linear-gradient(140deg, #f39c12, #e67e22);
}
#export-json-btn:hover {
    background: linear-gradient(140deg, #f5b041, #eb984e); /* 호버 시 더 밝은 톤 */
}

/* CSV 내보내기 버튼 (빨간색) */
#export-csv-btn {
    background: linear-gradient(140deg, #e74c3c, #c0392b);
}
#export-csv-btn:hover {
    background: linear-gradient(140deg, #ec7063, #d9534f); /* 호버 시 더 밝은 톤 */
}

/* ================================================================ */
/* ============== 버튼 디자인 수정 (끝) ============================= */
/* ================================================================ */


.filter-group {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 6px;
    background-color: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
    position: relative;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group h4 {
    margin: -25px 0 0px 0;
    color: var(--text-dark);
    font-size: 1.1em;
    display: inline-block;
    padding: 5px 15px;
    background-color: var(--surface-light);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    position: relative;
}

.filter-tag {
    display: inline-block;
    padding: 6px 15px;
    margin: 3px 6px;
    border-radius: 15px;
    background: linear-gradient(135deg, #f8fafc 60%, #e9ecef 100%);
    color: var(--filter-tag-text);
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: box-shadow 0.2s, background 0.2s, color 0.2s, transform 0.2s;
    user-select: none;
    border: 1.5px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.04);
    position: relative;
    z-index: 10;
    pointer-events: auto;
    letter-spacing: 0.5px;
    outline: none;
}

.filter-tag:hover {
    background: linear-gradient(135deg, #e3f0fc 60%, #dee2e6 100%);
    color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.10);
    transform: translateY(-2px) scale(1.04);
    border-color: var(--primary-color);
}

.filter-tag.selected {
    background: linear-gradient(135deg, var(--primary-color) 60%, var(--primary-dark) 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(52, 152, 219, 0.18);
    border-color: var(--primary-dark);
    transform: translateY(-2px) scale(1.06);
}

.filter-tag.selected:hover {
    background: linear-gradient(135deg, var(--primary-dark) 60%, #1f5f8b 100%);
    color: #fff;
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.22);
    transform: translateY(-4px) scale(1.08);
}

.filter-tag.select-all,
.filter-tag.clear-all {
    background: linear-gradient(135deg, #f8fafc 60%, #e9ecef 100%);
    border: 1.5px solid var(--border-color);
    font-weight: 600;
    color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.04);
    transition: box-shadow 0.2s, background 0.2s, color 0.2s, transform 0.2s;
}

.filter-tag.select-all:hover,
.filter-tag.clear-all:hover {
    background: linear-gradient(135deg, #e3f0fc 60%, #dee2e6 100%);
    color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.10);
    border-color: var(--primary-color);
}

.filter-tag.select-all.selected,
.filter-tag.clear-all.selected {
    /* 부드러운 회색-파랑 그라디언트 */
    background: linear-gradient(135deg, #5d6d7e 60%, #34495e 100%);
    /* 글자색: 연한 회색 (읽기 편한 색상) */
    color: #ecf0f1;
    /* 테두리 색상: 배경과 조화 */
    border-color: #5d6d7e;
    /* 그림자: 더 부드럽고 은은하게 */
    box-shadow: 0 4px 12px rgba(52, 73, 94, 0.15);
}
/* 사고 유형 필터 태그 색상 */
.filter-tag.incident-type-filter.selected {
    background: linear-gradient(135deg, var(--type-data-breach) 60%, #2b598b 100%);
    color: #fff;
    border-color: var(--type-data-breach);
    box-shadow: 0 4px 16px rgba(0,86,179,0.18);
}

.filter-tag.incident-type-filter.ransomware.selected {
    background: linear-gradient(135deg, var(--type-ransomware) 60%, #c0392b 100%);
    border-color: var(--type-ransomware);
}
.filter-tag.incident-type-filter.data-breach.selected {
    background: linear-gradient(135deg, var(--type-data-breach) 60%, #2980b9 100%);
    border-color: var(--type-data-breach);
}
.filter-tag.incident-type-filter.hacking.selected {
    background: linear-gradient(135deg, var(--type-hacking) 60%, #5e3370 100%);
    border-color: var(--type-hacking);
}
.filter-tag.incident-type-filter.supply-chain.selected {
    background: linear-gradient(135deg, var(--type-supply-chain) 60%, #117864 100%);
    border-color: var(--type-supply-chain);
}
.filter-tag.incident-type-filter.vulnerability.selected {
    background: #00bfae !important;
    color: #fff !important;
    border-color: #00bfae !important;
}
.filter-tag.incident-type-filter.system-failure.selected {
    background: linear-gradient(135deg, var(--type-system-failure) 60%, #212f3c 100%);
    border-color: var(--type-system-failure);
}
.filter-tag.incident-type-filter.other.selected {
    background: linear-gradient(135deg, var(--type-other) 60%, #5d4037 100%);
    border-color: var(--type-other);
}

/* 연도 필터 태그 색상 */
.filter-tag.year-filter.selected {
    background: #bfa100 !important;
    color: #fff !important;
    border-color: #bfa100 !important;
}

/* 국가 필터 태그 색상 */
.filter-tag.country-filter.selected {
    background: linear-gradient(135deg, var(--country-filter-color) 60%, #117864 100%);
    color: #fff;
    border-color: var(--country-filter-color);
    box-shadow: 0 4px 16px rgba(22,160,133,0.18);
}
#type-filter-group {
    border-color: var(--type-data-breach);
    background-color: rgba(52, 152, 219, 0.05);
}

#type-filter-group h4 {
    color: var(--type-data-breach);
    border-color: var(--type-data-breach);
}

#year-filter-group {
    border-color: var(--type-vulnerability);
    background-color: rgba(46, 204, 113, 0.05);
}

#year-filter-group h4 {
    color: var(--type-vulnerability);
    border-color: var(--type-vulnerability);
}

#country-filter-group {
    border-color: var(--type-supply-chain);
    background-color: rgba(243, 156, 18, 0.05);
}

#country-filter-group h4 {
    color: var(--type-supply-chain);
    border-color: var(--type-supply-chain);
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow-y: auto;
    backdrop-filter: blur(5px); /* 배경 블러 효과 */
    opacity: 0; /* 초기 투명도 */
    transition: opacity 0.3s ease; /* 페이드인/아웃 애니메이션 */
    pointer-events: none; /* 기본적으로 클릭 불가능 */
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto; /* 활성화될 때만 클릭 가능 */
}

.modal-overlay.hidden {
    display: none; /* 완전히 숨김 */
}

.modal-content {
    background: var(--modal-content-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow-heavy);
    max-width: 95%;
    width: 900px;
    max-height: 95vh;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px;
    transform: translateY(20px); /* 초기 위치 아래로 */
    opacity: 0; /* 초기 투명도 */
    transition: all 0.3s ease; /* 애니메이션 */
}

.modal-overlay.active .modal-content {
    opacity: 1;
    transform: translateY(0); /* 최종 위치 */
}


.modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--text-dark);
    font-size: 1.5em;
    /* border-bottom: 1px solid var(--border-color); */ /* 제거 */
    padding-bottom: 10px;
    width: 100%;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5em;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-medium);
}

#modal-infographic-container {
    width: 100%;
    flex-grow: 1;
    overflow: auto;
    overflow-x: auto;
    margin-bottom: 20px;
    min-height: 100px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* border: 1px solid var(--border-color); */ /* 제거 */
    background-color: white;
    position: relative;
    padding: 20px 0;
}

/* HTML/CSS Timeline Styling */
.html-timeline {
    width: 100%;
    position: relative;
    min-height: 400px;
}

.html-timeline-axis {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, #e74c3c, #c0392b);
    transform: translateX(-50%);
    border-radius: 2px;
    box-shadow: var(--shadow-subtle);
}

.timeline-item {
    position: relative;
    min-height: 120px;
    margin-bottom: var(--item-spacing, 40px);
    width: 100%;
    display: flex;
    align-items: center;
}

.timeline-item.left {
    justify-content: flex-start;
}

.timeline-item.right {
    justify-content: flex-end;
}

.timeline-point {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid var(--surface-light);
    box-shadow: var(--shadow-medium);
    z-index: 3;
}

.timeline-point.type-ransomware { background-color: var(--type-ransomware); }
.timeline-point.type-data-breach { background-color: var(--type-data-breach); }
.timeline-point.type-hacking { background-color: var(--type-hacking); }
.timeline-point.type-supply-chain { background-color: var(--type-supply-chain); }
.timeline-point.type-vulnerability { background-color: var(--type-vulnerability); }
.timeline-point.type-system-failure { background-color: var(--type-system-failure); }
.timeline-point.type-other { background-color: var(--type-other); }

.timeline-stem {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 140px;
    height: 3px;
    background: linear-gradient(to right, #95a5a6, #7f8c8d);
    z-index: 2;
}

.timeline-item.left .timeline-stem {
    right: 50%;
    left: auto;
    transform: translateY(-50%) translateX(calc(50% - 140px));
}

.timeline-item.right .timeline-stem {
    left: 50%;
    right: auto;
    transform: translateY(-50%) translateX(calc(-50% + 140px));
}

.timeline-card {
    width: 380px;
    background: linear-gradient(to bottom right, var(--surface-light), var(--background-light));
    border-radius: 12px;
    padding: 18px;
    box-shadow: var(--shadow-medium);
    position: relative;
    flex-shrink: 0;
    border: none;
    z-index: 1;
}

.timeline-item.left .timeline-card {
    margin-right: 80px;
    text-align: right;
}

.timeline-item.right .timeline-card {
    margin-left: 80px;
    text-align: left;
}

.timeline-card .card-date {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-medium);
    margin-bottom: 8px;
    border: none;
}

.timeline-card .card-company {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
    border: none;
}

.timeline-card .card-type-country {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-medium);
    margin-bottom: 8px;
    border: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    background: none !important;
}

.timeline-card .card-type-country strong {
    color: var(--text-dark);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    border: none;
}

.timeline-card .card-type-country strong.type-ransomware { background-color: var(--type-ransomware); color: white; }
.timeline-card .card-type-country strong.type-data-breach { background-color: var(--type-data-breach); color: white; }
.timeline-card .card-type-country strong.type-hacking { background-color: var(--type-hacking); color: white; }
.timeline-card .card-type-country strong.type-supply-chain { background-color: var(--type-supply-chain); color: white; }
.timeline-card .card-type-country strong.type-vulnerability { background-color: var(--type-vulnerability); color: white; }
.timeline-card .card-type-country strong.type-system-failure { background-color: var(--type-system-failure); color: white; }
.timeline-card .card-type-country strong.type-other { background-color: var(--type-other); color: white; }

.timeline-card .card-impact {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    border: none;
}

.timeline-card .card-impact.impact-critical { color: var(--impact-critical); }
.timeline-card .card-impact.impact-high { color: var(--impact-high); }
.timeline-card .card-impact.impact-medium { color: var(--impact-medium); }

.timeline-card .card-description {
    font-size: 13px;
    color: var(--text-medium);
    line-height: 1.4;
    border: none;
}

/* 관련 링크 스타일링 */
.incident-links {
    margin-top: 10px;
    font-size: 0.9em;
    line-height: 1.4;
}

.incident-links strong {
    color: var(--text-dark);
    display: block;
    margin-top: 8px;
}

.incident-links a {
    color: var(--primary-color);
    text-decoration: none;
    margin-right: 8px;
    display: inline-block;
}

.incident-links a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    /* 충돌하는 body, .container, h1 등 제거 */

    .year-section h2 {
        font-size: 1.5em;
    }

    /* 반응형 테이블 스타일 */
    .table-responsive {
        margin-bottom: 20px;
        border-radius: 6px;
    }
    
    #timeline-table-container table {
        min-width: 600px; /* 모바일에서 최소 너비 조정 */
    }
    
    table, th, td {
        padding: 8px 12px; /* 모바일에서 패딩 축소 */
        font-size: 0.9em; /* 모바일에서 폰트 크기 축소 */
    }
    
    /* 모바일에서 테이블 헤더 고정 */
    #timeline-table-container thead th {
        position: sticky;
        top: 0;
        background-color: #f0f3f7;
        z-index: 10;
    }
    
    /* 모바일에서 스크롤 표시기 숨김 */
    .table-responsive::after {
        display: none;
    }
    
    /* 모바일에서 테이블 셀 툴팁 */
    #timeline-table-container td,
    #timeline-container td {
        position: relative;
    }
    
    #timeline-table-container td:hover::after,
    #timeline-container td:hover::after {
        content: attr(title);
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 0.8em;
        white-space: nowrap;
        z-index: 1000;
        pointer-events: none;
        max-width: 200px;
        word-wrap: break-word;
    }

    .incident-type {
        font-size: 0.8em;
        padding: 3px 8px;
    }

    .filter-tags-container {
        padding: 15px;
    }

    .filter-tags-container h3 {
        font-size: 1.1em;
    }

    .filter-group h4 {
        display: block;
        margin-bottom: 5px;
        margin-right: 0;
    }

    .filter-tag {
        font-size: 0.85em;
        padding: 4px 10px;
        margin: 2px 3px;
    }

    .filter-tag.select-all,
    .filter-tag.clear-all {
        margin-left: 0;
        margin-top: 5px;
        display: inline-block;
    }

    /* Buttons Container Responsive */
    .buttons-container {
        margin-top: 15px;
        padding-top: 15px;
        justify-content: center; /* 모바일에서는 중앙 정렬 */
    }

    .option-group {
        gap: 8px;
        justify-content: center; /* 모바일에서는 중앙 정렬 */
    }

    .option-btn {
        padding: 10px 16px;
        font-size: 0.9em;
        gap: 6px;
    }

    .option-btn svg {
        width: 16px;
        height: 16px;
    }

    .export-options {
        flex-direction: column;
        gap: 15px;
    }

    .modal-content {
        padding: 20px;
        width: 95%;
        max-width: 95%;
    }

    .modal-content h3 {
        font-size: 1.3em;
    }

    .modal-close {
        font-size: 1.3em;
    }

    #modal-infographic-container {
        padding: 0 10px;
    }

    .html-timeline {
        padding-left: 0;
    }

    .html-timeline-axis {
        left: 20px;
        background: linear-gradient(to bottom, #e74c3c, #c0392b);
    }

    .timeline-item {
        justify-content: flex-start;
    }

    .timeline-point {
        left: 20px;
        width: 20px;
        height: 20px;
    }

    .timeline-stem {
        left: 20px;
        width: 60px;
        height: 2px;
        background: linear-gradient(to right, #95a5a6, #7f8c8d);
    }

    .timeline-item.left .timeline-stem {
        right: auto;
        left: 20px;
        transform: translateY(-50%) translateX(0);
    }

    .timeline-item.right .timeline-stem {
        left: 20px;
        transform: translateY(-50%) translateX(0);
    }

    .timeline-card {
        width: calc(100% - 60px); /* 너비 조정 */
        margin-left: 40px; /* 마진 조정 */
        margin-right: 0;
        text-align: left;
        padding: 15px;
        border: none;
    }

    .timeline-item.left .timeline-card {
        margin-left: 40px; /* 마진 조정 */
        margin-right: 0;
        text-align: left;
        border: none;
    }

    .timeline-card .card-type-country strong {
        color: white;
        padding: 2px 6px;
        border-radius: 10px;
        font-size: 10px;
        border: none;
    }

    .timeline-year-marker {
        margin: 40px 0 25px;
    }

    .timeline-year-marker span {
        padding: 10px 25px;
        font-size: 1.6em;
        background: linear-gradient(135deg, #2c3e50, #34495e);
    }
}

/* 태블릿 반응형 스타일 */
@media (max-width: 1024px) and (min-width: 769px) {
    #timeline-table-container table {
        min-width: 700px; /* 태블릿에서 최소 너비 조정 */
    }
    
    table, th, td {
        padding: 10px 14px; /* 태블릿에서 패딩 조정 */
        font-size: 0.95em; /* 태블릿에서 폰트 크기 조정 */
    }
    
    .table-responsive {
        margin-bottom: 25px;
    }
    
    /* 태블릿에서 컬럼 너비 조정 */
    #timeline-container .date-col { width: 13%; }
    #timeline-container .country-col { width: 11%; }
    #timeline-container .company-col { width: 19%; }
    #timeline-container .type-col { width: 16%; }
    #timeline-container .impact-col { width: 13%; }
    #timeline-container .description-col { width: 28%; }
    
    #timeline-table-container .date-col { width: 13%; }
    #timeline-table-container .country-col { width: 11%; }
    #timeline-table-container .company-col { width: 19%; }
    #timeline-table-container .type-col { width: 16%; }
    #timeline-table-container .impact-col { width: 13%; }
    #timeline-table-container .description-col { width: 28%; }
}

/* Infographic Timeline Year Marker */
.timeline-year-marker {
    position: relative;
    width: 100%;
    text-align: center;
    margin: 30px 0 20px; /* 마진 감소 */
    display: flex;
    justify-content: center;
    align-items: center;
}

.timeline-year-marker span {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 10px 25px; /* 패딩 감소 */
    font-size: 1.5em; /* 폰트 크기 감소 */
    font-weight: 800;
    border-radius: 40px;
    position: relative;
    z-index: 2;
    box-shadow: var(--shadow-heavy);
    box-sizing: border-box;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

.timeline-year-marker::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 4px;
    background: linear-gradient(to right, transparent, #34495e, transparent);
    z-index: 1;
    transform: translateY(-50%);
}

/* 가로형 인포그래픽 타임라인 */
.html-timeline-horizontal {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow-x: auto;
  padding: 32px 0;
  background: #fff;
}

.timeline-horizontal-years {
  display: flex;
  flex-direction: row;
  margin-bottom: 16px;
  gap: 40px;
}

/* 가로형 인포그래픽 타임라인 정렬 및 시인성 개선 */
.timeline-horizontal-items {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 40px;
  min-width: 100%;
  width: max-content;
}
.timeline-horizontal-year-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 280px;
  max-width: 320px;
  background: #f5f8fa;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 18px 10px 18px 10px;
  margin-bottom: 0;
  border: 1.5px solid #e0e4ea;
  position: relative;
}
.timeline-horizontal-year-marker {
  min-width: 180px;
  text-align: center;
  font-weight: bold;
  font-size: 1.2em;
  color: #fff;
  background: #2d3a4a;
  border-radius: 20px;
  padding: 8px 16px;
  margin-bottom: 16px;
  margin-right: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  position: sticky;
  top: 0;
  z-index: 2;
}
.timeline-horizontal-item {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    border: 1px solid #e0e4ea;
    padding: 18px 22px 14px 22px;
    min-width: 240px;
    max-width: 240px;
    margin-bottom: 16px;
    font-size: 1em;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    word-break: keep-all;
    transition: box-shadow 0.2s, border-color 0.2s;
    position: relative;
}
.timeline-horizontal-item:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.16);
  border-color: #b0b8c1;
}
.timeline-horizontal-item::before {
  content: '';
  display: block;
  width: 100%;
  height: 4px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(90deg, #4f8cff 0%, #2d3a4a 100%);
  position: absolute;
  top: 0;
  left: 0;
}
.timeline-horizontal-item .card-date {
  font-size: 0.95em;
  color: #888;
  margin-bottom: 4px;
}
.timeline-horizontal-item .card-company {
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 4px;
}
.timeline-horizontal-item .card-type-country {
  font-size: 0.98em;
  margin-bottom: 4px;
}
.timeline-horizontal-item .card-impact {
  font-size: 0.95em;
  margin-bottom: 4px;
}
.timeline-horizontal-item .card-description {
  font-size: 0.97em;
  color: #333;
  margin-top: 6px;
}

/* 연도별 그룹 가운데 정렬 */
.timeline-horizontal-year-group {
  align-items: center;
  text-align: left;
}

.modal-content.modal-content-horizontal {
    width: max-content;
}

#download-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background-color: #eee;
  z-index: 9999;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#download-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3498db, #2980b9);
  transition: width 0.3s ease;
  border-radius: 0;
}

/* Center Progress Modal Styles */
.center-progress-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 0.3s ease;
}

.center-progress-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.center-progress-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.center-progress-content {
  background: white;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  text-align: center;
  min-width: 300px;
  max-width: 400px;
}

.progress-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.center-progress-content h3 {
  margin: 0 0 20px 0;
  color: #2c3e50;
  font-size: 1.3em;
  font-weight: 600;
}

.center-progress-bar-container {
  width: 100%;
  height: 8px;
  background-color: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
  margin: 20px 0;
}

.center-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3498db, #2980b9);
  transition: width 0.3s ease;
  border-radius: 4px;
}

.progress-text {
  margin: 0;
  color: #7f8c8d;
  font-size: 0.95em;
}

.incident-type.other {
  background-color: #b97aff  !important;
  color: #fff !important;
}

/* 정의되지 않은 사고유형(잘못된 값 등)에 대한 fallback 스타일 */
.incident-type:not(.ransomware):not(.data-breach):not(.hacking):not(.supply-chain):not(.vulnerability):not(.system-failure):not(.other),
.filter-tag.incident-type-filter.selected:not(.ransomware):not(.data-breach):not(.hacking):not(.supply-chain):not(.vulnerability):not(.system-failure):not(.other) {
  background-color: #b97aff  !important;
  color: #fff !important;
  border-color: #b97aff  !important;
}