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

:root {
    --primary: #3b82f6;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --secondary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --dark-light: #374151;
    --gray: #6b7280;
    --gray-light: #d1d5db;
    --gray-lighter: #e5e7eb;
    --gray-lightest: #f3f4f6;
    --white: #ffffff;
    --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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* App Wrapper */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--white);
    border-right: 1px solid var(--gray-lighter);
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
}

.sidebar-header {
    padding: 0 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-lighter);
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    font-size: 1.75rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 1rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--gray);
    font-weight: 500;
}

.nav-item:hover {
    background: var(--gray-lightest);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-item i {
    font-size: 1.1rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.header-content h1 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.header-subtitle {
    color: var(--gray);
    font-size: 0.95rem;
}

.header-stats {
    display: flex;
    gap: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Add Task Section */
.add-task-container {
    margin-bottom: 2rem;
}

.input-wrapper {
    display: flex;
    gap: 1rem;
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.task-input {
    flex: 1;
    padding: 1rem 1.25rem;
    border: 2px solid var(--gray-lighter);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--dark);
    transition: var(--transition);
    outline: none;
}

.task-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.task-input::placeholder {
    color: var(--gray-light);
}

.add-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    white-space: nowrap;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

/* Tasks Section */
.tasks-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.tasks-group {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--gray-lightest);
    border-bottom: 1px solid var(--gray-lighter);
}

.group-header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    color: var(--dark);
}

.group-header i {
    color: var(--primary);
}

.group-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
}

.tasks-list {
    padding: 1rem;
    max-height: 600px;
    overflow-y: auto;
}

.tasks-list::-webkit-scrollbar {
    width: 6px;
}

.tasks-list::-webkit-scrollbar-track {
    background: var(--gray-lightest);
}

.tasks-list::-webkit-scrollbar-thumb {
    background: var(--gray-light);
    border-radius: 3px;
}

.tasks-list::-webkit-scrollbar-thumb:hover {
    background: var(--gray);
}

/* Task Item */
.task-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-lightest);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: var(--transition);
    border-left: 4px solid var(--primary);
}

.task-item:hover {
    background: var(--white);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.task-item.completed {
    border-left-color: var(--success);
    opacity: 0.7;
}

.task-checkbox {
    width: 24px;
    height: 24px;
    min-width: 24px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--primary);
}

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

.task-text {
    font-size: 1rem;
    color: var(--dark);
    word-break: break-word;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: var(--gray);
}

.task-meta {
    font-size: 0.8rem;
    color: var(--gray);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.task-actions {
    display: flex;
    gap: 0.5rem;
}

.task-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.task-btn-edit {
    background: var(--primary-light);
    color: var(--primary);
}

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

.task-btn-delete {
    background: #fee2e2;
    color: var(--danger);
}

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

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

.empty-state i {
    font-size: 3rem;
    color: var(--gray-light);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.empty-state small {
    font-size: 0.85rem;
    color: var(--gray);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-danger {
    border-top: 4px solid var(--danger);
}

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

.modal-header h3 {
    font-size: 1.25rem;
    color: var(--dark);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-lightest);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--gray-lighter);
    color: var(--dark);
}

.modal-body {
    padding: 1.5rem;
}

.modal-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--gray-lighter);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--dark);
    transition: var(--transition);
    outline: none;
}

.modal-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-lighter);
    color: var(--dark);
}

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

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

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Notification */
.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    gap: 1rem;
    z-index: 2000;
    animation: slideInRight 0.3s ease;
}

.notification.show {
    display: flex;
}

.notification.success {
    border-left: 4px solid var(--success);
}

.notification.error {
    border-left: 4px solid var(--danger);
}

.notification.info {
    border-left: 4px solid var(--primary);
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }

    .main-content {
        margin-left: 240px;
    }

    .tasks-section {
        grid-template-columns: 1fr;
    }

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

    .header-stats {
        width: 100%;
        justify-content: space-around;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--gray-lighter);
        padding: 1rem 0;
    }

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

    .sidebar-nav {
        flex-direction: row;
        padding: 0 1rem;
        gap: 0.25rem;
    }

    .nav-item {
        flex: 1;
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .nav-item span {
        display: none;
    }

    .app-header {
        padding: 1.5rem;
    }

    .header-content h1 {
        font-size: 1.5rem;
    }

    .header-stats {
        gap: 1rem;
    }

    .input-wrapper {
        flex-direction: column;
        padding: 1rem;
    }

    .add-btn {
        width: 100%;
        justify-content: center;
    }

    .tasks-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .modal-content {
        width: 95%;
    }
}

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

    .app-header {
        padding: 1rem;
        gap: 1rem;
    }

    .header-content h1 {
        font-size: 1.25rem;
    }

    .header-stats {
        gap: 0.75rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .input-wrapper {
        padding: 1rem;
    }

    .task-input {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }

    .add-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .add-btn span {
        display: none;
    }

    .group-header {
        padding: 1rem;
    }

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

    .task-item {
        padding: 0.75rem;
    }

    .task-text {
        font-size: 0.95rem;
    }

    .task-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .modal-content {
        width: 95%;
    }

    .modal-header h3 {
        font-size: 1.1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 1rem;
        gap: 0.75rem;
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .notification {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        padding: 0.75rem 1rem;
    }
}
