:root {
    --bg-main: #f9fafb;          
    --header-bg: #ffffff;
    --card-bg: #ffffff;
    --card-alt: #f3f4f6;

    --primary: #4f46e5;
    --primary-hover: #4338ca;

    --text-main: #111827;
    --text-muted: #6b7280;

    --border-color: #e5e7eb;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 25px rgba(0, 0, 0, 0.12);

    --border-radius: 12px;
    --border-radius-sm: 8px;

    --transition: all 0.2s ease;
  }


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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header */
.header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

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

.header-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.header-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
    font-weight: 400;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
}

/* Action Bar */
.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.filter-label i {
    color: var(--primary);
}

.form-select-sm {
    min-width: 200px;
    background-color: var(--card-bg);
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: var(--transition);
}

.form-select-sm:focus {
    background-color: var(--card-bg);
    border-color: var(--primary);
    color: var(--text-main);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

.form-select-sm option {
    background-color: var(--card-bg);
    color: var(--text-main);
}

.action-bar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Buttons */
.btn {
    border-radius: var(--border-radius-sm);
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-primary:active {
    transform: translateY(0);
}

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

.btn-secondary:hover {
    background-color: var(--card-alt);
    border-color: var(--border-color);
    color: var(--text-main);
}

/* Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    background: var(--card-bg);
    transition: var(--transition);
}

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

.task-list-card {
    margin-bottom: 0;
}

.card-body {
    padding: 1.5rem;
}

/* Task List */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-item {
    background: var(--card-alt);
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    cursor: default;
    position: relative;
}

.task-item.draggable {
    cursor: move;
}

.task-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    border-color: var(--primary);
}

.task-item.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.task-item.drag-over {
    border-top: 3px solid var(--primary);
    margin-top: 0.5rem;
    background-color: rgba(99, 102, 241, 0.1);
}

/* Drag Handle */
.drag-handle {
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: grab;
    user-select: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    padding: 0.25rem;
}

.drag-handle:active {
    cursor: grabbing;
}

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


/* Task Content */
.task-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.task-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
    margin: 0;
    flex: 1;
    min-width: 200px;
    line-height: 1.5;
}

.task-deadline {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.task-deadline i {
    color: var(--primary);
    font-size: 0.875rem;
}

/* Badges */
.badge {
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.8rem;
    white-space: nowrap;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
}

.badge-project {
    background-color: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    border-color: rgba(99, 102, 241, 0.3);
}

/* Priority Badges - 3 Level System */
.badge-priority {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    transition: var(--transition);
    border: 1px solid transparent;
}

.badge-priority i {
    font-size: 0.875rem;
}

/* High Priority - Red */
.badge-priority.priority-1 {
    background-color: rgba(239, 68, 68, 0.15);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.3);
}

.badge-priority.priority-1:hover {
    background-color: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

/* Medium Priority - Orange */
.badge-priority.priority-2 {
    background-color: rgba(251, 191, 36, 0.15);
    color: #d97706;
    border-color: rgba(251, 191, 36, 0.3);
}

.badge-priority.priority-2:hover {
    background-color: rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.5);
}

/* Low Priority - Green */
.badge-priority.priority-3 {
    background-color: rgba(34, 197, 94, 0.15);
    color: #16a34a;
    border-color: rgba(34, 197, 94, 0.3);
}

.badge-priority.priority-3:hover {
    background-color: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.5);
}

/* Task Actions */
.task-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
}

.btn-icon:hover {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.btn-icon.btn-delete:hover {
    background-color: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 1.25rem;
    opacity: 0.4;
    color: var(--text-muted);
}

.empty-state p {
    font-size: 1rem;
    margin: 0;
    color: var(--text-muted);
    font-weight: 500;
}

/* Deadline Status */
.deadline-overdue {
    color: #fca5a5;
    font-weight: 600;
}

.deadline-today {
    color: #fcd34d;
    font-weight: 600;
}

.deadline-tomorrow {
    color: var(--primary);
    font-weight: 600;
}

.deadline-soon {
    color: #fcd34d;
    font-weight: 500;
}

/* Modal */
.modal-content {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    color: var(--text-main);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
}

.modal-title i {
    color: var(--primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.7;
}

.btn-close:hover {
    opacity: 1;
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    background-color: var(--card-alt);
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    transition: var(--transition);
    font-size: 0.95rem;
    color: var(--text-main);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--card-alt);
    border-color: var(--primary);
    color: var(--text-main);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-select option {
    background-color: var(--card-bg);
    color: var(--text-main);
}

.text-danger {
    color: #fca5a5 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 1.25rem 0;
    }

    .header-title {
        font-size: 1.5rem;
    }

    .header-subtitle {
        font-size: 0.85rem;
    }

    .main-content {
        padding: 1.5rem 0;
    }

    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .action-bar-left {
        flex-direction: column;
        align-items: stretch;
    }

    .form-select-sm {
        width: 100%;
    }

    .action-bar-right {
        width: 100%;
    }

    .action-bar-right .btn {
        width: 100%;
        justify-content: center;
    }

    .card-body {
        padding: 1rem;
    }

    .task-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
    }

    .task-content {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .task-actions {
        width: 100%;
        justify-content: flex-end;
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .task-name {
        min-width: 100%;
    }
}

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

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

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background-color: rgba(99, 102, 241, 0.3);
    color: var(--text-main);
}

/* Bootstrap Modal Backdrop Override */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-backdrop.show {
    opacity: 0.8;
}
