/* 如果需要，可以在此处添加其他样式 */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column; /* 垂直排列子元素 */
    min-height: 100vh; /* 确保body至少占据整个视口高度 */
    position: relative; /* 用于语言切换器定位 */
}
.language-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}
.language-switcher select {
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: #fff;
    font-size: 1em;
    cursor: pointer;
}
.language-switcher select:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 0 2px rgba(0, 86, 179, 0.2);
}
.main-wrapper {
    display: flex;
    justify-content: center; /* 水平居中 */
    align-items: flex-start; /* 顶部对齐 */
    flex-grow: 1; /* 允许其填充可用空间 */
    width: 100%;
}

.countdown-section {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.countdown-section h3 {
    color: #003366;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.countdown-timer {
    font-size: 1.5em;
    font-weight: bold;
    color: #d9534f; /* Bootstrap danger color */
    font-family: 'Courier New', Courier, monospace;
}

.container {
    width: 100%;
    max-width: 800px;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 0 auto; /* 水平居中容器 */
}
h1 {
    color: #003366;
    text-align: center;
    border-bottom: 2px solid #003366;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
ul {
    list-style-type: none;
    padding: 0;
}
li {
    background-color: #f9f9f9;
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 5px;
    border-left: 5px solid #0056b3;
    transition: transform 0.2s, box-shadow 0.2s;
}
li:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
a {
    text-decoration: none;
    color: #0056b3;
    font-weight: bold;
    font-size: 1.1em;
}
p {
    margin: 5px 0 0;
    color: #666;
}

.page-switcher {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column; /* Default: stack vertically for desktop */
    gap: 10px;
}

.page-switcher a {
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: #fff;
    font-size: 1em;
    cursor: pointer;
    text-decoration: none;
    color: #0056b3;
    white-space: nowrap; /* 防止文字換行 */
}


/* Home button styles for calendar.html */
.home-button-container {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.home-button {
    padding: 8px 16px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: #fff;
    font-size: 1em;
    cursor: pointer;
    text-decoration: none;
    color: #0056b3;
    transition: background-color 0.2s;
    display: inline-block;
    white-space: nowrap;
}

.home-button:hover {
    background-color: #e9ecef;
}

/* Chat Widget Styles */
#chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    max-width: 90%;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 2000;
}

#chat-header {
    background-color: #0056b3;
    color: white;
    padding: 10px 15px;
    font-weight: bold;
    cursor: pointer;
}

#chat-body {
    height: 300px;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: #f9f9f9;
}

.message {
    padding: 8px 12px;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
}

.message.user {
    background-color: #007bff;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 3px;
}

.message.ai {
    background-color: #e9ecef;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 3px;
}

#chat-input-container {
    display: flex;
    border-top: 1px solid #ccc;
}

#chat-input {
    flex-grow: 1;
    border: none;
    padding: 15px;
    outline: none;
}

#chat-send-btn {
    background-color: #0056b3;
    color: white;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#chat-send-btn:hover {
    background-color: #004494;
}

#chat-widget.chat-collapsed #chat-body,
#chat-widget.chat-collapsed #chat-input-container {
    display: none;
}

/* Media Query for Mobile Devices */
@media (max-width: 768px) {
    .page-switcher {
        flex-direction: row; /* Arrange buttons side-by-side on mobile */
    }

    #chat-widget.chat-collapsed {
        width: 40px;
    }

    /* Countdown page mobile styles */
    .countdown-section {
        width: 100%; /* 在手機上讓倒數計時區塊佔滿寬度 */
    }

    /* Calendar page mobile styles */
    .calendar-container {
        overflow-x: auto; /* 在手機上啟用水平滾動 */
    }

    #calendar-grid {
        min-width: 700px; /* 設定月曆網格的最小寬度，防止其被壓縮 */
    }
}
