@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 400;
    src: url('../vendor/montserrat/montserrat-regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 500;
    src: url('../vendor/montserrat/montserrat-medium.woff2') format('woff2');
}

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 600;
    src: url('../vendor/montserrat/montserrat-semibold.woff2') format('woff2');
}

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 700;
    src: url('../vendor/montserrat/montserrat-bold.woff2') format('woff2');
}

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

body {
    font-family: 'Montserrat', sans-serif;
    background: #f0f0f0;
    color: #111;
    line-height: 1.4;
    font-size: 14px;
}

#filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}

#filter-buttons {
    display: flex;
    gap: 4px;
}

#filter-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
}

.toggle-label input {
    display: none;
}

.toggle-switch {
    width: 32px;
    height: 18px;
    background: #ccc;
    border-radius: 9px;
    position: relative;
    transition: background 0.2s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.toggle-label input:checked + .toggle-switch {
    background: #222;
}

.toggle-label input:checked + .toggle-switch::after {
    transform: translateX(14px);
}

#search {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    width: 300px;
    outline: none;
}

#search:focus {
    border-color: #999;
}

#search::placeholder {
    color: #aaa;
}

.filter-btn {
    padding: 6px 12px;
    background: transparent;
    color: #777;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.filter-btn:hover {
    color: #111;
}

.filter-btn.active {
    background: #222;
    color: #fff;
}

main {
    padding: 16px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

#projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    align-items: stretch;
}

.project-card {
    background: #fff;
    border-radius: 8px;
    padding: 14px;
    border: 1px solid #e0e0e0;
    height: 100%;
}

.add-project-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    border: 2px dashed #ddd;
    background: transparent;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    padding: 0;
}

.add-project-card:hover {
    border-color: #999;
    background: #fafafa;
}

.add-project-card i {
    font-size: 32px;
    color: #ccc;
    transition: color 0.15s;
}

.add-project-card:hover i {
    color: #888;
}

@media (max-width: 1400px) {
    #projects-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    #projects-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    #projects-container {
        grid-template-columns: 1fr;
    }

    main {
        padding: 12px;
    }

    #filters {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    #filter-buttons {
        flex-wrap: wrap;
    }

    #filter-right {
        justify-content: space-between;
    }

    #search {
        width: 100%;
        flex: 1;
    }
}

.card-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    gap: 8px;
}

.card-title-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.context-menu-wrapper {
    position: relative;
}

.context-menu-trigger {
    font-size: 16px;
    color: #bbb;
    cursor: pointer;
    padding: 2px;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
}

.context-menu-trigger:hover {
    color: #666;
    background: #f0f0f0;
}

.context-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    min-width: 160px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 4px 0;
    margin-top: 4px;
}

.context-menu.show {
    display: block;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: background 0.15s;
}

.context-menu-item:hover {
    background: #f5f5f5;
}

.context-menu-item i {
    font-size: 16px;
    color: #666;
}

.context-menu-item[data-action="delete"] {
    color: #c0392b;
}

.context-menu-item[data-action="delete"] i {
    color: #c0392b;
}

.context-menu-item[data-action="delete"]:hover {
    background: #fdf2f2;
}

.context-menu-submenu {
    position: relative;
}

.context-menu-item.has-submenu {
    display: flex;
    justify-content: space-between;
}

.submenu-arrow {
    font-size: 14px;
    margin-left: auto;
}

.context-submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 160px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 4px 0;
    margin-left: 4px;
}

.context-submenu.show {
    display: block;
}

