/* ========================================
   노트 열기 모달 시스템 v1.0
   Created: 2026-03-16
   목업 이미지 기반 설계
   ======================================== */

/* ===== 모달 배경 (블러 효과) ===== */
.note-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    display: none;
    animation: fadeIn 0.2s ease-out;
}

.note-modal-overlay.show {
    display: block;
}

/* ===== 모달 컨테이너 ===== */
.note-modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1200px;
    height: 85vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

.note-modal-container.show {
    display: flex;
}

/* ===== 모달 헤더 (탭 영역) ===== */
.note-modal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #FAFAFA;
    border-bottom: 1px solid #E5E5E5;
    flex-shrink: 0;
}

.note-modal-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
}

.note-modal-tabs::-webkit-scrollbar {
    height: 4px;
}

.note-modal-tabs::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 2px;
}

/* ===== 탭 아이템 ===== */
.note-modal-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-size: 14px;
    color: #737373;
    max-width: 200px;
}

.note-modal-tab:hover {
    background: #F5F5F5;
    border-color: #D1D5DB;
}

.note-modal-tab.active {
    background: #1E3A8A;
    color: white;
    border-color: #1E3A8A;
}

.note-modal-tab-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-modal-tab-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: all 0.2s;
}

.note-modal-tab:hover .note-modal-tab-close {
    opacity: 1;
}

.note-modal-tab.active .note-modal-tab-close {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

.note-modal-tab-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

.note-modal-tab.active .note-modal-tab-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== 새 탭 버튼 ===== */
.note-modal-new-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: white;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.note-modal-new-tab:hover {
    background: #1E3A8A;
    border-color: #1E3A8A;
    color: white;
}

.note-modal-new-tab .icon {
    width: 18px;
    height: 18px;
}

/* ===== 닫기 버튼 ===== */
.note-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: white;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.note-modal-close:hover {
    background: #FEE2E2;
    border-color: #FCA5A5;
    color: #DC2626;
}

.note-modal-close .icon {
    width: 18px;
    height: 18px;
}

/* ===== 모달 본문 (iframe 영역) ===== */
.note-modal-body {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.note-modal-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: none;
}

.note-modal-iframe.active {
    display: block;
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* ===== 반응형 (태블릿) ===== */
@media (max-width: 1024px) {
    .note-modal-container {
        width: 95%;
        height: 90vh;
    }
    
    .note-modal-tab {
        max-width: 150px;
    }
}

/* ===== 반응형 (모바일 - 숨김) ===== */
@media (max-width: 768px) {
    .note-modal-overlay,
    .note-modal-container {
        display: none !important;
    }
}
