/* =====================
   Google Tasks Enhancer - 메인 스타일
   ===================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    touch-action: pan-x pan-y;
    overscroll-behavior: none;
}

/* =====================
   Header
   ===================== */

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

#header h1 {
    font-size: 20px;
    color: #333;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 헤더 검색창 */
.header-search {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 20px;
    padding: 6px 12px;
    transition: background 0.2s;
}

.header-search:focus-within {
    background: white;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.3);
}

.header-search .search-icon {
    font-size: 14px;
    margin-right: 6px;
}

.header-search input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    width: 100px;
    color: #333;
}

.header-search input::placeholder {
    color: #999;
}

#auth-btn {
    padding: 10px 20px;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

#auth-btn:hover {
    background: #3367d6;
}

#auth-btn.signed-in {
    background: #ea4335;
}

/* =====================
   Status (하단 필터바 내)
   ===================== */

#status {
    font-size: 12px;
    color: #666;
    padding: 4px 8px;
    background: #f5f5f5;
    border-radius: 4px;
    white-space: nowrap;
}

.filter-divider {
    width: 1px;
    height: 20px;
    background: #ddd;
    margin: 0 4px;
}

/* =====================
   Task List Selector
   ===================== */

#task-lists-selector {
    padding: 8px 16px;
    background: #f0f0f0;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#tasklist-checkboxes-container {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.tasklist-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.15s;
    user-select: none;
}

.tasklist-checkbox-label:hover {
    background: #f9f9f9;
    border-color: #999;
}

.tasklist-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.tasklist-checkbox-label span {
    font-size: 14px;
    color: #333;
}

#refresh-btn {
    padding: 8px 16px;
    background: #34a853;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#add-task-btn {
    padding: 8px 16px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

#add-task-btn:hover {
    background: #1557b0;
}

/* =====================
   View Menu (햄버거 드롭다운)
   ===================== */

.view-menu-wrapper {
    position: relative;
    margin-left: auto;
}

.view-menu-toggle {
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.view-menu-toggle:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.current-view-icon {
    font-size: 18px;
}

.menu-arrow {
    font-size: 10px;
    color: #666;
    transition: transform 0.2s;
}

.view-menu-toggle.open .menu-arrow {
    transform: rotate(180deg);
}

.view-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    z-index: 100;
    overflow: hidden;
}

.view-dropdown-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.view-dropdown-item:hover {
    background: #f5f5f5;
}

.view-dropdown-item.active {
    background: #e8f0fe;
    color: #1a73e8;
    font-weight: 500;
}

.view-dropdown-item .view-icon {
    font-size: 16px;
}

/* =====================
   Filter Bar (하단 고정)
   ===================== */

#filter-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 16px;
    background: #fff;
    border-top: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    z-index: 50;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-group label {
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

.filter-group select {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
}

#search-input {
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 150px;
}

#filter-stats {
    font-size: 12px;
    color: #666;
    margin-left: auto;
}

#clear-filters-btn {
    padding: 6px 12px;
    background: #f1f3f4;
    color: #5f6368;
    border: 1px solid #dadce0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

#clear-filters-btn:hover {
    background: #e8eaed;
}

/* =====================
   Tag Filter
   ===================== */

.tag-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tag-manager-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.tag-manager-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.tag-filter-container {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.tag-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    user-select: none;
}

.tag-filter-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.tag-filter-chip.active {
    border-color: currentColor;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 태그 색상 */
.tag-filter-chip.urgent {
    background: #ffebee;
    color: #c62828;
}

.tag-filter-chip.urgent.active {
    background: #c62828;
    color: white;
}

.tag-filter-chip.important {
    background: #fff3e0;
    color: #e65100;
}

.tag-filter-chip.important.active {
    background: #e65100;
    color: white;
}

.tag-filter-chip.pmi {
    background: #e8f5e9;
    color: #2e7d32;
}

.tag-filter-chip.pmi.active {
    background: #2e7d32;
    color: white;
}

.tag-filter-chip.personal {
    background: #e3f2fd;
    color: #1565c0;
}

.tag-filter-chip.personal.active {
    background: #1565c0;
    color: white;
}

.tag-filter-chip.custom {
    background: #f3e5f5;
    color: #7b1fa2;
}

.tag-filter-chip.custom.active {
    background: #7b1fa2;
    color: white;
}

.tag-filter-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 11px;
    min-width: 18px;
    text-align: center;
}

