* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000000;
    color: #e0e0e0;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr min(700px, 45%) 1fr;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

.container {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    padding-top: 2rem;
    padding-bottom: 2rem;
    height: 100vh;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.task-list {
    width: 100%;
    max-width: 100%;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: #333 #1a1a1a;
    position: relative;
}

.task-list-inner {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.task-list::-webkit-scrollbar {
    width: 8px;
}

.task-list::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.task-list::-webkit-scrollbar-thumb {
    background-color: #333;
    border-radius: 4px;
}

.task-list-inner:empty::before {
    content: "no tasks yet";
    display: block;
    text-align: center;
    color: #666;
    font-size: 0.95rem;
    font-weight: 300;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

.task-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid #1a1a1a;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    width: 90%;
    margin: 0 auto;
}

.task-item.adding {
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.task-item.removing {
    animation: slideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.task-item:hover {
    padding-left: 0.5rem;
}

.task-item:hover .delete-button {
    opacity: 1;
    pointer-events: all;
}

.checkbox-wrapper {
    position: relative;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.checkbox-custom {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border: 2px solid #333;
    border-radius: 4px;
    transition: all 0.2s ease;
    pointer-events: none;
}

.checkbox-wrapper input[type="checkbox"]:hover ~ .checkbox-custom {
    border-color: #555;
}

.checkbox-wrapper input[type="checkbox"]:checked ~ .checkbox-custom {
    background: #e0e0e0;
    border-color: #e0e0e0;
}

.checkbox-wrapper input[type="checkbox"]:checked ~ .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.task-title {
    flex: 1;
    background: transparent;
    border: none;
    font-family: inherit;
    outline: none;
    color: #e0e0e0;
    transition: color 0.2s ease;
    width: 95%;
    font-size: 0.95rem;
    padding-bottom: 3px;
}

.task-title:focus {
    cursor: text;
    color: #fff;
}

.task-title::placeholder {
    color: #999;
    opacity: 1;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.task-title:focus::placeholder {
    color: #bbb;
}

.task-title::selection {
    background: #333;
}

.delete-button {
    opacity: 0;
    pointer-events: none;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.25rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-button:hover {
    color: #e0e0e0;
}

.subtask-counter {
    font-size: 0.8rem;
    color: #666;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: #1a1a1a;
    margin-left: auto;
}

.task-title,
.sidebar-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    -webkit-mask-image: linear-gradient(to right, black 0%, black 90%, transparent 100%);
    mask-image: linear-gradient(to right, black 0%, black 90%, transparent 100%);
}

.subtask {
    margin-left: 2.5rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #111;
}

.add-button {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #e0e0e0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.add-button:hover {
    background: #252525;
    transform: scale(1.05) rotate(90deg);
}

.add-button:active {
    transform: scale(0.95) rotate(180deg);
}

.add-button svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-icon {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 0;
}

.settings-icon:hover {
    color: #e0e0e0;
    background: #1a1a1a;
    transform: rotate(30deg);
}

.settings-icon:active {
    transform: rotate(60deg);
}


.completed-section {
    width: 25%;
    padding-left: 0.5rem;
    height: 0;
    flex-direction: column;
    transition: height 0.3s ease;
    position: fixed;
    bottom: 2.5rem;
    left: 0;
    z-index: 1;
}

.completed-section.expanded {
    height: 50vh;
}

.completed-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.75rem 0;
    color: #666;
    font-size: 0.9rem;
    user-select: none;
    position: relative;
    z-index: 2;
    width: 50%;
}

.completed-header:hover {
    color: #999;
    transition: color 0.3s ease;
}

.arrow-icon {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.completed-header.collapsed .arrow-icon {
    transform: rotate(-90deg);
}

.completed-list {
    flex: 1;
    overflow-y: auto;
    transition: opacity 0.45s ease;
    opacity: 1;
    scrollbar-width: thin;
    scrollbar-color: #333 #1a1a1a;
    max-height: 50vh;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.completed-list::-webkit-scrollbar {
    width: 8px;
}

.completed-list::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.completed-list::-webkit-scrollbar-thumb {
    background-color: #333;
    border-radius: 4px;
}

.completed-list.collapsed {
    opacity: 0;
    pointer-events: none;
}

.sidebar {
    grid-column: 3;
    height: 100vh;
    background: #0a0a0a;
    border-left: 1px solid #1a1a1a;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    width: 30vw;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem;
    overflow: hidden;
    margin-right: 3rem;
    color: #e0e0e0;
    font-size: 1rem;
}

.sidebar-title {
    flex: 1;
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 500;
    outline: none;
    transition: color 0.2s ease;
    width: 100%;
    padding-bottom: 3px;
}

.sidebar-title:focus {
    cursor: text;
    color: #fff;
}

.sidebar-title::placeholder {
    color: #666;
    font-weight: normal;
}

.sidebar-title:focus::placeholder {
    color: #999;
    transition: color 0.2s ease;
}

.close-sidebar {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    right: 0;
    margin-right: 1.5rem;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transform-origin: center;
    transition: all 0.2s ease;
    z-index: 3;
}

.close-sidebar:hover {
    color: #999;
    transform: scale(1.05) rotate(90deg);
}

.close-sidebar:active {
    transform: scale(0.95) rotate(180deg);
}

.task-description {
    flex: 1;
    background: #0a0a0a;
    color: #e0e0e0;
    border: none;
    border-top: 1px solid #1a1a1a;
    font-family: inherit;
    font-size: 0.9rem;
    resize: none;
    outline: none;
    transition: border-color 0.2s ease;
    line-height: 1.6;
    padding: 1rem;
    margin-bottom: 2rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #333 #1a1a1a;
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 90%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 0%, black 90%, transparent 100%);
}

.task-description::-webkit-scrollbar {
    width: 8px;
}

.task-description::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.task-description::-webkit-scrollbar-thumb {
    background-color: #333;
    border-radius: 4px;
}

.task-description:focus {
    border-color: #333;
}

.task-description:focus::placeholder {
    color: #999;
    transition: color 0.2s ease;
}

.task-description::selection {
    background: #333;
}

.subtasks-list {
    margin-bottom: 4rem;
    max-height: 18rem;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 90%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 0%, black 90%, transparent 100%);
    scrollbar-width: thin;
    scrollbar-color: #333 #1a1a1a;
}

.subtask-title {
    background: transparent;
    border: none;
    font-family: inherit;
    outline: none;
    color: #e0e0e0;
    transition: color 0.2s ease;
    width: 95%;
    font-size: 0.95rem;
}

.add-subtask-button {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    left: 1rem;
    bottom: 1rem;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: absolute;
}

.add-subtask-button:hover {
    background: #252525;
    color: #e0e0e0;
    transform: scale(1.05) rotate(90deg);
}

.add-subtask-button:active {
    transform: scale(0.95) rotate(180deg);
}

.add-subtask-button svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(0);
    background: rgba(0, 0, 0, 0);
}

.settings-overlay.visible {
    opacity: 1;
    pointer-events: all;
    backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.2);
}

.settings-box {
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.settings-overlay.visible .settings-box {
    transform: scale(1);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.settings-header h2 {
    font-size: 1.2rem;
    font-weight: 500;
    color: #e0e0e0;
}

.close-settings {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.close-settings:hover {
    color: #e0e0e0;
}

.settings-content {
    color: #999;
    font-size: 0.9rem;
}

.settings-option {
    margin: 1rem 0;
}

.settings-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.sync-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.sync-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #444;
    display: inline-block;
}

.sync-dot.offline {
    background: #7f1d1d;
}

.sync-dot.syncing {
    background: #b45309;
    animation: pulse 1s infinite;
}

.sync-dot.online {
    background: #166534;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
    }
}