/* --- TEACHER PORTAL SPECIFIC STYLES --- */

/* style.css - Professional Dashboard Theme */
:root {
    --primary: #4a90e2;
    --success: #2ecc71;
    --warning: #f1c40f;
    --danger: #e74c3c;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --bg: #f4f6f9;
}

body {
    font-family: 'Segoe UI', 'Roboto', Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    margin: 0;
    padding: 0;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 40px auto;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

/* Auth Screens */
.hidden { display: none !important; }
h2 { color: var(--dark); margin-top: 0; }
input, select, textarea {
    width: 100%; padding: 12px; margin: 8px 0;
    border: 1px solid #ddd; border-radius: 6px;
    font-size: 14px; box-sizing: border-box;
    transition: border 0.3s;
}
input:focus, textarea:focus { border-color: var(--primary); outline: none; }
button {
    background-color: var(--primary); color: white;
    padding: 12px 20px; border: none; border-radius: 6px;
    cursor: pointer; font-size: 15px; font-weight: 600;
    transition: background 0.2s;
}
button:hover { background-color: #357abd; }

/* --- DASHBOARD HEADER & STATS --- */
.dashboard-header {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 2px solid #f0f0f0; padding-bottom: 20px; margin-bottom: 25px;
}
.profile-info h1 { font-size: 24px; margin: 0; color: var(--dark); }
.profile-badges span {
    background: #e1e8ed; color: #555; padding: 4px 10px;
    border-radius: 20px; font-size: 12px; font-weight: bold; margin-right: 5px;
}

.stats-container {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 30px;
}
.stat-card {
    background: white; padding: 20px; border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); text-align: center;
    border-top: 4px solid #ccc;
}
.stat-card h3 { margin: 0; font-size: 32px; color: var(--dark); }
.stat-card p { margin: 5px 0 0; color: #777; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; }

.stat-total { border-color: var(--primary); }
.stat-total h3 { color: var(--primary); }

.stat-pending { border-color: var(--warning); }
.stat-pending h3 { color: var(--warning); }

.stat-done { border-color: var(--success); }
.stat-done h3 { color: var(--success); }

/* --- TASK CARDS --- */
.task-card {
    background: white; border-radius: 8px; padding: 20px;
    margin-bottom: 20px; border: 1px solid #e1e1e1;
    position: relative; transition: transform 0.2s;
}
.task-card:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }

.task-card.completed { border-left: 5px solid var(--success); background: #f9fff9; }
.task-card.overdue { border-left: 5px solid var(--danger); background: #fff5f5; }
.task-card.pending { border-left: 5px solid var(--warning); }

.task-header { display: flex; justify-content: space-between; margin-bottom: 10px; }
.task-title { font-size: 18px; font-weight: bold; color: var(--dark); }
.task-deadline { font-size: 13px; color: #666; background: #eee; padding: 3px 8px; border-radius: 4px; }

.status-tag {
    position: absolute; top: 20px; right: 20px;
    font-size: 12px; font-weight: bold; padding: 4px 8px; border-radius: 4px;
}
.tag-done { background: #d4edda; color: #155724; }
.tag-pending { background: #fff3cd; color: #856404; }
.tag-overdue { background: #f8d7da; color: #721c24; }

/* Update Section */
.update-section {
    margin-top: 15px; padding-top: 15px; border-top: 1px dashed #ddd;
}
.update-box textarea { background: #fcfcfc; font-size: 13px; height: 60px; }
.last-update { font-size: 12px; color: #888; margin-bottom: 5px; display: block; }


/* Login Centering */
.login-wrapper {
    display: flex; justify-content: center; align-items: center; height: 80vh;
}
.login-box {
    width: 100%; max-width: 400px; padding: 40px; text-align: center;
}

/* Header */
.admin-navbar {
    background: white; padding: 15px 30px; display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); margin-bottom: 30px; border-radius: 8px;
}
.admin-brand { font-size: 20px; font-weight: bold; color: var(--primary); display: flex; align-items: center; gap: 10px; }

/* Student Grid Layout */
.student-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px;
}

.student-card-item {
    background: white; padding: 20px; border-radius: 10px; border: 1px solid #eee;
    transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; position: relative; overflow: hidden;
}
.student-card-item:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.08); border-color: var(--primary); }
.student-card-item::before {
    content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--primary);
}
.student-name { font-size: 18px; font-weight: bold; color: var(--dark); margin-bottom: 5px; }
.student-detail { font-size: 13px; color: #777; margin-bottom: 15px; }
.view-btn { width: 100%; background: #eef2f7; color: var(--primary); font-weight: bold; }
.view-btn:hover { background: var(--primary); color: white; }

/* Action Panel (Split View) */
.split-view { display: flex; gap: 30px; }
.sidebar-info { flex: 1; background: white; padding: 20px; border-radius: 10px; height: fit-content; }
.main-tasks-area { flex: 3; }

/* Task Items in Teacher View */
.teacher-task-card {
    background: white; border-radius: 8px; padding: 20px; margin-bottom: 15px;
    border-left: 5px solid #ccc; box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.teacher-task-card.completed { border-left-color: var(--success); }
.teacher-task-card.pending { border-left-color: var(--warning); }

/* Grading Controls */
.grading-area {
    background: #f8f9fa; padding: 15px; border-radius: 6px; margin-top: 15px;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.grading-area input { width: 70px; margin: 0; text-align: center; font-weight: bold; }

/* Student Note Highlight */
.student-update-box {
    background: #e3f2fd; border: 1px solid #bbdefb; padding: 12px; border-radius: 6px; margin: 10px 0;
}

.student-stats-mini {
    display: flex;
    gap: 5px;
    margin-bottom: 12px;
}

.stat-tag {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f0f0f0;
    color: #666;
    font-weight: 600;
}

.stat-tag.pending {
    background: #fff3cd;
    color: #856404;
}

.stat-tag.overdue {
    background: #f8d7da;
    color: #721c24;
}

/* Red highlight for the entire card if overdue */
.teacher-task-card.overdue {
    border-left: 5px solid var(--danger) !important;
    background-color: #fff5f5;
}

/* Red highlight for the deadline text specifically */
.deadline-red {
    background: var(--danger) !important;
    color: white !important;
}

/* Ensure the deadline badge has basic styling */
.task-deadline-badge {
    font-size: 12px; 
    background: #eee; 
    padding: 2px 8px; 
    border-radius: 4px;
}

/* Red highlight for the entire card if overdue */
.teacher-task-card.overdue {
    border-left: 5px solid var(--danger) !important;
    background-color: #fff5f5;
}

/* Red highlight for the deadline text specifically */
.deadline-red {
    background: var(--danger) !important;
    color: white !important;
}

.task-deadline-badge {
    font-size: 12px; 
    background: #eee; 
    padding: 2px 8px; 
    border-radius: 4px;
}

/* Update for the student card header in teacher portal */
.student-card-item {
    display: flex;
    flex-direction: column;
}

.student-card-item img {
    flex-shrink: 0;
}

/* --- NEW: Dashboard Split Layout --- */
.dashboard-grid {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Left Side: Student List (Takes up remaining space) */
.students-main {
    flex: 3;
}

/* Right Side: Overdue Sidebar (Fixed width) */
.overdue-sidebar {
    flex: 1;
    min-width: 300px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-top: 4px solid var(--danger);
}

/* Overdue Stats Card Styles */
.overdue-total-card {
    text-align: center;
    background: #fff5f5;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #ffcccc;
}
.overdue-total-card h1 { margin: 0; color: var(--danger); font-size: 36px; }
.overdue-total-card p { margin: 5px 0 0; color: #c0392b; font-weight: bold; font-size: 13px; text-transform: uppercase;}

/* Category Lists */
.overdue-category { margin-bottom: 15px; }
.overdue-cat-title {
    font-size: 14px; font-weight: bold; color: #555;
    border-bottom: 1px solid #eee; padding-bottom: 5px; margin-bottom: 8px;
    display: flex; justify-content: space-between;
}
.overdue-student-item {
    display: flex; justify-content: space-between;
    font-size: 13px; padding: 4px 0; color: #333;
}
.overdue-count-badge {
    background: var(--danger); color: white;
    padding: 1px 6px; border-radius: 10px; font-size: 11px; font-weight: bold;
}

/* --- Back Button Styling --- */
.back-dashboard-btn {
    background: white !important; /* Overrides default button color */
    color: #555 !important;
    border: 1px solid #ddd !important;
    padding: 10px 25px !important;
    border-radius: 50px !important; /* Pill shape */
    font-weight: 600 !important;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px; /* Space between arrow and text */
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.back-dashboard-btn:hover {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    transform: translateX(-5px); /* Slide left animation */
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.15);
}

/* --- 3-COLUMN LAYOUT --- */
.dashboard-grid {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* 1. Left Sidebar (Meets) */
.meets-sidebar {
    flex: 1;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 2. Center (Students) - Takes most space */
.students-main {
    flex: 2; 
}

/* 3. Right Sidebar (Overdue) */
.overdue-sidebar {
    flex: 0.8;
    min-width: 250px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-top: 4px solid var(--danger);
}

/* --- DRAG & DROP MEETING ZONES --- */
.meet-creator-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-top: 4px solid #9b59b6; /* Purple for Meets */
}

.drop-zone {
    border: 2px dashed #ccc;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    color: #888;
    margin-bottom: 15px;
    transition: all 0.2s;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.drop-zone.drag-over {
    background: #e8f0fe;
    border-color: var(--primary);
    color: var(--primary);
}

.attendee-tag {
    display: inline-flex;
    align-items: center;
    background: #e1e8ed;
    color: #333;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 11px;
    margin: 2px;
}
.attendee-tag span {
    margin-left: 5px;
    cursor: pointer;
    color: var(--danger);
    font-weight: bold;
}

/* --- MEETING LISTS --- */
.meeting-section-title {
    font-size: 14px;
    font-weight: bold;
    color: #555;
    margin: 15px 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.meeting-card {
    background: white;
    border-left: 4px solid #9b59b6;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.meeting-time {
    font-size: 12px;
    color: #9b59b6;
    font-weight: bold;
    margin-bottom: 4px;
}
.meeting-title {
    font-size: 14px;
    font-weight: bold;
    color: var(--dark);
    margin-bottom: 4px;
}
.meeting-link {
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
}
.meeting-link:hover { text-decoration: underline; }