/* Patel Dashboard - Complete Styles */

/* ========================================
   CSS CUSTOM PROPERTIES (THEME VARIABLES)
   ======================================== */

:root {
    /* Light mode colors (default) */
    --bg-primary: #f8fafc;
    --bg-secondary: #e2e8f0;
    --bg-gradient-start: #f1f5f9;
    --bg-gradient-mid: #e2e8f0;
    --bg-gradient-end: #cbd5e1;

    --surface-primary: rgba(255, 255, 255, 0.9);
    --surface-secondary: rgba(241, 245, 249, 0.8);
    --surface-header: rgba(248, 250, 252, 0.95);

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --border-primary: rgba(99, 102, 241, 0.2);
    --border-secondary: rgba(99, 102, 241, 0.15);
    --border-accent: rgba(99, 102, 241, 0.3);

    --accent-primary: #818cf8;
    --accent-secondary: #c084fc;
    --accent-gradient: linear-gradient(135deg, #818cf8, #c084fc);

    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;

    --scrollbar-track: rgba(99, 102, 241, 0.1);
    --scrollbar-thumb: rgba(99, 102, 241, 0.3);
    --scrollbar-thumb-hover: rgba(99, 102, 241, 0.5);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    /* Dark mode colors */
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-mid: #16213e;
    --bg-gradient-end: #0f3460;

    --surface-primary: rgba(31, 41, 55, 0.8);
    --surface-secondary: rgba(15, 23, 42, 0.5);
    --surface-header: rgba(15, 23, 42, 0.95);

    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #71717a;

    --border-primary: rgba(99, 102, 241, 0.2);
    --border-secondary: rgba(99, 102, 241, 0.15);
    --border-accent: rgba(99, 102, 241, 0.3);

    --accent-primary: #818cf8;
    --accent-secondary: #c084fc;
    --accent-gradient: linear-gradient(135deg, #818cf8, #c084fc);

    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;

    --scrollbar-track: rgba(99, 102, 241, 0.1);
    --scrollbar-thumb: rgba(99, 102, 241, 0.3);
    --scrollbar-thumb-hover: rgba(99, 102, 241, 0.5);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* ========================================
   BASE STYLES
   ======================================== */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 50%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

/* Header */
.header {
    background: var(--surface-header);
    border-bottom: 1px solid var(--border-accent);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1800px;
    margin: 0 auto;
}

.header-left, .header-center, .header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-center {
    flex: 1;
    justify-content: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.status-indicator {
    color: var(--success);
    font-size: 0.75rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.current-task {
    text-align: center;
}

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

.current-task .value {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
    margin-top: 0.25rem;
}

.sub-agents .label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.sub-agents .value {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 1.25rem;
    margin-left: 0.5rem;
}

.notification-btn,
.theme-toggle-btn {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid var(--border-accent);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    color: var(--text-primary);
}

.notification-btn:hover,
.theme-toggle-btn:hover {
    background: rgba(99, 102, 241, 0.3);
}

.notification-btn .bell,
.theme-toggle-btn .theme-icon {
    font-size: 1.25rem;
}

.notification-btn .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 999px;
    font-weight: 600;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.theme-toggle-btn .theme-icon {
    transition: transform 0.3s ease;
}

.theme-toggle-btn:hover .theme-icon {
    transform: rotate(15deg);
}

/* Main Content - Flex column for priority zone + grid */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    max-width: 1800px;
    margin: 0 auto;
}

/* Priority Zone - Full width at top */
.priority-zone {
    width: 100%;
}

/* Three-column grid for remaining panels */
.panels-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
}

.column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Panels */
.panel {
    background: var(--surface-primary);
    border: 1px solid var(--border-primary);
    border-radius: 1rem;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ========================================
   PANEL HIERARCHY (Visual Weight)
   ======================================== */

/* Active Tasks - Most prominent */
.active-tasks-panel {
    border-left: 4px solid var(--success);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.1);
}

.active-tasks-panel .panel-header {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), transparent);
}

/* Task Queue - Important, needs attention */
.queue-panel {
    border-left: 4px solid var(--warning);
}

/* Ideas - Creative, inviting */
.ideate-panel {
    border-left: 4px solid var(--accent-secondary);
}

/* Deliverables - Productive output */
.deliverables-panel {
    border-left: 4px solid var(--accent-primary);
}

/* JM's Tasks - Priority placement (prominent) */
.jm-tasks-panel {
    border-left: 4px solid #60a5fa;
}

/* Priority Panel Styling - Enhanced for top placement */
.priority-panel {
    border-left: 5px solid #f59e0b !important;
    box-shadow:
        0 0 25px rgba(245, 158, 11, 0.12),
        0 4px 12px rgba(0, 0, 0, 0.08) !important;
    background: linear-gradient(135deg, var(--surface-primary), rgba(245, 158, 11, 0.04)) !important;
}

.priority-panel .panel-header {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.02));
    padding: 1.25rem 1.5rem;
}

