/**
 * NJZ 법적분쟁 타임라인 프론트엔드 스타일
 */

/* 전체 래퍼 */
.njz-law-timeline-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* 타임라인 제목 */
.njz-law-timeline-title {
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    margin: 20px 0 30px;
    color: #111;
}

/* 필터 버튼 */
.njz-law-main-tabs {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin: 30px 0 20px;
    flex-wrap: wrap;
}

.njz-law-tab-btn {
    background: #111;
    color: white;
    border-radius: 20px;
    padding: 10px 20px;
    border: none;
    font-size: 15px;
    cursor: pointer;
    width: 110px;
    text-align: center;
    transition: background-color 0.3s ease;
}

.njz-law-tab-btn:hover {
    background: #444;
}

.njz-law-tab-btn.active {
    background: #333;
}

/* 드롭다운 버튼 */
.njz-law-mode-controls {
    margin: 20px 0 30px;
}

.njz-law-mode-group {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.njz-law-mode-group.njz-law-hidden {
    display: none;
}

/* 기본 모드 그룹 버튼 스타일 */
.njz-law-mode-group button {
    background: #111;
    color: white;
    border-radius: 20px;
    padding: 6px 14px;
    border: none;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.njz-law-mode-group button:hover {
    background: #444;
}

.njz-law-mode-group button.active {
    background: #444;
}

/* 카테고리 모드 그룹 버튼 스타일 (연도별과 같은 스타일로 통일) */
#njz-law-category-buttons button {
    background: #111;
    color: white;
    border-radius: 20px;
    padding: 6px 14px;
    border: none;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#njz-law-category-buttons button:hover {
    background: #444;
}

#njz-law-category-buttons button.active {
    background: #444;
}

/* 타임라인 법적 사건 */
.njz-law-year-header {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin: 40px 0 10px;
    color: #111;
}

.njz-law-event-box {
    background: #f7f7f7;
    padding: 20px 24px;
    margin: 12px auto;
    border-radius: 10px;
    max-width: 1200px;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.njz-law-event-box:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.njz-law-category-label {
    display: inline-block;
    height: 26px;
    line-height: 26px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid;
    border-radius: 999px;
    vertical-align: middle;
    margin-bottom: 12px;
}

.njz-law-event-title {
    font-size: 20px;
    font-weight: bold;
    color: #111;
}

.njz-law-event-desc {
    font-size: 16px;
    color: #111;
    margin-top: 8px;
}

.njz-law-event-date {
    font-size: 12px;
    color: #888;
    margin-top: 10px;
    text-align: right;
}

/* 모달 스타일 - 수정된 부분 */
.njz-law-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.7);
    z-index: 9998;
    display: flex;
    justify-content: center;
    align-items: center;
}

.njz-law-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.njz-law-modal-content {
    background: white;
    padding: 30px 30px 20px; /* 하단 패딩 축소 */
    border-radius: 8px;
    max-width: 1200px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    box-sizing: border-box;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.njz-law-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #888;
    transition: color 0.3s ease;
    z-index: 10;
}

.njz-law-modal-close:hover {
    color: #111;
}

/* 모달 헤더 */
.njz-law-modal-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.njz-law-modal-title {
    font-size: 26px;
    font-weight: bold;
    color: #111;
    margin: 0 0 5px;
}

.njz-law-modal-subtitle {
    font-size: 18px;
    color: #666;
    margin: 8px 0 15px;
    font-weight: normal;
}

.njz-law-modal-meta {
    font-size: 14px;
    color: #888;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.njz-law-modal-category {
    font-weight: 500;
}

/* 모달 바디 - 푸터 제거로 인한 마진 조정 */
.njz-law-modal-body {
    margin: 20px 0 0; /* 하단 마진 제거 */
    line-height: 1.6;
    color: #333;
}

.njz-law-modal-image-container {
    margin-bottom: 20px;
    text-align: center;
}

.njz-law-modal-image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.njz-law-modal-youtube-container {
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 비율 */
    height: 0;
    overflow: hidden;
}

.njz-law-modal-youtube-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.njz-law-modal-content-text {
    font-size: 17px;
    color: #000;
}

.njz-law-modal-content-text p {
    margin-bottom: 15px;
}

/* 📸 워드프레스 이미지 정렬 지원 - 수정된 부분 */
.njz-law-modal-content-text img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 10px auto;
    display: block;
}

/* 워드프레스 정렬 클래스 지원 */
.njz-law-modal-content-text .aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.njz-law-modal-content-text .alignleft {
    float: left;
    margin: 10px 20px 10px 0;
}

.njz-law-modal-content-text .alignright {
    float: right;
    margin: 10px 0 10px 20px;
}

