 /* Enhanced Tasks Section Styles - Advanced Version */

/* Main Tasks Section */
.tasks-section {
    padding: 30px;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-top: 1px solid rgba(79, 172, 254, 0.1);
    position: relative;
    min-height: 500px;
}

.tasks-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(79, 172, 254, 0.3), 
        transparent);
}

.tasks-section h3 {
    color: #2c3e50;
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 25px;
    text-align: center;
    position: relative;
}

.tasks-section h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 2px;
}

/* Enhanced Task Input Container */
.task-input-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 20px;
    border: 2px solid rgba(79, 172, 254, 0.1);
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.task-input-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent, 
        rgba(79, 172, 254, 0.03), 
        transparent);
    animation: taskContainerShimmer 6s infinite;
}

@keyframes taskContainerShimmer {
    0% { transform: translateX(-100%) translateY(-100%); }
    100% { transform: translateX(100%) translateY(100%); }
}

/* Enhanced Task Input Row */
.task-input-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.task-input-field {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid #e0e6ed;
    border-radius: 15px;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.task-input-field::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(79, 172, 254, 0.1), 
        transparent);
    transition: left 0.5s ease;
}

.task-input-field:focus {
    outline: none;
    border-color: #4facfe;
    background: #fff;
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.05),
        0 0 0 4px rgba(79, 172, 254, 0.1),
        0 4px 20px rgba(79, 172, 254, 0.2);
    transform: translateY(-2px);
}

.task-input-field:focus::before {
    left: 100%;
}

.task-input-field::placeholder {
    color: #adb5bd;
    font-style: italic;
}

/* Enhanced Date and Time Rows */
.task-date-row, .task-time-row {
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.task-label {
    font-size: 13px;
    color: #495057;
    margin-bottom: 10px;
    display: block;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Enhanced Date Buttons */
.date-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.quick-date-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.2);
}

.quick-date-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    transition: left 0.5s ease;
}

.quick-date-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
}

.quick-date-btn:hover::before {
    left: 100%;
}

.quick-date-btn.active {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    transform: translateY(-2px);
}

.quick-date-btn.active::before {
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent);
}

/* Enhanced Date Input */
.task-date-input {
    padding: 12px 16px;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
    color: #495057;
}

.task-date-input:focus {
    outline: none;
    border-color: #4facfe;
    background: #fff;
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.05),
        0 0 0 3px rgba(79, 172, 254, 0.1);
    transform: translateY(-1px);
}

/* Enhanced Time Inputs */
.time-inputs {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.task-time-select {
    padding: 12px 16px;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
    color: #495057;
    cursor: pointer;
    min-width: 140px;
}

.task-time-select:focus {
    outline: none;
    border-color: #4facfe;
    background: #fff;
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.05),
        0 0 0 3px rgba(79, 172, 254, 0.1);
    transform: translateY(-1px);
}

.time-help-text {
    color: #6c757d;
    font-size: 12px;
    font-style: italic;
    opacity: 0.8;
}

/* Enhanced Add Task Button */
.add-task-btn-improved {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 16px 30px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 1;
}

.add-task-btn-improved::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.add-task-btn-improved:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.4);
}

.add-task-btn-improved:hover::before {
    left: 100%;
}

.add-task-btn-improved:active {
    transform: translateY(-1px);
}

/* Enhanced Task List */
.task-list {
    max-height: 350px;
    overflow-y: auto;
    padding: 5px;
    scroll-behavior: smooth;
}

.task-list::-webkit-scrollbar {
    width: 8px;
}

.task-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    margin: 5px;
}

.task-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.task-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #3a9bfd 0%, #00d9fd 100%);
}

/* Enhanced Task Items */
.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    animation: taskSlideIn 0.4s ease-out;
}

@keyframes taskSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.task-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(79, 172, 254, 0.05), 
        transparent);
    transition: left 0.5s ease;
}

.task-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: rgba(79, 172, 254, 0.3);
}

.task-item:hover::before {
    left: 100%;
}

.task-item.completed {
    opacity: 0.6;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #ced4da;
    animation: taskFadeOut 0.3s ease-out;
}

@keyframes taskFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0.6;
        transform: scale(0.98);
    }
}

.task-item.completed .task-content {
    text-decoration: line-through;
    color: #6c757d;
}

