/* 全局樣式 */
body {
    font-family: 'Microsoft JhengHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

main {
    min-height: calc(100vh - 200px);
}

/* 卡片樣式 */
.card {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: none;
    border-radius: 8px;
    margin-bottom: 20px;
}

.card-header {
    background-color: #fff;
    border-bottom: 2px solid #f0f0f0;
    font-weight: 600;
}

/* 表格樣式 */
.table {
    background-color: white;
}

.table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

/* 按鈕樣式 */
.btn {
    border-radius: 5px;
    padding: 8px 16px;
}

/* 拖曳分組樣式 */
.drag-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.student-pool,
.group-container {
    flex: 1;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 400px;
}

.group-box {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    min-height: 150px;
}

.group-box.active {
    border-color: #0d6efd;
    background-color: #e7f1ff;
}

.student-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 8px;
    cursor: move;
    transition: all 0.3s ease;
}

.student-item:hover {
    background: #f0f0f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.student-item.dragging {
    opacity: 0.5;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
}

.group-title {
    font-weight: 600;
    font-size: 1.1em;
    color: #333;
}

.student-count {
    background: #0d6efd;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9em;
}

/* 查詢結果樣式 */
.query-result {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.schedule-table {
    width: 100%;
    margin-top: 20px;
}

.schedule-table th {
    background-color: #0d6efd;
    color: white;
    text-align: center;
    padding: 12px;
}

.schedule-table td {
    text-align: center;
    padding: 10px;
    border: 1px solid #dee2e6;
}

/* 檔案上傳區域 */
.upload-area {
    border: 2px dashed #0d6efd;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    background-color: #e7f1ff;
    border-color: #0a58ca;
}

.upload-area i {
    font-size: 48px;
    color: #0d6efd;
    margin-bottom: 15px;
}

/* Alert 樣式 */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Badge 樣式 */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
}

/* 導航列樣式 */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.3em;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .drag-container {
        flex-direction: column;
    }

    .stats-card {
        margin-bottom: 15px;
    }
}

/* Loading spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* 表單樣式 */
.form-label {
    font-weight: 500;
    color: #333;
}

.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* 模態框樣式 */
.modal-header {
    background-color: #0d6efd;
    color: white;
}

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