/* =========================================================================
   AITS College Task Management System - Custom CSS V3
   ========================================================================= */

:root {
    --primary-color: #2563eb; --primary-hover: #1d4ed8;
    --success-color: #10b981; --success-hover: #059669;
    --warning-color: #f59e0b; --danger-color: #ef4444;
    --bg-color: #f3f4f6; --surface-color: rgba(255, 255, 255, 0.8);
    --surface-solid: #ffffff; --text-primary: #1f2937;
    --text-secondary: #4b5563; --border-color: #e5e7eb;
    --sidebar-bg: #1e293b; --sidebar-text: #f8fafc;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --glass-border: rgba(255, 255, 255, 0.3);
}

body.dark-mode {
    --bg-color: #0f172a; --surface-color: rgba(30, 41, 59, 0.7);
    --surface-solid: #1e293b; --text-primary: #f8fafc;
    --text-secondary: #94a3b8; --border-color: #334155;
    --sidebar-bg: #0b1121; --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --glass-border: rgba(255, 255, 255, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Outfit', sans-serif; }
body { background-color: var(--bg-color); color: var(--text-primary); transition: background-color 0.3s ease, color 0.3s ease; min-height: 100vh; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
.hidden { display: none !important; }
.active { display: block; }
.mt-3 { margin-top: 1rem; }

.glass {
    background: var(--surface-color); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border); box-shadow: var(--shadow); border-radius: 12px;
}

.btn { padding: 10px 20px; border-radius: 8px; border: none; font-weight: 500; cursor: pointer; transition: all 0.3s ease; font-size: 1rem; }
.primary-btn { background: var(--primary-color); color: white; }
.primary-btn:hover { background: var(--primary-hover); transform: translateY(-2px); }
.success-btn { background: var(--success-color); color: white; }
.success-btn:hover { background: var(--success-hover); transform: translateY(-2px); }

.input-group { margin-bottom: 1.2rem; display: flex; flex-direction: column; }
.input-group label { margin-bottom: 0.5rem; font-size: 0.9rem; color: var(--text-secondary); font-weight: 500; }
.input-group input, .input-group select, .input-group textarea {
    padding: 12px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--surface-solid); color: var(--text-primary); font-size: 1rem; outline: none; transition: border-color 0.3s;
}
.input-group select[multiple] { padding: 5px; }
.input-group input:focus, .input-group select:focus, .input-group textarea:focus { border-color: var(--primary-color); }
.form-row { display: flex; gap: 15px; }
.form-row .input-group { flex: 1; }
.error-msg { color: var(--danger-color); font-size: 0.9rem; margin-bottom: 10px; min-height: 20px; }

/* Login */
#login-view { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, var(--bg-color) 0%, rgba(37,99,235,0.1) 100%); }
.login-container { padding: 40px; width: 100%; max-width: 400px; text-align: center; }
.login-header h2 { font-size: 1.8rem; color: var(--primary-color); margin-bottom: 5px; }
.login-container form .btn { width: 100%; margin-top: 15px; }

/* Dashboard */
#dashboard-view { display: flex; }
.mobile-menu-toggle { display: none; position: fixed; top: 15px; left: 15px; z-index: 200; font-size: 28px; cursor: pointer; color: var(--text-primary); background: var(--surface-solid); padding: 5px 10px; border-radius: 8px; box-shadow: var(--shadow); }
.close-sidebar { display: none; cursor: pointer; font-size: 24px; color: var(--danger-color); }

.sidebar { position: fixed; top: 0; left: 0; height: 100%; width: 250px; background: var(--sidebar-bg); color: var(--sidebar-text); padding: 20px 0; transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); z-index: 300; display: flex; flex-direction: column; }
.sidebar .logo { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; margin-bottom: 30px; }
.sidebar .logo i.bxs-graduation { font-size: 28px; margin-right: 10px; color: var(--primary-color); }
.sidebar .logo .logo-name { font-size: 20px; font-weight: 600; flex-grow: 1; }

.sidebar .nav-links { list-style: none; flex-grow: 1; }
.sidebar .nav-links li { padding: 5px 20px; }
.sidebar .nav-links li a { display: flex; align-items: center; padding: 12px; border-radius: 8px; transition: background 0.3s; }
.sidebar .nav-links li a:hover, .sidebar .nav-links li a.active { background: rgba(255, 255, 255, 0.1); }
.sidebar .nav-links li a i { font-size: 20px; margin-right: 15px; }

.sidebar .profile-details { padding: 20px; display: flex; align-items: center; justify-content: space-between; background: rgba(0, 0, 0, 0.2); border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar .profile-details .name-job { flex-grow: 1; overflow: hidden; }
.sidebar .profile-details .profile_name { font-size: 15px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.sidebar .profile-details .job { font-size: 12px; color: #a1a1aa; }
.sidebar .profile-details #log_out { font-size: 20px; cursor: pointer; transition: color 0.3s; }
.sidebar .profile-details #log_out:hover { color: var(--danger-color); }

.main-content { margin-left: 250px; width: calc(100% - 250px); min-height: 100vh; padding: 20px 40px; transition: margin-left 0.4s ease; }
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border-color); }
header h1 { font-size: 1.8rem; font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 15px; }
#user-filter { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--surface-solid); color: var(--text-primary); outline: none; }

/* Notifications */
.notification-wrapper { position: relative; display: flex; align-items: center; }
#notify-btn { font-size: 24px; cursor: pointer; color: var(--text-secondary); transition: 0.3s; }
#notify-btn:hover { color: var(--primary-color); }
.notify-badge { position: absolute; top: -5px; right: -5px; background: var(--danger-color); color: white; font-size: 10px; padding: 2px 5px; border-radius: 10px; font-weight: bold; }
.notification-dropdown { position: absolute; top: 35px; right: -10px; width: 300px; max-height: 400px; z-index: 500; border-radius: 10px; padding: 10px; display: flex; flex-direction: column; overflow: hidden; animation: scaleIn 0.2s ease; }
.notify-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding-bottom: 5px; border-bottom: 1px solid var(--border-color); }
.notify-body { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; max-height: 300px; }
.notify-item { padding: 10px; background: var(--surface-solid); border-radius: 6px; font-size: 0.85rem; border-left: 3px solid var(--primary-color); }

