/* Executr App Styles */

:root {
    --primary-color: #10b981;
    --primary-dark: #059669;
    --secondary-color: #6b7280;
    --background: #f9fafb;
    --surface: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --priority-1: #ef4444;
    --priority-2: #f59e0b;
    --priority-3: #eab308;
    --priority-4: #84cc16;
    --priority-5: #9ca3af;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.app-header {
    background: var(--surface);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.app-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

.header-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Goals Dashboard */
.goals-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.goal-card {
    background: var(--surface);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.goal-label {
    font-weight: 600;
    color: var(--text-primary);
}

.goal-count {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.goal-progress {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.goal-progress-bar {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.btn-goal-edit {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

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

/* Main Content */
.main-content {
    background: var(--surface);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.tasks-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.tasks-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
}

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

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

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

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

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

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

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

/* Tasks List */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    position: relative;
}

.task-item:hover {
    box-shadow: var(--shadow-md);
}

.task-item.completed {
    opacity: 0.6;
}

.task-item.completed .task-title {
    color: var(--text-secondary);
    position: relative;
}

/* Animated strikethrough line */
.task-title {
    position: relative;
    display: inline;
    line-height: 1.4;
}

.task-title::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 0;
    height: 2px;
    background: var(--text-primary);
    transform: translateY(-50%);
    transition: none;
    pointer-events: none;
}

.task-item.completed .task-title::after {
    width: 100%;
}

/* Completing animation (before state change) */
.task-item.completing .task-title::after {
    animation: strikethrough 0.4s ease-out forwards;
}

@keyframes strikethrough {
    0% {
        width: 0;
        opacity: 1;
    }
    100% {
        width: 100%;
        opacity: 0.7;
    }
}

.task-item.hidden {
    display: none;
}

.task-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
    margin-right: 12px;
    min-height: 44px;
    justify-content: center;
}

.task-select-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    position: relative;
}

.task-select-checkbox::after {
    content: 'Select';
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: var(--text-secondary);
    white-space: nowrap;
    opacity: 0.7;
    pointer-events: none;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    background: white;
    position: relative;
    transition: all 0.2s ease;
}

.task-checkbox::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.task-checkbox::before {
    content: 'Done';
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: var(--text-secondary);
    white-space: nowrap;
    opacity: 0.7;
    pointer-events: none;
}

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

.task-checkbox:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

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

.task-content {
    flex: 1;
    min-width: 0;
}

.task-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.task-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 0 1 auto;
    min-width: 0;
    max-width: fit-content;
    line-height: 1.4;
}

.task-priority-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.priority-1 { background: var(--priority-1); color: white; }
.priority-2 { background: var(--priority-2); color: white; }
.priority-3 { background: var(--priority-3); color: white; }
.priority-4 { background: var(--priority-4); color: white; }
.priority-5 { background: var(--priority-5); color: white; }

.task-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-secondary);
}

.task-reorder-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s ease;
    min-width: 32px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-reorder-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.task-reorder-btn:active {
    transform: scale(0.95);
}

.task-status {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.task-status.pending { background: #f3f4f6; color: var(--text-secondary); }
.task-status.in-progress { background: #dbeafe; color: #1e40af; }
.task-status.completed { background: #d1fae5; color: #065f46; }
.task-status.blocked { background: #fee2e2; color: #991b1b; }

.task-description {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.task-reorder-controls {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    align-items: center;
    margin-left: auto;
    margin-right: 8px;
}

.task-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.task-action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    transition: color 0.2s;
}

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

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

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--surface);
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
}

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

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

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

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

.modal-body {
    padding: 20px;
}

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

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-textarea {
    resize: vertical;
}

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

/* Import Options */
.import-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.import-option-btn {
    width: 100%;
    justify-content: center;
    padding: 14px;
}

.import-option-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        padding: 10px;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .tasks-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .tasks-controls {
        width: 100%;
    }

    .filter-select {
        flex: 1;
        min-width: 150px;
    }

    .task-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 20px;
        min-height: 100px;
        position: relative;
    }

    .task-checkboxes {
        align-self: flex-start;
        flex-direction: row;
        gap: 12px;
        margin-right: 0;
        min-height: auto;
        order: 1;
    }

    .task-content {
        order: 2;
        width: 100%;
    }

    .task-reorder-controls {
        order: 0;
        align-self: flex-end;
        flex-direction: row;
        gap: 8px;
        position: absolute;
        top: 16px;
        right: 12px;
        margin-right: 0;
    }

    .task-actions {
        order: 4;
        align-self: flex-end;
        margin-top: 0;
        position: absolute;
        right: 12px;
        bottom: 20px;
    }

    .task-reorder-btn {
        min-width: 40px;
        height: 36px;
        padding: 4px 8px;
        font-size: 18px;
    }

    .task-select-checkbox::after,
    .task-checkbox::before {
        display: none; /* Hide labels on mobile to save space */
    }


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

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

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

/* Celebration Animation */
@keyframes celebrate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.goal-card.celebrate {
    animation: celebrate 0.5s ease;
}

