/* css/style.css */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    background-color: white;
    padding: 20px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    max-width: 800px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #1a73e8;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}

#pdf-list {
    list-style: none;
    padding: 0;
}

#pdf-list li {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

#pdf-list a {
    text-decoration: none;
    color: #0056b3;
    font-size: 1.1em;
    transition: color 0.3s;
}

#pdf-list a:hover {
    color: #003d82;
    text-decoration: underline;
}

#loader {
    font-size: 1.5em;
    color: #333; /* 可以加深一點顏色，在淺色背景上更清楚 */

    /* --- 新增置中樣式 START --- */
    position: fixed; /* 1. 將其固定在視窗上，脫離排版 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95); /* 2. 加上一個半透明背景，感覺更像讀取畫面 */
    z-index: 2000; /* 3. 確保它在所有元件的最上層 */

    /* 4. 使用 Flexbox 讓文字在覆蓋層中完美置中 */
    display: flex;
    justify-content: center;
    align-items: center;
    /* --- 新增置中樣式 END --- */
}

#flipbook-container {
    width: 90vw;
    height: 90vh;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;

    /* --- 新增置中樣式 START --- */
    display: flex;
    justify-content: center;
    align-items: center;
    /* --- 新增置中樣式 END --- */
}

#flipbook {
    width: 100%;
    height: 100%;
}

#flipbook .page {
    background-color: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
}

#flipbook .shadow {
    -webkit-box-shadow: 0 0 20px rgba(0,0,0,0.4);
    -moz-box-shadow: 0 0 20px rgba(0,0,0,0.4);
    -ms-box-shadow: 0 0 20px rgba(0,0,0,0.4);
    -o-box-shadow: 0 0 20px rgba(0,0,0,0.4);
    box-shadow: 0 0 20px rgba(0,0,0,0.4);
}

/* --- Navbar Styles --- */
#navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}

#navbar button {
    background-color: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 5px;
    font-size: 1.5em;
    width: 50px;
    height: 40px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#navbar button:hover {
    background-color: #555;
}

#navbar button:disabled {
    background-color: #222;
    color: #666;
    cursor: not-allowed;
}

.page-nav {
    color: white;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 10px;
}

#page-number-input {
    width: 60px;
    padding: 5px;
    text-align: center;
    font-size: 1em;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #444;
    color: white;
    /* 隱藏 number input 預設的箭頭 */
    -moz-appearance: textfield;
}

#page-number-input::-webkit-outer-spin-button,
#page-number-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

