/* PDF檔案瀏覽系統 - 自訂樣式 */

/* 全域樣式 */
body {
    font-family: 'Microsoft JhengHei', 'PingFang TC', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
}

/* 導覽列樣式 */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1030;
}

/* 左側資料夾面板 */
.folder-panel {
    background-color: #ffffff;
    border-right: 1px solid #dee2e6;
}

.folder-list {
    height: calc(100vh - 150px);
    overflow-y: auto;
    padding: 0;
}

/* 資料夾項目樣式 */
.folder-item {
    border-bottom: 1px solid #f1f3f4;
    transition: all 0.2s ease;
}

.folder-item:hover {
    background-color: #f8f9fa;
}

.folder-header {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.folder-header:hover {
    background-color: #e9ecef;
}

.folder-header.active {
    background-color: #e7f3ff;
    border-left: 4px solid #0d6efd;
}

.folder-date {
    font-weight: 600;
    color: #212529;
}

.folder-count {
    font-size: 0.85em;
    color: #6c757d;
}

.folder-icon {
    color: #ffc107;
    margin-right: 8px;
}

.expand-icon {
    transition: transform 0.2s ease;
    color: #6c757d;
}

.expand-icon.expanded {
    transform: rotate(90deg);
}

/* PDF檔案列表 */
.pdf-files {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    max-height: 200px;
    overflow-y: auto;
}

.pdf-file-item {
    padding: 8px 24px;
    cursor: pointer;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
}

.pdf-file-item:hover {
    background-color: #ffffff;
}

.pdf-file-item.active {
    background-color: #d1ecf1;
    border-left: 3px solid #0dcaf0;
}

.pdf-file-item:last-child {
    border-bottom: none;
}

.pdf-icon {
    color: #dc3545;
    margin-right: 8px;
    font-size: 0.9em;
}

.pdf-filename {
    font-size: 0.9em;
    color: #495057;
    word-break: break-word;
}

/* 右側PDF檢視器面板 */
.pdf-viewer-panel {
    background-color: #ffffff;
}

.pdf-viewer-content {
    height: calc(100vh - 112px);
    overflow: auto;
    background-color: #f5f5f5;
    position: relative;
}

/* PDF檢視器容器 */
#pdf-viewer-container {
    display: block;
    padding: 5px;
    min-height: 100%;
    overflow: auto;
    overflow-x: auto;
    overflow-y: auto;
    text-align: center;
    position: relative;
}

#pdf-canvas {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border: 1px solid #dee2e6;
    background-color: white;
    height: auto;
    display: inline-block;
    cursor: move;
    user-select: none;
}

#pdf-canvas:active {
    cursor: move;
}

/* 控制按鈕樣式 */
#pdf-controls button {
    border-radius: 4px;
}

#pdf-controls button:hover {
    background-color: #e9ecef;
}

/* 載入動畫 */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* 滾動條樣式 */
.folder-list::-webkit-scrollbar,
.pdf-files::-webkit-scrollbar,
.pdf-viewer-content::-webkit-scrollbar {
    width: 8px;
}

.folder-list::-webkit-scrollbar-track,
.pdf-files::-webkit-scrollbar-track,
.pdf-viewer-content::-webkit-scrollbar-track {
    background: #f1f3f4;
}

.folder-list::-webkit-scrollbar-thumb,
.pdf-files::-webkit-scrollbar-thumb,
.pdf-viewer-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.folder-list::-webkit-scrollbar-thumb:hover,
.pdf-files::-webkit-scrollbar-thumb:hover,
.pdf-viewer-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .col-md-4 {
        border-bottom: 1px solid #dee2e6;
    }
    
    .folder-list {
        height: 300px;
    }
    
    .pdf-viewer-content {
        height: calc(100vh - 350px);
    }
    
    #pdf-canvas {
        max-width: 95%;
    }
    
    .folder-header {
        padding: 10px 12px;
    }
    
    .pdf-file-item {
        padding: 6px 20px;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .folder-date {
        font-size: 0.9em;
    }
    
    .folder-count {
        font-size: 0.8em;
    }
    
    .pdf-filename {
        font-size: 0.85em;
    }
    
    #pdf-controls button {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* 動畫效果 */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 特殊狀態樣式 */
.today-folder .folder-date {
    color: #0d6efd;
    font-weight: bold;
}

.today-folder .folder-icon {
    color: #0d6efd;
}

/* 錯誤狀態 */
.error-message {
    color: #dc3545;
    font-size: 0.9em;
    padding: 8px 16px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 8px 16px;
}

/* 成功狀態 */
.success-message {
    color: #155724;
    font-size: 0.9em;
    padding: 8px 16px;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin: 8px 16px;
}