.tag-filter-chip.active .tag-filter-count {
    background: rgba(255, 255, 255, 0.25);
}

/* 태그 필터 모드 표시 */
.tag-filter-mode {
    font-size: 11px;
    color: #666;
    margin-left: 8px;
    padding: 2px 8px;
    background: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
}

.tag-filter-mode:hover {
    background: #e8e8e8;
}

/* =====================
   View Container
   ===================== */

#view-container {
    width: 100%;
    height: calc(100vh - 140px);
    background: #fff;
    padding-bottom: 70px;
    /* 하단 필터바 공간 */
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #666;
}

/* =====================
   Modal
   ===================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.modal {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
}

.modal-field {
    margin-bottom: 16px;
}

.modal-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin-bottom: 6px;
}

.modal-field input,
.modal-field textarea,
.modal-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.modal-field textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-field input:focus,
.modal-field textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.modal-tags {
    display: flex;
    gap: 12px;
}

.modal-tags label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-btn.cancel {
    background: #f1f3f4;
    color: #5f6368;
}

.modal-btn.cancel:hover {
    background: #e8eaed;
}

.modal-btn.save {
    background: #1a73e8;
    color: white;
}

.modal-btn.save:hover {
    background: #1557b0;
}

.modal-btn.delete {
    background: #ea4335;
    color: white;
    margin-right: auto;
}

.modal-btn.delete:hover {
    background: #c5221f;
}

/* =====================
   Enhanced Modal Styles
   ===================== */

/* Modal 구조 개선 */
.modal {
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
}

/* Custom Scrollbar for Modal Body */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
    margin-top: 8px;
}

.modal-footer-right {
    display: flex;
    gap: 10px;
}

/* Modal Hint */
.modal-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #888;
}

/* Task List Select Styling */
.modal-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Date Input Group */
.modal-date-input-group {
    display: flex;
    gap: 8px;
}

.modal-date-input-group input {
    flex: 1;
    cursor: pointer;
}

.date-clear-btn {
    width: 44px;
    padding: 0;
    background: #f5f5f5;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.2s;
    flex-shrink: 0;
}

.date-clear-btn:hover {
    background: #e8eaed;
    color: #333;
}

/* Quick Date Buttons */
.modal-quick-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.quick-date-btn {
    padding: 8px 14px;
    background: white;
    border: 1.5px solid #e0e0e0;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-date-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
    transform: translateY(-1px);
}

.quick-date-btn.active {
    background: #e8f0fe;
    border-color: #1a73e8;
    color: #1a73e8;
}

/* Enhanced Tag Checkboxes */
.modal-tags {
    display: flex;
    gap: 12px;
}

.modal-tag-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 16px;
    background: white;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-tag-option:hover {
    border-color: #ccc;
    background: #fafafa;
}

.modal-tag-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.tag-checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.tag-checkbox-custom.urgent {
    background: #fff5f5;
    border-color: #ffcdd2;
}

.tag-checkbox-custom.important {
    background: #e3f2fd;
    border-color: #bbdefb;
}

.tag-checkbox-custom.pmi {
    background: #f3e5f5;
    border-color: #e1bee7;
}

.tag-checkbox-custom.personal {
    background: #fff3e0;
    border-color: #ffcc80;
}

.modal-tag-option input:checked + .tag-checkbox-custom.urgent {
    background: #ef5350;
    border-color: #ef5350;
    color: white;
}

.modal-tag-option input:checked + .tag-checkbox-custom.urgent::after {
    content: '✓';
    font-size: 12px;
}

.modal-tag-option input:checked + .tag-checkbox-custom.important {
    background: #42a5f5;
    border-color: #42a5f5;
    color: white;
}

.modal-tag-option input:checked + .tag-checkbox-custom.important::after {
    content: '✓';
    font-size: 12px;
}

.modal-tag-option input:checked + .tag-checkbox-custom.pmi {
    background: #9c27b0;
    border-color: #9c27b0;
    color: white;
}

.modal-tag-option input:checked + .tag-checkbox-custom.pmi::after {
    content: '✓';
    font-size: 12px;
}

.modal-tag-option input:checked + .tag-checkbox-custom.personal {
    background: #ff9800;
    border-color: #ff9800;
    color: white;
}

.modal-tag-option input:checked + .tag-checkbox-custom.personal::after {
    content: '✓';
    font-size: 12px;
}