.priority-panel .panel-header h2 {
    font-size: 1.125rem;
}

.priority-panel .panel-content {
    min-height: 120px;
    max-height: 280px;
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
}

/* Priority Badge */
.priority-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 0.25rem;
    letter-spacing: 0.5px;
    margin-right: 0.625rem;
    text-transform: uppercase;
}

/* Completed - Subdued, archive feel */
.completed-panel {
    opacity: 0.85;
    border-left: 4px solid var(--text-muted);
}

.completed-panel:hover {
    opacity: 1;
}

/* Analytics - Data-focused */
.analytics-panel {
    border-left: 4px solid #8b5cf6;
}

/* ========================================
   COLLAPSIBLE PANEL SUPPORT
   ======================================== */

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--surface-secondary);
    border-bottom: 1px solid var(--border-primary);
    transition: background 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    user-select: none;
}

.panel-header:hover {
    background: rgba(99, 102, 241, 0.08);
}

.panel-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.collapse-icon {
    font-size: 0.625rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    width: 12px;
    text-align: center;
}

.panel.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.panel.collapsed .panel-content {
    display: none;
}

.panel-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.panel-header .count {
    background: rgba(99, 102, 241, 0.3);
    color: var(--accent-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.add-btn {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
}

.add-btn:hover {
    background: rgba(34, 197, 94, 0.3);
}

.panel-content {
    padding: 1rem 1.25rem;
    max-height: 400px;
    overflow-y: auto;
}

.empty-state {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

/* Task Items */
.task-item, .idea-item, .completed-item,
.task-card, .idea-card {
    background: var(--surface-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.task-item:hover, .idea-item:hover,
.task-card:hover, .idea-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.task-title, .idea-title,
.task-name, .idea-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.task-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.priority-high { color: var(--danger); }
.priority-medium { color: var(--warning); }
.priority-low { color: var(--success); }

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 999px;
    margin-top: 0.75rem;
    overflow: hidden;
}

.progress,
.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 999px;
    transition: width 0.4s ease;
}

/* Analytics Cards */
.analytics-grid,
.analytics-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.analytics-card {
    background: var(--surface-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.analytics-card .value,
.analytics-card .card-value {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--success));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.analytics-card .label,
.analytics-card .card-title {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Notifications Panel */
.notifications-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--surface-header);
    border-left: 1px solid var(--border-accent);
    z-index: 200;
    transition: right 0.3s ease, background 0.3s ease;
    backdrop-filter: blur(10px);
}

.notifications-panel.open {
    right: 0;
}

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

.notifications-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.clear-all {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.clear-all:hover {
    background: rgba(239, 68, 68, 0.1);
}

.notifications-list {
    padding: 1rem;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

/* Sub-agent List */
.sub-agent-list {
    list-style: none;
}

.sub-agent {
    margin: 0.75rem 0;
    padding: 1rem;
    background: var(--surface-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 0.5rem;
}

.sub-agent .name {
    font-weight: 500;
    color: var(--accent-secondary);
}

.sub-agent .task {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.status-working { color: var(--warning); }
.status-waiting { color: var(--text-secondary); }
.status-complete { color: var(--success); }

/* Sub-agents Panel (bottom right) */
.sub-agents-panel {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 320px;
    max-height: 300px;
    background: var(--surface-header);
    border: 1px solid rgba(192, 132, 252, 0.3);
    border-radius: 1rem;
    overflow: hidden;
    backdrop-filter: blur(10px);
    z-index: 50;
}

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

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

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

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

/* ========================================
   MODAL STYLES (Theme-aware)
   ======================================== */

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

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface-primary);
    border: 1px solid var(--border-accent);
    border-radius: 1rem;
    padding: 0;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
}

.modal-content.modal-large {
    max-width: 700px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-primary);
    background: var(--surface-secondary);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
    padding: 0.25rem;
}

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

/* Form Styles */
form {
    padding: 1.25rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-primary);
    border-radius: 0.375rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 0.2s, background 0.2s;
}

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

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

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

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-primary);
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

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

.btn-primary:hover {
    background: #6366f1;
}

.btn-secondary {
    background: transparent;
    border-color: var(--border-accent);
    color: var(--text-primary);
}

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

.btn-small {
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
    border-radius: 0.25rem;
    cursor: pointer;
    border: 1px solid var(--border-primary);
    background: var(--surface-secondary);
    color: var(--text-primary);
    transition: all 0.2s;
}

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

.btn-success {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.btn-success:hover {
    background: rgba(34, 197, 94, 0.3);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

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

.btn-start {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

.btn-start:hover {
    background: rgba(59, 130, 246, 0.3);
}

/* Task elapsed time indicator */
.task-elapsed {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0.25rem 0;
    font-style: italic;
}

/* Timeframe Select */
.timeframe-select {
    padding: 0.375rem 0.625rem;
    border: 1px solid var(--border-primary);
    border-radius: 0.375rem;
    background: var(--surface-secondary);
    color: var(--text-primary);
    font-size: 0.75rem;
    cursor: pointer;
}

/* ========================================
   TASK CHECKBOX STYLES
   ======================================== */

.task-checkbox {
    position: relative;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.task-checkbox input {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-accent);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.task-checkbox:hover .checkmark {
    border-color: var(--accent-primary);
}

.task-checkbox input:checked + .checkmark {
    background: var(--success);
    border-color: var(--success);
}

.checkmark::after {
    content: '\2713';
    color: white;
    opacity: 0;
    font-size: 12px;
    font-weight: bold;
    transition: opacity 0.2s ease;
}

.task-checkbox input:checked + .checkmark::after {
    opacity: 1;
}

/* Animation for completing task */
.task-completing {
    animation: completeSlide 0.5s ease forwards;
}

@keyframes completeSlide {
    to {
        opacity: 0;
        transform: translateX(50px);
    }
}

/* Task Card Enhancements */
.task-header,
.idea-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.task-category {
    margin-left: auto;
    font-size: 0.625rem;
    padding: 0.125rem 0.5rem;
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-primary);
    border-radius: 999px;
    text-transform: uppercase;
}

.task-description,
.idea-description,
.task-outcome {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.task-actions,
.idea-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.time-saved {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 500;
}

/* Category Bars */
.category-bars {
    margin-top: 0.5rem;
}

.category-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
}

.cat-name {
    width: 70px;
    color: var(--text-secondary);
}

.cat-bar {
    flex: 1;
    height: 8px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.cat-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.cat-fill.coding { background: #22c55e; }
.cat-fill.writing { background: #f59e0b; }
.cat-fill.analysis { background: #ef4444; }
.cat-fill.scheduling { background: #8b5cf6; }

.cat-count {
    width: 30px;
    text-align: right;
    color: var(--text-muted);
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: toastSlideIn 0.3s ease, toastFadeOut 0.3s ease 2.7s forwards;
    max-width: 300px;
}

.toast-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.toast-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.toast-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.toast-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastFadeOut {
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* ========================================
   TASK COMPLETION ANIMATIONS
   ======================================== */

.task-completing {
    animation: taskComplete 0.5s ease forwards;
}

@keyframes taskComplete {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        background: rgba(34, 197, 94, 0.2);
    }
    100% {
        transform: scale(0.95) translateX(20px);
        opacity: 0;
    }
}

/* Success flash on checkbox */
.task-checkbox.checked-animation .checkmark {
    animation: checkPop 0.3s ease;
}

@keyframes checkPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Duration badge on completed tasks */
.task-duration {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--surface-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    margin-left: auto;
}

/* Deliverable Cards */
.deliverable-card {
    background: var(--surface-secondary);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.deliverable-card:hover {
    border-color: rgba(34, 197, 94, 0.4);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.deliverable-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.deliverable-type {
    font-size: 1rem;
}

.deliverable-name {
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.deliverable-path {
    font-size: 0.75rem;
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
    word-break: break-all;
    margin-bottom: 0.5rem;
}

.deliverable-description {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.deliverable-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* Modal Animation */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content {
    animation: modalSlideIn 0.2s ease-out;
}

/* ========================================
   DRAG AND DROP
   ======================================== */

/* Make cards draggable */
[draggable="true"] {
    cursor: grab;
    user-select: none;
}

[draggable="true"]:active {
    cursor: grabbing;
}

/* Card being dragged */
.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Drop target indicator */
.drag-over {
    border: 2px dashed var(--accent-primary) !important;
    background: rgba(99, 102, 241, 0.1) !important;
}

/* Smooth transitions for reordering */
.panel-content > * {
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Drop placeholder */
.drop-placeholder {
    height: 60px;
    border: 2px dashed var(--border-accent);
    border-radius: 0.5rem;
    background: rgba(99, 102, 241, 0.05);
    margin-bottom: 0.75rem;
}

/* Drag handle icon (optional visual indicator) */
.drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    color: var(--text-muted);
    cursor: grab;
    margin-right: 0.5rem;
}

.drag-handle:hover {
    color: var(--text-secondary);
}

/* Touch drag styles */
.touch-dragging {
    position: fixed;
    z-index: 1000;
    opacity: 0.9;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transform: scale(1.02);
    pointer-events: none;
}

.panel-content {
    touch-action: pan-y;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Show sr-only content when focused within */
.sr-only-focusable:focus,
.sr-only-focusable:focus-within {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Focus styles for keyboard navigation */
[tabindex="0"]:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.task-card:focus,
.idea-card:focus,
.deliverable-card:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.2);
}

/* Live region for announcements */
#drag-announcer {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Reorder instructions (hidden but accessible) */
.reorder-instructions {
    position: absolute;
    left: -9999px;
}

/* ========================================
   COMPACT ANALYTICS SUMMARY
   ======================================== */

.analytics-content {
    padding: 1rem 1.25rem;
}

.analytics-summary {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-secondary);
}

.summary-card {
    flex: 1;
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: var(--surface-secondary);
    border-radius: 0.5rem;
    border: 1px solid var(--border-secondary);
}

.summary-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--success));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.summary-label {
    display: block;
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

.category-section {
    margin-top: 0.5rem;
}

.section-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1200px) {
    .panels-grid {
        grid-template-columns: 1fr 1fr;
    }

    .panels-grid .right-column {
        grid-column: span 2;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 900px) {
    .panels-grid {
        grid-template-columns: 1fr;
    }

    .panels-grid .right-column {
        grid-column: span 1;
        display: flex;
        flex-direction: column;
    }

    .priority-panel .panel-content {
        min-height: 100px;
        max-height: 220px;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    .panels-grid {
        grid-template-columns: 1fr;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .header-center {
        order: -1;
    }

    .priority-panel .panel-header {
        padding: 1rem 1.25rem;
    }

    .priority-panel .panel-header h2 {
        font-size: 1rem;
    }

    .priority-panel .panel-content {
        min-height: 80px;
        max-height: 180px;
        padding: 1rem 1.25rem;
    }

    .priority-badge {
        font-size: 0.55rem;
        padding: 0.2rem 0.5rem;
    }

    .analytics-summary {
        flex-direction: column;
        gap: 0.5rem;
    }

    .summary-card {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0.75rem;
    }

    .summary-value {
        font-size: 1rem;
    }

    .summary-label {
        margin-top: 0;
    }
}

/* ========================================
   NOTES MODAL
   ======================================== */

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-primary);
    background: var(--surface-secondary);
}

.notes-task-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-secondary);
}

.notes-textarea {
    width: 100%;
    padding: 1rem;
    background: var(--surface-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 150px;
}

.notes-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.notes-textarea::placeholder {
    color: var(--text-muted);
}

/* ========================================
   TASK NOTES
   ======================================== */

/* Notes button */
.btn-notes {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--accent-primary);
}

.btn-notes:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-primary);
}

/* Has notes indicator icon */
.has-notes-icon {
    font-size: 0.75rem;
    margin-left: 0.5rem;
    opacity: 0.8;
    cursor: help;
    animation: notesPulse 2s ease-in-out infinite;
}

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

/* Task name with icon */
.task-header .task-name {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Notes modal specific */
#notesModal .modal-content {
    max-width: 500px;
}

#notesModal .modal-body {
    padding: 1.5rem;
}

#notesModal .modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-secondary);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}
