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

:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --bg-card: #1f2937;
    --bg-card-hover: #374151;
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --primary: #6366f1;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --secondary-gradient: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    
    --status-todo: #9ca3af;
    --status-progress: #3b82f6;
    --status-review: #f59e0b;
    --status-done: #10b981;
    
    --priority-high: #ef4444;
    --priority-medium: #f59e0b;
    --priority-low: #10b981;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    overflow: hidden;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Sidebar Layout */
.sidebar {
    width: 260px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    flex-shrink: 0;
    z-index: 10;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 20px;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #fff, #9ca3af);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.nav-item:hover, .nav-item.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    background: var(--primary-gradient);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

.nav-item i {
    font-size: 18px;
}

/* User Selection Bar in Sidebar */
.user-selector-container {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.user-selector-title {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.user-select-dropdown {
    width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 10px 12px;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

.user-select-dropdown:focus {
    border-color: var(--primary);
}

/* Main Content Area */
.main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

header {
    height: 70px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    flex-shrink: 0;
}

.header-title-container h1 {
    font-size: 20px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

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

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* Page Contents */
.content-area {
    flex-grow: 1;
    padding: 32px;
    overflow-y: auto;
    position: relative;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
    height: 100%;
}

.page.active {
    display: block;
}

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

/* ==========================================================================
   Dashboard Page CSS
   ========================================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-lg);
}

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

.stat-card.todo::after { background-color: var(--status-todo); }
.stat-card.progress::after { background-color: var(--status-progress); }
.stat-card.review::after { background-color: var(--status-review); }
.stat-card.done::after { background-color: var(--status-done); }

.stat-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}

.dashboard-charts-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 32px;
    align-items: start;
}

.chart-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    height: 480px;
    display: flex;
    flex-direction: column;
}

.chart-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.chart-wrapper {
    flex-grow: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-wrapper canvas {
    max-width: 100%;
    max-height: 100%;
}

/* Team progress board in Dashboard */
.team-progress-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    max-height: 380px;
    padding-right: 8px;
}

.team-progress-item {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.team-progress-avatar {
    width: 44px;
    height: 44px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
}

.team-progress-info {
    flex-grow: 1;
}

.team-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.team-progress-name {
    font-weight: 600;
    font-size: 15px;
}

.team-progress-percentage {
    font-weight: 600;
    font-size: 14px;
    color: var(--primary);
}

.progress-bar-container {
    height: 8px;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 4px;
    width: 0%;
    transition: width 1s ease-in-out;
}

.team-progress-tasks-count {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    display: block;
}

/* ==========================================================================
   Kanban Board Page CSS
   ========================================================================== */
.kanban-view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.member-filter-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.member-filter-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    height: calc(100% - 64px);
    min-height: 480px;
    align-items: stretch;
}

.kanban-column {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    padding: 16px;
    max-height: 100%;
}

.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.column-title-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.todo { background-color: var(--status-todo); }
.status-dot.progress { background-color: var(--status-progress); }
.status-dot.review { background-color: var(--status-review); }
.status-dot.done { background-color: var(--status-done); }

.column-title {
    font-weight: 600;
    font-size: 15px;
}

.task-count {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

.task-list {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    min-height: 150px;
    padding: 4px;
}

.task-list.dragover {
    background-color: rgba(99, 102, 241, 0.04);
    border: 2px dashed rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-md);
}

/* Task Card Style */
.task-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: grab;
    transition: var(--transition);
    user-select: none;
}

.task-card:active {
    cursor: grabbing;
}

.task-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow);
}

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

.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.task-priority-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    color: #fff;
}

.task-priority-tag.high { background-color: var(--priority-high); }
.task-priority-tag.medium { background-color: var(--priority-medium); }
.task-priority-tag.low { background-color: var(--priority-low); }

.task-actions-menu {
    display: flex;
    gap: 4px;
}

.task-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 2px;
    border-radius: 4px;
    transition: var(--transition);
}

.task-action-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.task-action-btn.edit-btn:hover {
    color: var(--primary);
}

.task-action-btn.delete-btn:hover {
    color: #ef4444;
}

.task-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    line-height: 1.4;
}

.task-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    font-size: 11px;
}

.task-assignee {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-weight: 500;
}

.task-assignee-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
}

.task-dates {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    color: var(--text-muted);
}

.task-deadline {
    font-weight: 500;
}

.task-deadline.overdue {
    color: #f87171;
    font-weight: 600;
    animation: pulseRed 2s infinite;
}

@keyframes pulseRed {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}


/* ==========================================================================
   Team Management Page CSS
   ========================================================================== */
.team-management-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 32px;
    align-items: start;
}

.team-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.team-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

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

.form-control {
    width: 100%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.team-list-table-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.team-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.team-table th {
    background-color: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
}

.team-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.team-table tr:last-child td {
    border-bottom: none;
}

.team-member-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.team-member-cell-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

.team-member-cell-name {
    font-weight: 500;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 500px;
    max-width: 90vw;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: var(--transition);
    overflow: hidden;
}

.modal-backdrop.active .modal-container {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close-btn:hover {
    color: #fff;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.flex-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