/* Flatpickr Customization */
.flatpickr-calendar {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border: none;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange,
.flatpickr-day.selected:focus,
.flatpickr-day.startRange:focus,
.flatpickr-day.endRange:focus,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover,
.flatpickr-day.selected.prevMonthDay,
.flatpickr-day.startRange.prevMonthDay,
.flatpickr-day.endRange.prevMonthDay,
.flatpickr-day.selected.nextMonthDay,
.flatpickr-day.startRange.nextMonthDay,
.flatpickr-day.endRange.nextMonthDay {
    background: #1a73e8;
    border-color: #1a73e8;
}

.flatpickr-day.today {
    border-color: #1a73e8;
}

.flatpickr-day:hover:not(.selected) {
    background: #e8f0fe;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .modal {
        width: 95%;
        max-height: calc(100vh - 80px - env(safe-area-inset-bottom));
        margin-bottom: calc(64px + env(safe-area-inset-bottom));
    }

    .modal-header h3 {
        font-size: 16px;
    }

    .modal-footer {
        flex-direction: column;
        gap: 10px;
    }

    .modal-footer-right {
        width: 100%;
    }

    .modal-btn {
        flex: 1;
        justify-content: center;
    }

    .modal-quick-dates {
        gap: 6px;
    }

    .quick-date-btn {
        flex: 1 0 calc(50% - 3px);
        min-width: 0;
        padding: 10px 12px;
    }

    .modal-tags {
        flex-direction: column;
        gap: 8px;
    }

    .modal-tag-option {
        width: 100%;
    }
}

/* =====================
   Task Action Buttons
   ===================== */

.task-action-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-action-btn.complete {
    background: #e8f5e9;
    color: #2e7d32;
}

.task-action-btn.complete:hover {
    background: #c8e6c9;
}

.task-action-btn.edit {
    background: #e3f2fd;
    color: #1565c0;
}

.task-action-btn.edit:hover {
    background: #bbdefb;
}

.task-action-btn.delete {
    background: #ffebee;
    color: #c62828;
}

.task-action-btn.delete:hover {
    background: #ffcdd2;
}

/* =====================
   Task Tags
   ===================== */

.task-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #e0e0e0;
    color: #424242;
}

.task-tag.urgent {
    background: #ffcdd2;
    color: #c62828;
}

.task-tag.important {
    background: #bbdefb;
    color: #1565c0;
}

/* =====================
   Task Action Modal
   ===================== */

.action-modal {
    background: white;
    border-radius: 16px;
    padding: 0;
    width: 90%;
    max-width: 320px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.action-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.action-modal-header h3 {
    font-size: 15px;
    color: #333;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.action-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.action-modal-close:hover {
    color: #333;
}

.action-modal-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 16px;
    background: white;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.action-btn:nth-child(1) {
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.action-btn:nth-child(2) {
    border-bottom: 1px solid #eee;
}

.action-btn:nth-child(3) {
    border-right: 1px solid #eee;
}

.action-icon {
    font-size: 28px;
}

.action-label {
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.action-btn.pomodoro:hover {
    background: #fff5f5;
}

.action-btn.pomodoro .action-icon {
    color: #e53935;
}

.action-btn.edit:hover {
    background: #e3f2fd;
}

.action-btn.edit .action-icon {
    color: #1e88e5;
}

.action-btn.subtask:hover {
    background: #e8f5e9;
}

.action-btn.subtask .action-icon {
    color: #43a047;
}

.action-btn.complete:hover {
    background: #f3e5f5;
}

.action-btn.complete .action-icon {
    color: #8e24aa;
}

.action-btn.complete.done .action-label {
    color: #666;
}

.action-btn.complete.done .action-icon {
    opacity: 0.6;
}

/* =====================
   Undated Tasks Panel & Quick Date
   ===================== */

/* Toggle Button */
.undated-toggle-btn {
    padding: 8px 14px;
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.undated-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
}

#undated-count-badge {
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

/* Desktop Panel */
.undated-panel {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    width: 320px;
    max-height: 400px;
    overflow: hidden;
    z-index: 100;
    animation: fadeIn 0.2s ease;
}

.undated-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    font-weight: 600;
}

.undated-panel-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 16px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.undated-panel-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

#undated-tasks-container {
    max-height: 340px;
    overflow-y: auto;
    padding: 12px;
}

/* Undated Task Items */
.undated-tasks-empty {
    color: #999;
    font-size: 14px;
    text-align: center;
    padding: 24px;
}

.undated-task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #fafafa;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.15s;
}

.undated-task-item:hover {
    background: #f0f0f0;
}