/* 🔧 FIXED: Enhanced Task Checkbox with Better Spacing */
.task-checkbox {
    margin-right: 22px; /* INCREASED from 15px to prevent text overlap */
    width: 20px;
    height: 20px;
    cursor: pointer;
    position: relative;
    accent-color: #28a745;
    transform: scale(1.2);
    transition: all 0.3s ease;
    flex-shrink: 0; /* Prevent checkbox from shrinking */
    min-width: 20px; /* Ensure minimum width */
}

.task-checkbox:checked {
    animation: checkboxBounce 0.3s ease;
}

@keyframes checkboxBounce {
    0% { transform: scale(1.2); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1.2); }
}

/* 🔧 FIXED: Enhanced Task Content with Better Layout */
.task-content {
    flex: 1;
    line-height: 1.5;
    margin-left: 5px; /* Additional margin for safety */
    min-width: 0; /* Allow text to wrap properly */
    word-wrap: break-word;
}

.task-content > div:first-child {
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
    margin-bottom: 4px;
    padding-left: 2px; /* Small additional padding to prevent overlap */
}

.task-content > div:last-child {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
    padding-left: 2px; /* Consistent padding */
}

/* Enhanced Task Actions */
.task-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.delete-btn, .complete-btn {
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.delete-btn::before, .complete-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    transition: left 0.5s ease;
}

.delete-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.2);
}

.delete-btn:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.delete-btn:hover::before {
    left: 100%;
}

.complete-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.complete-btn:hover {
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.complete-btn:hover::before {
    left: 100%;
}

/* Legacy Task Input Support */
.task-input {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.task-input input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
}

.task-input input:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.add-task-btn {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.2);
}

.add-task-btn:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.3);
}

/* Enhanced Mobile Responsive Design */
@media (max-width: 768px) {
    .tasks-section {
        padding: 20px 15px;
    }
    
    .task-input-container {
        padding: 20px 15px;
    }
    
    .date-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .quick-date-btn {
        width: 100%;
        margin-bottom: 5px;
        justify-content: center;
    }
    
    .time-inputs {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .task-time-select {
        width: 100%;
        min-width: auto;
    }
    
    .time-help-text {
        margin-left: 0;
        margin-top: 5px;
        text-align: center;
    }
    
    .task-item {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding: 15px;
    }
    
    /* 🔧 FIXED: Mobile checkbox spacing */
    .task-checkbox {
        margin-right: 25px; /* Even more space on mobile */
        margin-bottom: 10px;
        align-self: flex-start;
    }
    
    .task-content {
        margin-left: 0;
        width: 100%;
    }
    
    .task-actions {
        justify-content: center;
        gap: 10px;
    }
    
    .delete-btn, .complete-btn {
        flex: 1;
        padding: 12px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .tasks-section {
        padding: 15px 10px;
    }
    
    .task-input-container {
        padding: 15px 12px;
    }
    
    .task-input-field {
        padding: 14px 16px;
    }
    
    .task-item {
        padding: 12px;
    }
    
    .task-list {
        max-height: 300px;
    }
    
    /* 🔧 FIXED: Small screen checkbox adjustment */
    .task-checkbox {
        margin-right: 20px;
        transform: scale(1.1); /* Slightly smaller on very small screens */
    }
}

/* Enhanced Accessibility */
.task-input-field:focus,
.task-date-input:focus,
.task-time-select:focus,
.add-task-btn-improved:focus,
.quick-date-btn:focus,
.delete-btn:focus,
.complete-btn:focus {
    outline: 3px solid rgba(79, 172, 254, 0.6);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .task-input-container,
    .task-item {
        border: 3px solid #000;
        background: #fff;
    }
    
    .quick-date-btn,
    .add-task-btn-improved,
    .delete-btn,
    .complete-btn {
        border: 3px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .task-item,
    .quick-date-btn,
    .add-task-btn-improved,
    .delete-btn,
    .complete-btn,
    .task-input-field,
    .task-date-input,
    .task-time-select {
        transition: none;
        animation: none;
    }
    
    .task-checkbox:checked {
        animation: none;
    }
}

/* ========================================
   PRIORITY SELECTION STYLES
   ======================================== */

/* Priority Selection Row */
.task-priority-row {
    margin-bottom: 20px;
}

.priority-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.priority-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.priority-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.priority-btn.active {
    border-color: #4facfe;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

.priority-btn[data-priority="high"].active {
    border-color: #dc3545;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

.priority-btn[data-priority="medium"].active {
    border-color: #ffc107;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #333;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}

.priority-btn[data-priority="low"].active {
    border-color: #28a745;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

/* Mobile responsive for priority buttons */
@media (max-width: 768px) {
    .priority-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .priority-btn {
        width: 100%;
        justify-content: center;
    }
}