/* css/core.css */
:root {
    /* Brand Colors */
    --color-primary: #6366f1; /* Indigo */
    --color-primary-hover: #4f46e5;
    
    /* Backgrounds (Dark Mode Focus for premium feel) */
    --bg-base: #111118;
    --bg-surface: #1e1e2e;
    --bg-surface-hover: #2a2a3c;
    --bg-panel: #242436;
    --column-bg: rgba(30, 30, 46, 0.3);
    --column-border: transparent;
    --column-shadow: none;
    
    /* Text */
    --text-primary: #f8f8f2;
    --text-secondary: #a6accd;
    --text-muted: #6b7280;
    
    /* Status Colors */
    --color-email: #0ea5e9;
    --color-high: #ef4444;
    --color-success: #22c55e;
    
    /* Shadows & Border */
    --border-color: #313244;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    
    /* Metrics */
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

/* Light Theme Overrides */
[data-theme="light"] {
    --bg-base: #f3f4f6;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f9fafb;
    --bg-panel: #ffffff;
    --column-bg: #ffffff;
    --column-border: #e5e7eb;
    --column-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    
    --border-color: #e5e7eb;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow: hidden; /* Prevent body scroll, manage in containers */
}

/* Typography */
h1, h2, h3 { font-weight: 600; }
h1 { font-size: 1.5rem; margin-bottom: 1rem; }
h2 { font-size: 1.1rem; margin-bottom: 0.75rem; color: var(--text-secondary); }

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background-color var(--transition-fast);
}

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

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

.btn-icon {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
}

/* Avatars */
.avatar { width: 40px; height: 40px; border-radius: var(--radius-full); object-fit: cover; }
.avatar-sm { width: 24px; height: 24px; border-radius: var(--radius-full); object-fit: cover; }
.avatar-xs { width: 20px; height: 20px; border-radius: var(--radius-full); object-fit: cover; }

/* Tags */
.tag {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}
.tag-email { background: rgba(14, 165, 233, 0.2); color: var(--color-email); }
.tag-high { background: rgba(239, 68, 68, 0.2); color: var(--color-high); }

/* Task Cards (Shared Basics) */
.task-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.task-card:hover {
    border-color: var(--color-primary);
}
.task-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    border: 2px dashed var(--color-primary);
}
.task-card h3 { font-size: 0.95rem; margin: 0.5rem 0 0.25rem 0; }
.task-card .teaser { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-tags { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.task-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 0.75rem; font-size: 0.8rem; color: var(--text-muted); }

/* Drag & Drop Columns */
.kanban-column.drag-over {
    background-color: rgba(99, 102, 241, 0.1);
    border-color: var(--color-primary) !important;
}

/* Quick Capture Overlay (Global) */
.hidden { display: none !important; }
#quick-capture-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-surface);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}
.qc-header { display: flex; justify-content: space-between; padding: 1rem; border-bottom: 1px solid var(--border-color); }
.btn-cancel { background: transparent; border: none; color: var(--text-secondary); cursor: pointer; }
.btn-save { background: var(--color-primary); border: none; color: white; padding: 0.5rem 1rem; border-radius: var(--radius-md); font-weight: 500; cursor: pointer; }
.qc-body { flex: 1; display: flex; flex-direction: column; padding: 1rem; }
#qc-input { flex: 1; background: transparent; border: none; color: var(--text-primary); font-size: 1.2rem; resize: none; outline: none; font-family: inherit; }
.qc-actions { margin-top: 1rem; display: flex; gap: 0.5rem; border-top: 1px solid var(--border-color); padding-top: 1rem; }

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}
.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: var(--bg-surface);
}
select.form-control {
    appearance: auto;
    cursor: pointer;
}

/* Utilities */

/* Notion Style Wiki Inputs */
.notion-input-cat {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 0.5rem;
    width: 100%;
    outline: none;
    font-weight: 500;
}
.notion-input-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    background: transparent;
    border: none;
    padding: 0;
    width: 100%;
    outline: none;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}
.notion-input-title::placeholder {
    color: var(--text-muted);
    font-weight: 700;
}

/* Edit Mode Visual Cues */
.notion-input-cat:not([readonly]),
.notion-input-title:not([readonly]) {
    background: var(--bg-base);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    transition: all 0.2s;
}
.notion-input-cat:not([readonly]):focus,
.notion-input-title:not([readonly]):focus {
    border: 1px solid var(--color-primary);
    background: var(--bg-surface);
}

.notion-input-task-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    background: transparent;
    border: 1px dashed transparent;
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    margin: -0.25rem -0.5rem;
    width: 100%;
    outline: none;
    transition: all 0.2s;
}
.notion-input-task-title:focus, .notion-input-task-title:hover {
    border-color: var(--border-color);
    background: var(--bg-base);
}
    background: var(--bg-base);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    transition: all 0.2s;
}
.notion-input-cat:not([readonly]):focus,
.notion-input-title:not([readonly]):focus {
    border: 1px solid var(--color-primary);
    background: var(--bg-surface);
}

/* Quill Editor Overrides */
.ql-toolbar.ql-snow {
    background: var(--bg-surface);
    border: none !important;
    border-bottom: 1px solid var(--border-color) !important;
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
    padding: 0.5rem !important;
}
.ql-container.ql-snow {
    border: none !important;
    font-family: inherit !important;
    font-size: 1rem !important;
}
.ql-editor {
    color: var(--text-primary);
    line-height: 1.6;
    padding: 1.5rem 0 !important;
}
.ql-editor.ql-blank::before {
    color: var(--text-muted) !important;
    left: 0 !important;
}
.ql-snow .ql-stroke {
    stroke: var(--text-secondary) !important;
}
.ql-snow .ql-fill, .ql-snow .ql-stroke.ql-fill {
    fill: var(--text-secondary) !important;
}
.ql-snow .ql-picker {
    color: var(--text-secondary) !important;
}
button.ql-active .ql-stroke {
    stroke: var(--color-primary) !important;
}
button:hover .ql-stroke {
    stroke: var(--text-primary) !important;
}
