/* === TodoExtractor App Styles === */

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --success: #22c55e;
    --success-hover: #16a34a;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    --column-bg: #f1f5f9;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.home-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 24px;
}

.home-header {
    text-align: center;
    margin-bottom: 48px;
}

.home-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 12px;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.home-subtitle code {
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--text);
}

.session-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.choice-card {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.choice-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.choice-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.choice-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text);
}

.choice-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.5;
}

.choice-card p code {
    background: #e2e8f0;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.85em;
}

.board-container {
    padding: 24px;
    min-height: 100vh;
}

.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 0 4px;
}

.search-input {
    flex: 1;
    max-width: 400px;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s;
    background: var(--card-bg);
}

.search-input:focus {
    border-color: var(--primary);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-results {
    font-size: 0.85rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.board-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.board-header-left h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.back-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.task-count {
    color: var(--text-light);
    font-size: 0.9rem;
    background: var(--column-bg);
    padding: 4px 12px;
    border-radius: 20px;
}

.board-header-actions {
    display: flex;
    gap: 8px;
}

.columns-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    align-items: start;
}

.task-column {
    background: var(--column-bg);
    border-radius: var(--radius);
    padding: 16px;
    min-width: 0;
    transition: box-shadow 0.15s, border-color 0.15s;
    outline: 2px solid transparent;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px 12px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 8px;
    gap: 8px;
}

.column-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.column-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.column-header-actions .column-count {
    background: var(--card-bg);
    color: var(--text-light);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    white-space: nowrap;
    margin-right: 4px;
}

.column-rename-form {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.rename-input {
    flex: 1;
    min-width: 60px;
    padding: 4px 8px;
    border: 2px solid var(--primary);
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    outline: none;
    background: white;
}

.column-tasks {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 4px;
    transition: all 0.15s ease;
    box-shadow: var(--shadow);
}

.task-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}

.task-grip {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 4px 2px;
    cursor: grab;
    user-select: none;
    line-height: 1;
    transition: color 0.15s;
}

.task-grip:active {
    cursor: grabbing;
}

.task-card:hover .task-grip {
    color: var(--text-light);
}

.task-card.dragging {
    opacity: 0.4;
    border-style: dashed;
}

.task-card.completed {
    opacity: 0.65;
    background: #fafaf9;
}

.task-card.completed .task-text {
    text-decoration: line-through;
    color: var(--text-light);
}

.task-content {
    flex: 1;
    min-width: 0;
    cursor: pointer;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.task-number {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.task-type-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #fef3c7;
    color: #92400e;
}

.task-text {
    font-size: 0.9rem;
    word-break: break-word;
    flex: 1;
    min-width: 0;
}

.task-location {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    background: var(--column-bg);
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

.task-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s;
}

.task-card:hover .task-actions {
    opacity: 1;
}

.file-input-btn {
    width: 100%;
    margin-top: 12px;
    padding: 8px 12px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-light);
    transition: all 0.15s ease;
    text-align: center;
}

.file-input-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f8f7ff;
}

.file-input-btn::file-selector-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    margin-right: 8px;
    transition: background 0.15s;
}

.file-input-btn::file-selector-button:hover {
    background: var(--primary-hover);
}

.btn {
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: var(--success-hover);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
}

.btn-icon {
    background: transparent;
    border: none;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-light);
    transition: all 0.15s;
    line-height: 1;
}

.btn-icon:hover {
    background: var(--column-bg);
    color: var(--text);
}

.btn-danger-icon:hover {
    background: #fee2e2;
    color: var(--danger);
}

.task-edit-form {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    flex-wrap: wrap;
}

.task-edit-form input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.edit-input {
    flex: 1;
    min-width: 100px;
    padding: 6px 10px;
    border: 2px solid var(--primary);
    border-radius: 4px;
    font-size: 0.9rem;
    outline: none;
    background: white;
}

.edit-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.add-task-row {
    margin-top: 4px;
}

.add-task-row input {
    width: 100%;
    padding: 8px 10px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: transparent;
    outline: none;
    transition: all 0.15s;
    color: var(--text-light);
}

.add-task-row input:focus {
    border-color: var(--primary);
    border-style: solid;
    background: white;
    color: var(--text);
}

.add-task-row input::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 420px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.modal-content h3 {
    margin: 0 0 12px;
    font-size: 1.3rem;
}

.modal-content p {
    color: var(--text-light);
    margin: 0 0 24px;
    line-height: 1.5;
}

.modal-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    outline: none;
    margin-bottom: 20px;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.modal-input:focus {
    border-color: var(--primary);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.loading-spinner {
    text-align: center;
    background: var(--card-bg);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.loading-spinner p {
    margin: 16px 0 0;
    color: var(--text-light);
    font-weight: 500;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-board {
    text-align: center;
    padding: 80px 24px;
}

.empty-board p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin: 0 0 20px;
}

.strikethrough {
    text-decoration: line-through;
    color: var(--text-light);
}

/* === Notifications === */

.notification {
    position: fixed;
    top: 16px;
    right: 16px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1001;
    animation: slideIn 0.3s ease;
    font-weight: 500;
}

.notification-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Error modal extends the base modal */
.modal-content.error-modal {
    border-top: 4px solid var(--danger);
}

.error-modal h3 {
    color: var(--danger);
}

.error-modal p {
    color: #991b1b;
    background: #fef2f2;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: left;
    word-break: break-word;
}

@media (max-width: 768px) {
    .home-container {
        padding: 32px 16px;
    }

    .home-title {
        font-size: 1.8rem;
    }

    .session-choices {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .choice-card {
        padding: 20px 16px;
    }

    .choice-icon {
        font-size: 2rem;
    }

    .columns-container {
        grid-template-columns: 1fr;
    }

    .board-container {
        padding: 16px;
    }

    .board-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .session-choices {
        grid-template-columns: 1fr;
    }
}