/* 텍스트 정렬이 적용된 단락의 이미지도 지원 */
.njz-law-modal-content-text p[style*="text-align: center"] img,
.njz-law-modal-content-text div[style*="text-align: center"] img {
    margin-left: auto;
    margin-right: auto;
    display: block;
}

.njz-law-modal-content-text p[style*="text-align: left"] img,
.njz-law-modal-content-text div[style*="text-align: left"] img {
    margin-left: 0;
    margin-right: auto;
}

.njz-law-modal-content-text p[style*="text-align: right"] img,
.njz-law-modal-content-text div[style*="text-align: right"] img {
    margin-left: auto;
    margin-right: 0;
}

.njz-law-modal-content-text h1, 
.njz-law-modal-content-text h2, 
.njz-law-modal-content-text h3,
.njz-law-modal-content-text h4,
.njz-law-modal-content-text h5,
.njz-law-modal-content-text h6 {
    margin: 20px 0 10px;
    color: #111;
}

.njz-law-modal-content-text ul, 
.njz-law-modal-content-text ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.njz-law-modal-content-text blockquote {
    border-left: 3px solid #ddd;
    padding-left: 15px;
    margin-left: 0;
    color: #666;
    font-style: italic;
}

/* 반응형 임베드 */
.njz-law-responsive-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 비율 */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin-bottom: 20px;
}

.njz-law-responsive-embed iframe,
.njz-law-responsive-embed object,
.njz-law-responsive-embed embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* 모달 푸터 - 모든 버튼이 숨겨져서 푸터도 숨김 */
.njz-modal-footer {
    display: none !important;
}

/* 모달 버튼 스타일 (사용 안 함)
.njz-modal-button {
    padding: 10px 20px;
    font-size: 14px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.njz-modal-button:hover {
    background: #2980b9;
}
*/

/* PDF 버튼과 SNS 공유 버튼 모두 숨기기 */
#njz-modal-download,
.njz-modal-download {
    display: none !important;
}

.njz-modal-share {
    display: none !important;
}

/* SNS 공유 관련 스타일들 (사용 안 함)
.njz-share-label {
    font-size: 14px;
    color: #666;
}

.njz-modal-share a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f0f0;
    color: #333;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.njz-modal-share a:hover {
    background: #ddd;
}

.njz-share-twitter:hover {
    background: #1DA1F2 !important;
    color: white !important;
}

.njz-share-facebook:hover {
    background: #4267B2 !important;
    color: white !important;
}

.njz-share-link:hover {
    background: #333 !important;
    color: white !important;
}
*/

/* PDF 컨테이너 스타일 개선 */
.njz-pdf-container {
    width: 210mm; /* A4 너비 */
    max-width: 210mm;
    margin: 0 auto;
    padding: 20mm;
    background: white;
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #333;
    line-height: 1.6;
}

.njz-pdf-content {
    width: 100%;
}

.njz-pdf-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.njz-pdf-header h1 {
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 10px;
    color: #111;
    line-height: 1.3;
}

.njz-pdf-header h3 {
    font-size: 18px;
    color: #666;
    margin: 0 0 15px;
    font-weight: normal;
    line-height: 1.4;
}

.njz-pdf-meta {
    font-size: 14px;
    color: #888;
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: center;
}

.njz-pdf-meta span {
    display: inline-block;
}

#njz-pdf-category {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.njz-pdf-body {
    line-height: 1.8;
    margin: 30px 0;
}

.njz-pdf-image-container {
    margin: 20px 0;
    text-align: center;
}

.njz-pdf-image-container img {
    max-width: 100%;
    height: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#njz-pdf-content {
    font-size: 14px;
    line-height: 1.8;
    color: #333;
}

#njz-pdf-content p {
    margin-bottom: 15px;
    text-align: justify;
}

#njz-pdf-content h1,
#njz-pdf-content h2,
#njz-pdf-content h3,
#njz-pdf-content h4,
#njz-pdf-content h5,
#njz-pdf-content h6 {
    margin: 20px 0 10px;
    color: #111;
    line-height: 1.4;
}

#njz-pdf-content h1 { font-size: 22px; }
#njz-pdf-content h2 { font-size: 20px; }
#njz-pdf-content h3 { font-size: 18px; }
#njz-pdf-content h4 { font-size: 16px; }
#njz-pdf-content h5 { font-size: 14px; }
#njz-pdf-content h6 { font-size: 14px; }

#njz-pdf-content ul,
#njz-pdf-content ol {
    margin: 10px 0 15px 20px;
}

#njz-pdf-content li {
    margin-bottom: 5px;
}

