/* =========================================
   文件管理系統 - 自訂樣式
   Document Management System - Custom Styles
   ========================================= */

/* 基礎樣式 */
:root {
    --site-bg: #333333;
    --area-color: #1a237e;
    --button-color: #001f3f;
    --text-dark: #212121;
    --text-light: #ffffff;
    --gold: #ffd700;
    --border-dark: #424242;
}

body {
    font-family: 'Microsoft JhengHei', 'Noto Sans TC', 'PingFang TC', sans-serif;
    background-color: #f5f5f5;
    color: var(--text-dark);
    min-height: 100vh;
}

/* 登入頁面 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 700;
}

/* 區域樣式 */
.area-block {
    margin-bottom: 40px;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.area-header {
    background: #e9ecef;
    border: 2px solid var(--area-color);
    border-left-width: 8px;
    padding: 15px 20px;
    margin-bottom: 0;
}

.area-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #000;
    margin: 0;
}

.area-description {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-top: 8px;
    margin-bottom: 0;
}

.area-spacer {
    height: 15px;
    background: transparent;
}

/* 表格樣式 */
.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.doc-table thead th {
    background: var(--area-color);
    color: var(--gold);
    font-weight: 600;
    padding: 12px 15px;
    text-align: left;
    border: 1px solid #424242;
}

.doc-table tbody td {
    padding: 12px 15px;
    border: 1px solid #424242;
    background: white;
    vertical-align: top;
}

.doc-table tbody tr:hover td {
    background: #f8f9fa;
}

/* 搜尋區塊 */
.search-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.filter-btn {
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.filter-btn.active {
    box-shadow: 0 0 0 3px rgba(0,0,0,0.2);
}

/* 檔案連結 */
.file-link {
    display: inline-block;
    padding: 3px 10px;
    margin: 2px;
    background: #e3f2fd;
    color: #1565c0;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.file-link:hover {
    background: #1565c0;
    color: white;
}

/* 後台管理區塊 */
.admin-section {
    background: #263238;
    color: white;
    padding: 30px;
    margin-top: 50px;
    border-radius: 8px;
}

.admin-section h3 {
    color: #ffd700;
    border-bottom: 2px solid #ffd700;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.admin-card {
    background: #37474f;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.admin-card h5 {
    color: #80cbc4;
    margin-bottom: 15px;
}

/* 設定面板 */
.settings-panel {
    background: #455a64;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.color-preset-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    margin: 5px;
    transition: all 0.3s ease;
}

.color-preset-btn:hover,
.color-preset-btn.active {
    border-color: white;
    transform: scale(1.1);
}

.color-preset-btn.black { background: #000000; }
.color-preset-btn.dark-gray { background: #424242; }
.color-preset-btn.grass-green { background: #4caf50; }
.color-preset-btn.sky-blue { background: #2196f3; }
.color-preset-btn.orange-red { background: #ff5722; }

.color-preset-btn.deep-blue { background: #1a237e; }
.color-preset-btn.red { background: #c62828; }
.color-preset-btn.purple { background: #6a1b9a; }
.color-preset-btn.orange { background: #e65100; }
.color-preset-btn.gray-50 { background: #9e9e9e; }

.color-preset-btn.navy-blue { background: #001f3f; }
.color-preset-btn.green { background: #2e7d32; }
.color-preset-btn.bright-purple { background: #aa00ff; }
.color-preset-btn.orange-yellow { background: #ff9800; }
.color-preset-btn.gray-70 { background: #616161; }

/* 資料列表 */
.data-list {
    max-height: 300px;
    overflow-y: auto;
}

.data-item {
    background: #546e7a;
    border-radius: 6px;
    padding: 12px 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.data-item:hover {
    background: #607d8b;
}

/* Modal 樣式 */
.modal-header {
    background: #1a237e;
    color: white;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* 響應式 */
@media (max-width: 768px) {
    .doc-table {
        font-size: 0.85rem;
    }
    
    .doc-table thead th,
    .doc-table tbody td {
        padding: 8px 10px;
    }
    
    .area-title {
        font-size: 1.2rem;
    }
}

/* 網站主題色 */
body.theme-black { background-color: #000000; }
body.theme-dark-gray { background-color: #424242; }
body.theme-grass-green { background-color: #4caf50; }
body.theme-sky-blue { background-color: #2196f3; }
body.theme-orange-red { background-color: #ff5722; }

/* 按鈕主題色 */
.btn-theme-navy-blue { background-color: #001f3f !important; border-color: #001f3f !important; color: white !important; }
.btn-theme-green { background-color: #2e7d32 !important; border-color: #2e7d32 !important; color: white !important; }
.btn-theme-bright-purple { background-color: #aa00ff !important; border-color: #aa00ff !important; color: white !important; }
.btn-theme-orange-yellow { background-color: #ff9800 !important; border-color: #ff9800 !important; color: white !important; }
.btn-theme-gray-70 { background-color: #616161 !important; border-color: #616161 !important; color: white !important; }

/* 管理員入口按鈕 */
.admin-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

/* 滾動條美化 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 標籤樣式 */
.tag-badge {
    display: inline-block;
    padding: 2px 8px;
    margin: 2px;
    background: #e8eaf6;
    color: #3949ab;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* 類型標籤 */
.type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.type-badge.sign { background: #e3f2fd; color: #1565c0; }
.type-badge.contract { background: #fce4ec; color: #c2185b; }
.type-badge.stamp { background: #f3e5f5; color: #7b1fa2; }
.type-badge.purchase { background: #e8f5e9; color: #2e7d32; }
.type-badge.other { background: #fff3e0; color: #e65100; }

/* 說明文字截斷 */
.desc-text {
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.desc-text:hover {
    white-space: normal;
    overflow: visible;
}
