body {
    font-family: 'Kanit', sans-serif;
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}
.form-container, .welcome-container {
    background-color: #fff;
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
   top: 30%;
  left: 40%;
  position: absolute;
  margin: -25px 0 0 -25px; 
     
}
h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}
.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}
button {
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}
button:hover {
    background-color: #0056b3;
}
.message {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    text-align: center;
}
.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.form-link {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9em;
}

/* Welcome Page */
.welcome-container {
    text-align: center;
}
.logout-button {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #dc3545;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
}
/* ======== Phase 2 Styles ======== */

/* Dashboard Layout */
body {
    height: auto;
    min-height: 100vh;
    display: block;
}
.dashboard-header {
    background-color: #fff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.dashboard-header h1 {
    margin: 0;
    font-size: 1.5em;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}
.dashboard-container {
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
}
.card {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}
.card h2 {
    margin-top: 0;
    text-align: left;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
.topic-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: 'Kanit', sans-serif;
}
.button {
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.9em;
}
.button.primary { background-color: #007bff; color: white; }
.button.secondary { background-color: #6c757d; color: white; }
.button:disabled { background-color: #e9ecef; color: #6c757d; cursor: not-allowed;}

/* Teacher Topic List */
.topic-list .topic-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}
.topic-list .topic-item:last-child {
    border-bottom: none;
}
.topic-info h3 { margin: 0 0 5px 0; }
.topic-info p { margin: 0; color: #666; font-size: 0.9em; }
.topic-actions { display: flex; gap: 10px; }
.status-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}
.status-active { background-color: #d4edda; color: #155724; }
.status-archived { background-color: #e9ecef; color: #495057; }


/* Student Topic Grid */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
a.topic-card-link { text-decoration: none; color: inherit; }
.topic-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 20px;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}
.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.topic-card h3 { margin: 0 0 10px 0; color: #0056b3; }
.topic-card p { margin: 0 0 15px 0; font-size: 0.95em; color: #495057; }
.topic-card small { font-size: 0.8em; color: #6c757d; }

/* Topic View */
.topic-description { font-size: 1.1em; color: #555; margin-top: -15px; margin-bottom: 30px; }
.post-it-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 10px 0;
}
.post-it {
    background-color: #fff799;
    width: 280px;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}
.post-content { flex-grow: 1; }
.post-footer {
    border-top: 1px solid #eadd8a;
    padding-top: 8px;
    margin-top: 10px;
}
/* ======== Phase 3 Styles ======== */
.post-it.teacher-view {
    background-color: #e9f5ff; /* สีฟ้าอ่อนสำหรับมุมมองครู */
}
.give-score-btn {
    width: 100%;
    padding: 8px;
    margin-top: 10px;
    background-color: #28a745;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}
.give-score-btn:hover:not(:disabled) {
    background-color: #218838;
}
.give-score-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

.score-display {
    background-color: #ffc107;
    color: #333;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 500;
    margin-right: 15px;
}
#total-score {
    font-weight: bold;
}
/* ======== Phase 4 Styles ======== */

/* ปุ่ม Success (สีเขียว) */
.button.success {
    background-color: #28a745;
    color: white;
}
.button.success:hover {
    background-color: #218838;
}

/* ตารางรายงาน */
.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.report-table th, .report-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}
.report-table thead th {
    background-color: #f8f9fa;
    font-weight: 500;
    color: #333;
}
.report-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}
.report-table tbody tr:hover {
    background-color: #f1f1f1;
}
.report-table td:first-child, .report-table td:last-child, .report-table td:nth-child(3) {
    text-align: center;
}
/* Style for displaying student's own post */
.your-post {
    background-color: #e9f5ff;
    border: 1px solid #b8d9f3;
    border-left: 5px solid #007bff;
    padding: 15px;
    margin-top: 10px;
    border-radius: 4px;
}
.your-post p {
    margin: 0;
    font-size: 1.05em;
    color: #333;
}
hr.section-divider {
    border: 0;
    height: 1px;
    background-color: #eee;
    margin: 40px 0;
}
/* Style for room tag on post-it */
.room-tag {
    color: #555;
    font-size: 0.9em;
    font-style: italic;
    margin-left: 5px;
}