/* style.css */
:root {
    --primary-color: #3498db;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --secondary-color: #95a5a6;
    --bg-light: #ecf0f1;
    --text-dark: #2c3e50;
    --card-bg: #ffffff;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans TC', sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    padding: 20px;
}

#app-container {
    max-width: 1400px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-weight: 700;
}

h2 {
    color: var(--text-dark);
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid var(--bg-light);
    padding-bottom: 5px;
}

h3 {
    color: var(--text-dark);
    margin-bottom: 15px;
    font-size: 1.2em;
}

/* --- 卡片樣式 --- */
.card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

/* --- 輸入與按鈕樣式 --- */
.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
}

.input-group input[type="text"],
.input-group input[type="password"],
.input-group input[type="email"],
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.input-row {
    display: flex;
    gap: 20px;
}

.input-row .input-group {
    flex: 1;
}

.input-group.full-width {
    flex: none;
}

.button-group {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.primary-btn, .secondary-btn, .danger-btn, .success-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 700;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
}
.primary-btn:hover { background-color: #2980b9; }

.secondary-btn {
    background-color: var(--secondary-color);
    color: white;
}
.secondary-btn:hover { background-color: #7f8c8d; }

.secondary-btn.teacher-btn {
    background-color: #f39c12;
}
.secondary-btn.teacher-btn:hover {
    background-color: #e67e22;
}

.danger-btn {
    background-color: var(--danger-color);
    color: white;
}
.danger-btn:hover { background-color: #c0392b; }

.success-btn {
    background-color: var(--success-color);
    color: white;
}
.success-btn:hover { background-color: #27ae60; }

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.error-msg {
    color: var(--danger-color);
    font-weight: 700;
    margin-top: 10px;
}

.hidden {
    display: none !important;
}

/* --- 學生結果介面樣式 --- */
.result-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.info-block p {
    margin-bottom: 5px;
    font-size: 1.1em;
}

.result-tasks h2 {
    border: none;
}

/* --- 任務表格樣式 --- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.data-table th, .data-table td {
    border: 1px solid #ddd;
    padding: 12px 15px;
    text-align: left;
}

.data-table th {
    background-color: #f4f4f4;
    font-weight: 700;
    color: var(--text-dark);
}

.data-table td:last-child {
    text-align: center;
}

.data-table .task-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
}

.data-table.small-header th {
    padding: 8px 10px;
    font-size: 0.9em;
}

/* 狀態標籤顏色 */
.status-已認證 { color: var(--success-color); font-weight: 700; }
.status-審核中 { color: var(--primary-color); font-weight: 700; }
.status-認證失敗 { color: var(--danger-color); font-weight: 700; }
.status-未完成 { color: var(--secondary-color); font-weight: 700; }

.comment-status-text {
    font-size: 0.9em;
    color: #34495e;
    margin: 5px 0;
}

/* 學生端操作按鈕 */
.student-action-btn {
    padding: 8px 12px;
    font-size: 0.9em;
    background-color: #34495e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}
.student-action-btn:hover {
    background-color: #2c3e50;
}
.student-action-btn.re-submit {
    background-color: #e67e22;
}
.student-action-btn.re-submit:hover {
    background-color: #d35400;
}

/* --- 教師管理介面樣式 --- */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-content {
    display: grid;
    grid-template-columns: 2fr 1fr; /* 左側表單較寬，右側列表較窄 */
    gap: 20px;
}

.form-card {
    grid-column: 1 / 2;
}

.list-card {
    grid-column: 2 / 3;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* 教師任務表格中的輸入框 */
#tasks-table-admin input[type="text"],
#tasks-table-admin select {
    padding: 5px;
    margin: 0;
    height: auto;
    font-size: 1em;
}

/* --- 留言 Modal 樣式 --- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.4); 
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto; 
    padding: 30px;
    border-radius: 8px;
    width: 80%; 
    max-width: 800px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-btn:hover,
.close-btn:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

.comment-history-area {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 20px;
}

.comment {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    position: relative;
    font-size: 0.95em;
    line-height: 1.4;
}

/* 學生留言 - 淺綠色 */
.comment-student {
    background-color: #e8f5e9; 
    border-left: 5px solid #4caf50;
}

/* 教師留言 - 淺黃色 */
.comment-teacher {
    background-color: #fffde7; 
    border-left: 5px solid #fbc02d;
}

/* 撤回留言 - 淺橙色 */
.comment-recalled {
    background-color: #fff3e0; 
    color: #e65100;
    border-left: 5px solid #ff9800;
    font-style: italic;
}

/* 屏蔽留言 - 淺紅色 */
.comment-blocked {
    background-color: #ffebee; 
    color: var(--danger-color);
    border-left: 5px solid var(--danger-color);
    font-weight: bold;
    text-align: center;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.9em;
    font-weight: bold;
}

.comment-header strong {
    font-size: 1.1em;
}

.comment-actions button {
    padding: 4px 8px;
    margin-left: 5px;
    font-size: 0.8em;
}

.new-comment-area {
    padding-top: 15px;
    border-top: 1px solid #eee;
}

#comment-input {
    width: 100%;
    margin-bottom: 10px;
}