.theme-toggle { cursor: pointer; font-size: 24px; color: var(--text-secondary); transition: color 0.3s;}
.theme-toggle:hover { color: var(--primary-color); }

/* --- Kanban Board & Drag/Drop --- */
.kanban-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.kanban-col { background: var(--surface-color); border-radius: 12px; padding: 15px; display: flex; flex-direction: column; min-height: 400px; border: 1px solid var(--border-color); transition: background 0.3s; }
.kanban-col.drag-over { background: rgba(37,99,235,0.05); border: 2px dashed var(--primary-color); }
.kanban-col-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 2px solid var(--border-color); }
.kanban-col-header h3 { font-size: 1.1rem; }
.kanban-col-header .count { background: var(--primary-color); color: white; padding: 2px 8px; border-radius: 12px; font-size: 0.8rem; font-weight: 600; }
#col-pending .kanban-col-header { border-bottom-color: var(--warning-color); }
#col-in_progress .kanban-col-header { border-bottom-color: var(--primary-color); }
#col-completed .kanban-col-header { border-bottom-color: var(--success-color); }

.kanban-col-body { flex-grow: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }

/* Task Card with Animations */
.task-card { 
    background: var(--surface-solid); padding: 15px; border-radius: 8px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); border-left: 4px solid var(--border-color); 
    cursor: grab; transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s; 
    animation: fadeInCard 0.4s ease forwards; opacity: 0; transform: translateY(10px);
}
.task-card:active { cursor: grabbing; }
.task-card.dragging { opacity: 0.5; transform: scale(0.95); }
@keyframes fadeInCard { to { opacity: 1; transform: translateY(0); } }

.task-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.task-card.status-pending { border-left-color: var(--warning-color); }
.task-card.status-in_progress { border-left-color: var(--primary-color); }
.task-card.status-completed { border-left-color: var(--success-color); }
.task-card h4 { margin-bottom: 5px; font-size: 1rem; color: var(--text-primary); }
.task-card p { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.priority-badge { font-size: 0.7rem; padding: 2px 6px; border-radius: 10px; color: white; font-weight: bold; margin-bottom: 5px; display: inline-block; text-transform: uppercase; }
.priority-high { background: var(--danger-color); }
.priority-medium { background: var(--warning-color); }
.priority-low { background: var(--success-color); }

.task-meta { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-secondary); margin-top: 10px; }

/* Forms & UI */
.form-card { max-width: 700px; margin: 0 auto; padding: 30px; animation: fadeInCard 0.4s ease forwards; }
.form-card h2 { margin-bottom: 20px; color: var(--primary-color); }

/* Modals */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); backdrop-filter: blur(4px); align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s; }
.modal.active { display: flex; opacity: 1; }
.modal-content { width: 90%; max-width: 500px; padding: 25px; position: relative; transform: scale(0.9); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); max-height: 90vh; overflow-y: auto; }
.modal.active .modal-content { transform: scale(1); }
.close-btn { font-size: 24px; font-weight: bold; cursor: pointer; color: var(--text-secondary); transition: 0.2s; }
.close-btn:hover { color: var(--danger-color); transform: rotate(90deg); }

.modal-tabs { display: flex; gap: 10px; margin-bottom: 15px; border-bottom: 1px solid var(--border-color); }
.tab-btn { background: none; border: none; padding: 10px 15px; cursor: pointer; color: var(--text-secondary); font-size: 1rem; border-bottom: 2px solid transparent; transition: 0.3s; }
.tab-btn.active { color: var(--primary-color); border-bottom-color: var(--primary-color); font-weight: 500; }

.modal-body p { margin-bottom: 10px; color: var(--text-secondary); }
.modal-body strong { color: var(--text-primary); }

.notes-list { max-height: 200px; overflow-y: auto; padding-right: 10px; display: flex; flex-direction: column; gap: 10px; }
.note-item { background: var(--bg-color); padding: 10px; border-radius: 8px; font-size: 0.9rem; animation: fadeInCard 0.3s ease; }
.note-item small { color: var(--text-secondary); display: block; margin-top: 5px; font-size: 0.75rem; }

.attachments-list { display: flex; flex-direction: column; gap: 5px; }
.attachment-item { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; padding: 5px; background: var(--bg-color); border-radius: 5px; }
.attachment-item a { color: var(--primary-color); text-decoration: underline; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; border-bottom: 1px solid var(--border-color); }
.user-link { color: var(--primary-color); cursor: pointer; font-weight: 500; }
.user-link:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 900px) { .kanban-board { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
    .mobile-menu-toggle { display: block; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .close-sidebar { display: block; }
    .main-content { margin-left: 0; width: 100%; padding: 70px 20px 20px; }
    .form-row { flex-direction: column; gap: 0; }
    header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .header-actions { width: 100%; justify-content: space-between; }
}
