* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    --todo: #64748b;
    --planning: #8b5cf6;
    --development: #3b82f6;
    --peer-review: #f59e0b;
    --completed: #22c55e;
    
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-left .subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
    display: block;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

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

/* Kanban Board */
.kanban-board {
    display: flex;
    gap: 20px;
    padding: 30px;
    overflow-x: auto;
    flex: 1;
    min-height: calc(100vh - 100px);
}

.kanban-column {
    min-width: 300px;
    max-width: 350px;
    flex: 1;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 160px);
}

.column-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius) var(--radius) 0 0;
}

.column-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-count {
    background: var(--bg-hover);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 28px;
    text-align: center;
}

.task-list {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-list.drag-over {
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
}

/* Task Card */
.task-card {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    cursor: grab;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

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

.task-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

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

.task-card.priority-urgent::before { background: var(--danger); }
.task-card.priority-high::before { background: var(--warning); }
.task-card.priority-medium::before { background: var(--info); }
.task-card.priority-low::before { background: var(--success); }

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

.task-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
    flex: 1;
    margin-right: 8px;
}

.task-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.task-card:hover .task-actions {
    opacity: 1;
}

.task-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.task-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

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

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.task-tag {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.task-assignee {
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--primary);
    color: white;
    font-weight: 500;
}

.task-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-date.overdue {
    color: var(--danger);
}

/* Priority Badges */
.priority-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-urgent { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.priority-high { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.priority-medium { background: rgba(59, 130, 246, 0.2); color: var(--info); }
.priority-low { background: rgba(34, 197, 94, 0.2); color: var(--success); }

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

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

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

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

/* Form */
form {
    padding: 24px;
}

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

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

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

input, textarea, select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
}

input::placeholder, textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
}

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

.task-card {
    animation: fadeIn 0.3s ease;
}

/* Responsive */
@media (max-width: 1200px) {
    .kanban-board {
        overflow-x: scroll;
        scroll-snap-type: x mandatory;
    }
    
    .kanban-column {
        scroll-snap-align: start;
        min-width: 280px;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .header-right {
        flex-direction: column;
        width: 100%;
    }
    
    .stats {
        justify-content: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Task Detail Modal */
.task-detail-header {
    margin-bottom: 20px;
}

.task-detail-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.task-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.task-detail-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-dark);
    border-radius: 8px;
    white-space: pre-wrap;
}

.task-detail-actions {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border);
}

/* Alan's Animated Status Emoji */
.alan-status-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 24px;
    padding-right: 24px;
    border-right: 1px solid var(--border);
}

.alan-avatar {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.alan-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
}

.alan-emoji {
    font-size: 2rem;
    display: block;
    animation: bounce 2s infinite;
}

/* Status-specific animations */
.alan-avatar.status-free .alan-emoji {
    animation: bounce 1s infinite ease-in-out;
}

.alan-avatar.status-busy .alan-emoji {
    animation: pulse 0.5s infinite;
}

.alan-avatar.status-thinking .alan-emoji {
    animation: shake 2s infinite;
}

.alan-avatar.status-idle .alan-emoji {
    animation: float 3s infinite ease-in-out;
}

.alan-avatar.status-packed .alan-emoji {
    animation: spin 2s infinite linear;
}

.alan-avatar.status-bored .alan-emoji {
    animation: wobble 2s infinite;
}

.alan-status-ring {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--primary);
    border-right-color: var(--secondary);
    animation: ring-spin 2s linear infinite;
}

.alan-avatar.status-busy .alan-status-ring {
    border-color: var(--danger);
    animation: ring-spin 0.5s linear infinite;
}

.alan-avatar.status-thinking .alan-status-ring {
    border-color: var(--warning);
    animation: ring-pulse 1.5s ease-in-out infinite;
}

.alan-status-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.alan-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.alan-vibe {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-title h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animations */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes wobble {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

@keyframes ring-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes ring-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
}

/* Status selector modal */
.status-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 20px;
}

.status-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.status-option:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.status-option .emoji {
    font-size: 2.5rem;
}

.status-option .label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
