@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --bg-main: #0f172a;
    --bg-surface: rgba(30, 41, 59, 0.7);
    --bg-card: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.35);
    --primary-hover: #4f46e5;
    
    --todo-color: #f59e0b;
    --todo-glow: rgba(245, 158, 11, 0.2);
    --doing-color: #3b82f6;
    --doing-glow: rgba(59, 130, 246, 0.2);
    --done-color: #10b981;
    --done-glow: rgba(16, 185, 129, 0.2);
    --danger: #ef4444;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --radius-lg: 16px;
    --radius-md: 10px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', 'Kanit', sans-serif;
}

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Authentication Page */
.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 40px;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.4s ease-out;
}

.auth-container h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 8px;
    transition: var(--transition);
}

.tab-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Header UI */
.app-header {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-logo {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.header-user strong {
    color: var(--text-primary);
}

/* Application Container */
.app-container {
    padding: 32px;
    max-width: 1600px;
    margin: 0 auto;
}

/* Statistics Dashboard Bar */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    backdrop-filter: blur(8px);
}

.stat-card .stat-title {
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}

.search-box {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 8px 16px;
    color: var(--text-primary);
    width: 280px;
    outline: none;
    transition: var(--transition);
}

.search-box:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-group input, 
.form-group textarea, 
.form-group select {
    width: 100%;
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}

.form-group input:focus, 
.form-group textarea:focus, 
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

/* Kanban Board System */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: start;
}

.kanban-column {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    min-height: 650px;
    display: flex;
    flex-direction: column;
}

.column-header {
    font-size: 15px;
    font-weight: 700;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: white;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: 0.5px;
}

.todo-hdr {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.doing-hdr {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.done-hdr {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.badge-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.task-list {
    flex: 1;
    min-height: 500px;
    transition: background 0.2s;
    border-radius: var(--radius-md);
}

.task-list.drag-over {
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed var(--primary);
}

/* Task Cards */
.task-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 14px;
    cursor: grab;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.task-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

#list-todo .task-card::before { background: var(--todo-color); }
#list-doing .task-card::before { background: var(--doing-color); }
#list-done .task-card::before { background: var(--done-color); }

.task-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.task-card.dragging {
    opacity: 0.4;
    transform: scale(0.95);
}

.task-card-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.task-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.task-date {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

/* Task Notification Status Badges */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
}

.badge-overdue {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.badge-soon {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Attachment Link */
.task-attachment {
    font-size: 12px;
    margin-bottom: 12px;
}

.task-attachment a {
    color: #818cf8;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.task-attachment a:hover {
    text-decoration: underline;
}

.task-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid var(--glass-border);
    padding-top: 10px;
}

.btn-action {
    background: none;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-action.edit { color: #818cf8; }
.btn-action.edit:hover { background: rgba(99, 102, 241, 0.1); }

.btn-action.delete { color: #f87171; }
.btn-action.delete:hover { background: rgba(239, 68, 68, 0.1); }

/* Modal Design - Scrollable & Centered */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease-out;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #1e293b;
    border: 1px solid var(--glass-border);
    padding: 32px;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    margin: auto;
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.modal-content h3 {
    font-size: 20px;
    margin-bottom: 20px;
}

.close-btn {
    position: absolute;
    right: 24px;
    top: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.close-btn:hover { color: var(--text-primary); }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Breakpoint */
@media (max-width: 992px) {
    .kanban-board {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .kanban-column {
        min-height: auto;
    }
    .app-container {
        padding: 16px;
    }
    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .search-box {
        width: 100%;
    }
}