/**
 * NobleHR 파일 뷰어 스타일
 */

/* 모달 배경 */
.file-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* 뷰어 컨테이너 */
.file-viewer-container {
    width: 95vw;
    height: 95vh;
    background: #ffffff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 상단 툴바 */
.file-viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

.toolbar-left,
.toolbar-center,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toolbar-center {
    flex: 1;
    justify-content: center;
}

.viewer-filename {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    display: flex;
    align-items: center;
}

.btn-toolbar {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    color: #495057;
    font-size: 0.875rem;
}

.btn-toolbar:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.btn-toolbar:active {
    transform: scale(0.95);
}

.page-info,
.zoom-info {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

/* 뷰어 컨텐츠 */
.file-viewer-content {
    flex: 1;
    overflow: auto;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* 이미지 뷰어 */
.viewer-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* PDF 캔버스 */
.pdf-canvas {
    display: block;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    background: white;
}

/* Word/문서 뷰어 */
.document-viewer {
    max-width: 900px;
    width: 100%;
    background: white;
    padding: 3rem;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    min-height: 100%;
}

.document-viewer p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.document-viewer img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
}

.document-viewer table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.document-viewer table td,
.document-viewer table th {
    border: 1px solid #dee2e6;
    padding: 0.5rem;
}

/* Excel 뷰어 */
.excel-viewer {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 4px;
    overflow: hidden;
}

.sheet-tabs {
    display: flex;
    gap: 0;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    padding: 0 1rem;
    flex-shrink: 0;
}

.sheet-tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.2s;
}

.sheet-tab:hover {
    color: #495057;
    background: rgba(0, 0, 0, 0.02);
}

.sheet-tab.active {
    color: var(--primary, #007bff);
    border-bottom-color: var(--primary, #007bff);
    background: white;
}

.sheet-content {
    flex: 1;
    overflow: auto;
    padding: 1rem;
}

.sheet-table {
    display: none;
}

.sheet-table.active {
    display: block;
}

.excel-table {
    width: auto !important;
    font-size: 0.875rem;
    background: white;
}

.excel-table th {
    background: #f8f9fa;
    font-weight: 600;
    white-space: nowrap;
}

.excel-table td,
.excel-table th {
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
}

/* Office iframe */
.office-iframe {
    width: 100%;
    height: calc(95vh - 120px);
    border: none;
    border-radius: 4px;
}

/* 텍스트 뷰어 */
.text-viewer {
    width: 100%;
    max-width: 1200px;
    background: white;
    padding: 2rem;
    margin: 0 auto;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #212529;
    overflow: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 로딩 스피너 */
.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

/* 반응형 */
@media (max-width: 768px) {
    .file-viewer-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
    
    .file-viewer-toolbar {
        padding: 0.5rem 1rem;
    }
    
    .viewer-filename {
        font-size: 0.875rem;
    }
    
    .btn-toolbar {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .toolbar-center .btn-toolbar {
        padding: 0.3rem 0.6rem;
    }
    
    .page-info,
    .zoom-info {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .document-viewer {
        padding: 1.5rem;
    }
    
    .excel-viewer {
        font-size: 0.75rem;
    }
    
    .sheet-tab {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

/* 다크모드 대응 (선택사항) */
@media (prefers-color-scheme: dark) {
    .file-viewer-container {
        background: #1a1a1a;
    }
    
    .file-viewer-toolbar {
        background: #2d2d2d;
        border-bottom-color: #404040;
    }
    
    .viewer-filename {
        color: #e9ecef;
    }
    
    .btn-toolbar {
        background: #404040;
        border-color: #555;
        color: #e9ecef;
    }
    
    .btn-toolbar:hover {
        background: #505050;
        border-color: #666;
    }
    
    .file-viewer-content {
        background: #1a1a1a;
    }
    
    .document-viewer,
    .text-viewer,
    .excel-viewer {
        background: #2d2d2d;
        color: #e9ecef;
    }
}
