/* Additional Enhancements for Tasktory App */

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: white;
    color: #1e293b;
    padding: 14px 20px;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    animation: toastSlideIn 0.3s ease-out;
}

body.dark-theme .toast {
    background: #1e293b;
    color: #f1f5f9;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.category-card {
    animation: slideIn 0.3s ease-out;
}

.post-card {
    animation: slideIn 0.3s ease-out;
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #41b9b8;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Keyboard Shortcut Hints */
.kbd {
    display: inline-block;
    padding: 3px 6px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    line-height: 1;
    color: #334155;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

body.dark-theme .kbd {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.sidebar-section {
    padding: 16px;
}

/* Task Search Styles */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    width: 20px;
    height: 20px;
    color: #64748b;
    pointer-events: none;
}

.search-input {
    width: 300px;
    padding: 10px 14px 10px 40px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
    background: white;
    color: #1e293b;
}

body.dark-theme .search-input {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

body.dark-theme .search-icon {
    color: #94a3b8;
}

.search-input:focus {
    border-color: #41b9b8;
    box-shadow: 0 0 0 3px rgba(65, 185, 184, 0.1);
    width: 350px;
}

.search-input::placeholder {
    color: #94a3b8;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #334155;
}

.empty-state p {
    font-size: 14px;
}

body.dark-theme .empty-state h3 {
    color: #f1f5f9;
}

/* Progress Indicator */
.progress-bar {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #41b9b8, #2d9c9b);
    transition: width 0.3s ease;
}

body.dark-theme .progress-bar {
    background: rgba(255, 255, 255, 0.1);
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

body.dark-theme .skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 200% 100%;
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: #1e293b;
    color: white;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 8px;
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1e293b;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 4px;
}

.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
}

/* Scroll to top button */
.scroll-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: #41b9b8;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(65, 185, 184, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
    z-index: 1000;
}

.scroll-to-top.visible {
    opacity: 1;
    pointer-events: all;
}

.scroll-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(65, 185, 184, 0.5);
}

.scroll-to-top svg {
    width: 24px;
    height: 24px;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .search-input {
        width: 200px;
    }
    
    .search-input:focus {
        width: 250px;
    }
    
    .toast {
        right: 12px;
        bottom: 12px;
        left: 12px;
        min-width: auto;
    }
    
    .header-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .search-container {
        width: 100%;
    }
    
    .search-input {
        width: 100%;
    }
    
    .search-input:focus {
        width: 100%;
    }
}

/* Accessibility Improvements */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid #41b9b8;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #41b9b8;
    outline-offset: 2px;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
