/* NextGrade Todo App - Custom Styles */

/* Smooth transitions for better UX */
* {
    transition: all 0.2s ease-in-out;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Priority indicators - left border colors */
.priority-1 { 
    border-left: 4px solid #10b981; /* Green - Low */
}

.priority-2 { 
    border-left: 4px solid #3b82f6; /* Blue - Normal */
}

.priority-3 { 
    border-left: 4px solid #f59e0b; /* Orange - High */
}

.priority-4 { 
    border-left: 4px solid #ef4444; /* Red - Very High */
}

/* Task completion state */
.task-completed {
    opacity: 0.7;
    transform: scale(0.98);
}

.task-completed .task-title {
    text-decoration: line-through;
    color: #9ca3af;
}

.task-completed .task-description {
    color: #9ca3af;
}

/* Task hover effects */
.task-item {
    cursor: pointer;
    transform-origin: center;
}

.task-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.task-item:active {
    transform: scale(0.995);
}

/* Modal animations */
.modal-enter {
    animation: modalEnter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-exit {
    animation: modalExit 0.2s ease-in;
}

@keyframes modalEnter {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalExit {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
}

/* Toast notification animations */
.toast-enter {
    animation: toastEnter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast-exit {
    animation: toastExit 0.2s ease-in;
}

@keyframes toastEnter {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastExit {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(100%) scale(0.95);
    }
}

/* Button hover effects */
.btn-hover:hover {
    transform: translateY(-1px);
}

/* Category badges */
.category-marketing {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fbbf24;
}

.category-dev {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #60a5fa;
}

.category-content {
    background-color: #f3e8ff;
    color: #7c3aed;
    border: 1px solid #a78bfa;
}

.category-general {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

/* Due date warnings */
.due-today {
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
}

.due-overdue {
    background-color: #fee2e2;
    border: 1px solid #ef4444;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0284c7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Focus styles for accessibility */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.5);
    border-color: #0284c7;
}

/* Custom checkbox styling */
.custom-checkbox {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #d1d5db;
    border-radius: 0.25rem;
    background-color: white;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.custom-checkbox:checked {
    background-color: #0284c7;
    border-color: #0284c7;
}

.custom-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
}

.custom-checkbox:hover {
    border-color: #0284c7;
}

.custom-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.3);
}

/* Responsive improvements */
@media (max-width: 640px) {
    .task-item {
        padding: 1rem;
    }
    
    .task-actions {
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid #e5e7eb;
        display: flex;
        justify-content: flex-end;
        gap: 0.5rem;
    }
    
    .modal-content {
        margin: 1rem;
    }
    
    /* Stack form fields on mobile */
    .form-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    @media (min-width: 640px) {
        .form-grid {
            grid-template-columns: 1fr 1fr;
        }
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .task-item {
        break-inside: avoid;
        border: 1px solid #e5e7eb;
        margin-bottom: 0.5rem;
        padding: 0.5rem;
    }
    
    .task-completed {
        opacity: 0.5;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .priority-1 { border-left-color: #047857; }
    .priority-2 { border-left-color: #1e40af; }
    .priority-3 { border-left-color: #d97706; }
    .priority-4 { border-left-color: #dc2626; }
    
    .task-item {
        border: 2px solid #374151;
    }
    
    .task-completed {
        opacity: 0.6;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
    /* Future: Add dark mode styles here */
}

/* Custom utility classes */
.text-shadow {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.backdrop-blur {
    backdrop-filter: blur(4px);
}

/* Error states */
.error {
    border-color: #ef4444 !important;
    background-color: #fef2f2;
}

.error:focus {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

/* Success states */
.success {
    border-color: #10b981 !important;
    background-color: #f0fdf4;
}