.date-picker-hidden {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.date-item-display {
    cursor: default;
}

.date-item-display:hover {
    color: inherit;
}

.date-item-display:not(.deadline-soon):not(.deadline-urgent):not(.deadline-overdue),
.date-item-display:not(.deadline-soon):not(.deadline-urgent):not(.deadline-overdue):hover {
    color: #888;
}

.context-menu-item.confirm {
    background: #c0392b;
    color: #fff;
}

.context-menu-item.confirm i {
    color: #fff;
}

.folder-tag {
    font-size: 11px;
    color: #999;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.folder-tag:hover {
    color: #666;
}

.folder-select {
    font-size: 11px;
    color: #666;
    font-weight: 500;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 1px 4px;
    background: #fff;
    cursor: pointer;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    cursor: text;
    padding: 2px 4px;
    margin: -2px -4px;
    border-radius: 3px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-title:hover {
    background: #f7f7f7;
}

.title-edit {
    font-size: 15px;
    font-weight: 600;
    flex: 1;
    min-width: 0;
}

.card-dates {
    display: flex;
    justify-content: space-between;
}

.date-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #888;
    cursor: pointer;
    position: relative;
}

.date-item:hover {
    color: #111;
}

.date-item i {
    font-size: 14px;
}

.date-item.deadline-soon {
    color: #e67e22;
}

.date-item.deadline-urgent {
    color: #c0392b;
}

.date-item.deadline-overdue {
    color: #c0392b;
    font-weight: 600;
}

.date-clear {
    font-size: 10px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    margin-left: 2px;
}

.date-item:hover .date-clear {
    opacity: 1;
}

.date-clear:hover {
    color: #999;
}

.date-picker {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.date-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 100;
    min-width: 180px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 4px 0;
    margin-top: 4px;
}

.date-menu.show {
    display: block;
}

.date-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: background 0.15s;
}

.date-menu-item:hover {
    background: #f5f5f5;
}

.date-menu-item i {
    font-size: 16px;
    color: #666;
}

.card-section {
    margin-bottom: 10px;
}

.card-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.add-task-icon {
    cursor: pointer;
    font-size: 14px;
    opacity: 0.5;
}

.add-task-icon:hover {
    opacity: 1;
}

.section-content {
    font-size: 13px;
    white-space: pre-wrap;
    color: #333;
}

.editable-section {
    cursor: text;
    padding: 3px 5px;
    margin: -3px -5px;
    border-radius: 3px;
    min-height: 18px;
}

.editable-section:hover {
    background: #f7f7f7;
}

.task-list {
    list-style: none;
    font-size: 13px;
    line-height: 1.4;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: grab;
}

.task-item.dragging {
    opacity: 0.5;
}

.delete-task {
    color: #ccc;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.15s;
}

.drag-handle {
    color: #ccc;
    font-size: 12px;
}

.task-item:hover .delete-task {
    opacity: 1;
}

.delete-task {
    margin-left: auto;
    cursor: pointer;
}

.delete-task:hover {
    color: #999;
}

.delete-task.confirm {
    color: #c0392b;
    opacity: 1;
}

.drag-handle {
    cursor: grab;
}

.drag-handle:hover {
    color: #999;
}

.task-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #222;
    margin: 0;
}

.task-text {
    flex: 1;
    cursor: text;
}

.task-text:hover {
    background: #f7f7f7;
}

.inline-edit {
    width: 100%;
    font-family: inherit;
    font-size: 13px;
    padding: 3px 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    outline: none;
    background: #fff;
}

.inline-edit:focus {
    border-color: #888;
}

textarea.inline-edit {
    resize: vertical;
    min-height: 50px;
}

.section-edit {
    width: 100%;
    margin: -3px -5px;
}

.task-edit {
    flex: 1;
}

.details-btn {
    padding: 2px 8px;
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #999;
    font-size: 11px;
    cursor: pointer;
}

.details-btn:hover {
    border-color: #999;
    color: #666;
}

mark {
    background: #ff0;
    color: inherit;
    padding: 0;
}

.recently-completed {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e0e0e0;
}

.recently-completed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.recently-completed-title {
    font-size: 10px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.show-all-icon {
    font-size: 14px;
    color: #aaa;
    cursor: pointer;
    opacity: 0.6;
}

.show-all-icon:hover {
    opacity: 1;
    color: #666;
}

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

.completed-list .task-item:hover {
    opacity: 1;
}

.completed-text {
    text-decoration: line-through;
    color: #888;
}

.completed-date {
    font-size: 11px;
    color: #aaa;
    margin-left: auto;
}