#njz-pdf-content blockquote {
    border-left: 3px solid #ddd;
    padding-left: 15px;
    margin: 15px 0;
    color: #666;
    font-style: italic;
}

#njz-pdf-content img {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
}

#njz-pdf-content a {
    color: #3498db;
    text-decoration: underline;
}

#njz-pdf-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

#njz-pdf-content table th,
#njz-pdf-content table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

#njz-pdf-content table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.njz-pdf-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 12px;
    color: #888;
}

.njz-pdf-footer p {
    margin: 0;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .njz-timeline-title {
        font-size: 24px;
    }
    
    .njz-main-tabs {
        gap: 6px;
    }
    
    .njz-tab-btn {
        padding: 6px 12px;
        font-size: 13px;
        width: 85px;
    }
    
    .njz-law-event-box {
        padding: 16px 20px;
    }
    
    .njz-law-event-title {
        font-size: 18px;
    }
    
    .njz-law-event-desc {
        font-size: 14px;
    }
    
    .njz-law-modal-content {
        padding: 20px 20px 15px; /* 모바일에서도 하단 패딩 축소 */
        width: 95%;
    }
    
    .njz-law-modal-title {
        font-size: 22px;
    }
    
    .njz-law-modal-subtitle {
        font-size: 16px;
    }
    
    /* 모달 푸터 숨김으로 반응형 스타일 불필요 */
}

/* 애니메이션 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.njz-law-modal-overlay,
.njz-law-modal {
    animation: fadeIn 0.3s ease-out;
}

.njz-law-modal-content {
    animation: slideUp 0.3s ease-out;
}

/* 카테고리별 색상 - 클래스는 동적으로 생성됨 */
/* 기본 스타일은 위에서 .njz-modal-category로 정의됨 */

/* 이벤트 없을 경우 메시지 */
.njz-law-no-events {
    text-align: center;
    padding: 40px 0;
    color: #666;
    font-size: 18px;
}

/* 정렬 컨트롤 스타일 */
.njz-law-sort-controls {
    position: absolute;
    top: 10px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.njz-law-sort-label {
    font-size: 14px;
    color: #555;
}

.njz-law-sort-btn {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.njz-law-sort-btn:hover {
    background: #e0e0e0;
}

.njz-law-sort-btn.active {
    background: #333;
    color: white;
    border-color: #333;
}

.njz-law-timeline-container {
    position: relative;
    padding-top: 50px; /* 정렬 컨트롤을 위한 여백 */
}

/* 타임라인 이벤트 스타일 */
.njz-law-timeline-events {
    position: relative;
    margin-top: 20px;
}

/* 연도 헤더 스타일 */
.njz-law-year-header {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin: 40px 0 10px;
    color: #111;
    position: relative;
    z-index: 2;
}

.njz-law-timeline-events .njz-law-year-header:first-child {
    margin-top: 0;
}

/* 이벤트 박스 스타일 (기존 스타일 그대로 유지) */
.njz-law-event-box {
    background: #f7f7f7;
    padding: 20px 24px;
    margin: 12px auto;
    border-radius: 10px;
    max-width: 1200px;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.njz-law-event-box:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 반응형 스타일 */
@media (max-width: 768px) {
    .njz-law-tab-btn {
        padding: 6px 12px;
        font-size: 12px;
        width: 80px;
    }
	
	.njz-law-mode-group {
		padding: 6px 12px;
        font-size: 12px;
	}
	
	#njz-law-category-buttons {
		padding: 6px 12px;
        font-size: 12px;
	}
	
    .njz-law-sort-controls {
        top: 5px;
        right: 10px;
    }
    
    .njz-law-sort-label {
        font-size: 12px;
    }
    
    .njz-law-sort-btn {
        padding: 4px 10px;
        font-size: 12px;
    }
    
    .njz-law-timeline-container {
        padding-top: 40px;
    }
    
    .njz-law-year-header {
        font-size: 20px;
        margin: 30px 0 8px;
    }
}

/* 애니메이션 */
.njz-law-timeline-container.changing {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

/* PDF 인쇄용 미디어 쿼리 */
@media print {
    .njz-pdf-container {
        padding: 10mm;
    }
    
    .njz-pdf-header {
        page-break-after: avoid;
    }
    
    .njz-pdf-image-container {
        page-break-inside: avoid;
    }
    
    #njz-pdf-content p {
        orphans: 3;
        widows: 3;
    }
    
    #njz-pdf-content h1,
    #njz-pdf-content h2,
    #njz-pdf-content h3,
    #njz-pdf-content h4,
    #njz-pdf-content h5,
    #njz-pdf-content h6 {
        page-break-after: avoid;
    }
}