.undated-task-title {
    flex: 1;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
}

.set-date-btn {
    background: white;
    border: 2px solid #ff9800;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.15s;
}

.set-date-btn:hover {
    background: #fff3e0;
    transform: scale(1.05);
}

/* Quick Date Modal */
.quick-date-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    animation: fadeIn 0.2s ease;
}

.quick-date-modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 360px;
    overflow: hidden;
    animation: slideUp 0.2s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.quick-date-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
}

.quick-date-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-date-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.quick-date-task-title {
    padding: 12px 20px;
    background: #f5f5f5;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Task List Filter Tabs for Undated Tasks Page */
.undated-filter-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 8px 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.undated-filter-tabs::-webkit-scrollbar {
    display: none;
}

.undated-filter-tab {
    flex-shrink: 0;
    padding: 6px 12px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e0e0e0;
    user-select: none;
}

.undated-filter-tab:hover {
    background: #e8e8e8;
    color: #333;
}

.undated-filter-tab.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.undated-filter-tab .tab-count {
    font-size: 11px;
    color: #888;
    margin-left: 4px;
}

.undated-filter-tab.active .tab-count {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

/* Task list container inside undated tasks */
.undated-task-list {
    padding: 8px;
}

.quick-date-options {
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.quick-date-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #fafafa;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    border: 2px solid transparent;
}

.quick-date-option:first-child {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.quick-date-option:hover {
    background: #f0f0f0;
    border-color: #667eea;
    transform: translateX(2px);
}

.quick-date-option:first-child:hover {
    background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
}

.qd-emoji {
    font-size: 18px;
}

.qd-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    flex: 1;
}

.qd-date {
    font-size: 12px;
    color: #666;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 8px;
    border-radius: 10px;
}

/* =====================
   Undated Tasks Full Page (Drag & Drop)
   ===================== */

.undated-full-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.undated-page-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    gap: 16px;
}

.undated-page-back {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.undated-page-back:hover {
    background: #e0e0e0;
}

.undated-page-header h1 {
    flex: 1;
    font-size: 18px;
    margin: 0;
}

.undated-count {
    font-size: 14px;
    color: #666;
    background: #fff3e0;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.undated-page-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 0;
}

/* 왼쪽: 날짜 패널 */
.undated-dates-panel {
    flex: 0 0 400px;
    background: white;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.undated-dates-title {
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    border-bottom: 1px solid #f0f0f0;
}

.undated-dates-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 날짜 카드 (드롭 타겟) */
.undated-date-card {
    background: #fafafa;
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.undated-date-card:hover {
    border-color: #ff9800;
    background: #fff8f0;
}

.undated-date-card.drag-over {
    border-color: #4caf50;
    background: #e8f5e9;
    transform: scale(1.02);
}

.undated-date-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.undated-date-emoji {
    font-size: 20px;
}

.undated-date-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.undated-date-value {
    font-size: 12px;
    color: #666;
}

/* 오른쪽: Task 패널 */
.undated-tasks-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fafafa;
    overflow: hidden;
}

.undated-tasks-title {
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.undated-tasks-divider {
    height: 1px;
    background: linear-gradient(to right, #e0e0e0, #f0f0f0, #e0e0e0);
    margin: 0;
}

.undated-page-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* 드래그 가능한 Task 아이템 */
.undated-task-item {
    background: white;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 10px;
    cursor: grab;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 2px solid transparent;
    transition: all 0.2s;
    user-select: none;
}

.undated-task-item:hover {
    border-color: #ff9800;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.2);
}

.undated-task-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.undated-task-drag-handle {
    font-size: 18px;
    color: #999;
    cursor: grab;
}

.undated-task-title {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.undated-task-meta {
    font-size: 12px;
    color: #999;
}

/* 지정된 Task 아이템 (하단 목록) */
.assigned-task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 3px solid #4caf50;
}

.assigned-task-title {
    flex: 1;
    font-size: 13px;
    color: #555;
}

.assigned-task-date {
    font-size: 12px;
    color: #4caf50;
    font-weight: 500;
    background: white;
    padding: 3px 8px;
    border-radius: 12px;
}

/* 반응형 - 모바일 */
@media (max-width: 768px) {
    .undated-page-layout {
        flex-direction: column;
    }

    .undated-dates-panel {
        flex: 0 0 200px;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .undated-dates-list {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px;
    }

    .undated-date-card {
        flex: 0 0 140px;
        padding: 10px 12px;
    }
}
}