/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-hover: #1f3460;
    --text-primary: #e0e0e0;
    --text-secondary: #8892b0;
    --accent: #60a5fa;
    --accent-hover: #3b82f6;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #22c55e;
    --border: #2d3748;
    --shadow: rgba(0, 0, 0, 0.3);

    /* Card colors */
    --color-blue: #60a5fa;
    --color-purple: #a78bfa;
    --color-teal: #2dd4bf;
    --color-orange: #fb923c;
    --color-pink: #f472b6;
    --color-green: #4ade80;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* === Header === */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header .back-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

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

.header .project-info {
    flex: 1;
}

.header .project-title {
    font-size: 18px;
    font-weight: 600;
}

.header .vault-path {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.header .menu-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.header .menu-btn:hover {
    background: var(--bg-hover);
}

/* === Project List === */
.project-list {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 24px;
}

.project-list h2 {
    font-size: 24px;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.project-grid {
    display: grid;
    gap: 12px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.project-card:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.project-card .project-name {
    font-size: 16px;
    font-weight: 500;
}

.project-card .project-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.project-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.4;
}

.project-card .delete-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    opacity: 0;
    transition: all 0.2s;
}

.project-card:hover .delete-btn {
    opacity: 1;
}

.project-card .delete-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.add-project-btn {
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.add-project-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* === Kanban Board === */
.board {
    display: flex;
    gap: 16px;
    padding: 24px;
    overflow-x: auto;
    min-height: calc(100vh - 80px);
    align-items: flex-start;
}

.column {
    background: var(--bg-secondary);
    border-radius: 12px;
    min-width: 280px;
    max-width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 120px);
}

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

.column-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.column-count {
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
}

.column-cards {
    padding: 12px;
    flex: 1;
    overflow-y: auto;
    min-height: 60px;
}

.column-cards::-webkit-scrollbar {
    width: 4px;
}

.column-cards::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.add-task-btn {
    margin: 0 12px 12px;
    background: none;
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.add-task-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* === Task Card === */
.task-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: grab;
    transition: all 0.2s;
    border-left: 4px solid var(--card-color, var(--accent));
    position: relative;
}

.task-card:hover {
    background: var(--bg-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow);
}

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

.task-check {
    cursor: pointer;
    margin-right: 6px;
    user-select: none;
    display: inline-flex;
    align-items: center;
}
.task-check:hover {
    transform: scale(1.2);
}

.task-card.task-completed {
    opacity: 0.6;
}
.task-card.task-completed .task-title {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.completed-badge {
    font-size: 12px;
}

.completed-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
}
.completed-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--success);
    cursor: pointer;
}

.task-card .task-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.4;
}

.task-card .task-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.task-card .priority-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.priority-low { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.priority-medium { background: rgba(234, 179, 8, 0.2); color: #eab308; }
.priority-high { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.task-card .comment-count {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-card .created-by {
    margin-left: auto;
    font-size: 14px;
}

/* === Modal === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}

.modal {
    background: var(--bg-secondary);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
    box-shadow: 0 20px 60px var(--shadow);
}

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

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

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
}

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

.modal-body {
    padding: 24px;
}

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

/* === Form Elements === */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

/* === Color Picker === */
.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: white;
    box-shadow: 0 0 0 2px var(--bg-primary);
}

/* === Priority Picker === */
.priority-picker {
    display: flex;
    gap: 8px;
}

.priority-option {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.priority-option:hover {
    border-color: var(--accent);
}

.priority-option.selected {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

/* === Buttons === */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
}
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--accent-hover);
}

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

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

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

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

/* === Comments === */
.comments-section {
    margin-top: 20px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.comments-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.comment {
    padding: 12px;
    background: var(--bg-card);
    border-radius: 8px;
    margin-bottom: 8px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.comment-author {
    font-weight: 500;
}

.comment-content {
    font-size: 14px;
    line-height: 1.5;
}

.comment-input {
    display: flex;
    gap: 8px;
}

.comment-input input {
    flex: 1;
}

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

.empty-state .emoji {
    font-size: 48px;
    margin-bottom: 16px;
}

/* === Toast Notification === */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 300;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    max-width: 90vw;
    text-align: center;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast-error {
    background: var(--danger);
    color: white;
}
.toast-success {
    background: var(--success);
    color: white;
}
.toast-info {
    background: var(--accent);
    color: white;
}

/* === Confirm Modal === */
.confirm-modal {
    max-width: 420px;
}
.confirm-message {
    font-size: 15px;
    line-height: 1.5;
}

/* === Dropdown Menu === */
.dropdown-menu {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-width: 160px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    animation: slideUp 0.15s ease;
}
.dropdown-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}
.dropdown-item:hover {
    background: var(--bg-hover);
}
.dropdown-danger {
    color: var(--danger);
}
.dropdown-danger:hover {
    background: rgba(239,68,68,0.1);
}

/* === Utility === */
.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* === Responsive === */
@media (max-width: 768px) {
    .board {
        padding: 16px;
        gap: 12px;
    }

    .column {
        min-width: 260px;
    }

    .modal {
        width: 95%;
        max-height: 90vh;
    }
}
