/* Enhanced File Upload Manager - Glassmorphism Undo System Styles */

/* Undo Button Styling - Dark Glassmorphism Theme */
.glassmorphism-undo-btn {
    background: rgba(16, 185, 129, 0.1) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    border-radius: 8px !important;
    padding: 8px 16px !important;
    color: rgba(16, 185, 129, 0.9) !important;
    font-size: 0.85em !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    margin-top: 12px !important;
    position: relative !important;
    overflow: hidden !important;
}

.glassmorphism-undo-btn:hover {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: rgba(16, 185, 129, 0.5) !important;
    color: rgba(16, 185, 129, 1) !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.15) !important;
    transform: translateY(-1px) !important;
}

.glassmorphism-undo-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}

.glassmorphism-undo-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    background: rgba(75, 85, 99, 0.1) !important;
    border-color: rgba(75, 85, 99, 0.3) !important;
    color: rgba(156, 163, 175, 0.7) !important;
}

/* Undo Button Content Layout */
.undo-btn-content {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
}

.undo-icon {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
}

.undo-text {
    font-weight: 500 !important;
}

.undo-count {
    background: rgba(16, 185, 129, 0.2) !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    border-radius: 12px !important;
    padding: 2px 8px !important;
    font-size: 0.75em !important;
    font-weight: 600 !important;
    color: rgba(16, 185, 129, 0.9) !important;
    min-width: 24px !important;
    text-align: center !important;
}

.glassmorphism-undo-btn:hover .undo-count {
    background: rgba(16, 185, 129, 0.3) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
    color: rgba(16, 185, 129, 1) !important;
}

/* Glassmorphism Action Button (for inline undo in notifications) */
.glassmorphism-action-btn {
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border-radius: 6px !important;
    font-size: 0.8em !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.glassmorphism-action-btn:hover {
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2) !important;
}

/* Notification Enhancements - Dark Glassmorphism Theme */
.undo-notification,
.restore-notification {
    pointer-events: auto !important;
}

/* REMOVED: .undo-notification .glass-card static background rule to allow dynamic color changes */
/* The notification background color is now controlled by JavaScript for timer states */

/* Stronger glassmorphism notification styling */
.undo-notification,
.restore-notification,
.undo-success-notification,
.heartbeat-success-notification {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    border-radius: 12px !important;
}

/* Success notification specific styling - Compact and GREEN */
.undo-success-notification .glass-card,
.heartbeat-success-notification .glass-card {
    background: rgba(16, 185, 129, 0.15) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15) !important;
    border-radius: 8px !important;
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 10px !important;
}

.undo-success-notification svg,
.heartbeat-success-notification svg {
    color: rgba(16, 185, 129, 0.9) !important;
}

/* Animation Keyframes for Better UX */
@keyframes undoButtonPulse {
    0%, 100% { 
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); 
    }
    50% { 
        box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2); 
    }
}

.glassmorphism-undo-btn.has-undo {
    animation: undoButtonPulse 3s ease-in-out infinite !important;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.undo-notification.entering,
.restore-notification.entering {
    animation: slideInFromRight 0.3s ease-out forwards !important;
}

.undo-notification.leaving,
.restore-notification.leaving {
    animation: slideOutToRight 0.3s ease-in forwards !important;
}

/* Mobile Responsiveness - More Compact */
@media (max-width: 768px) {
    .glassmorphism-undo-btn {
        padding: 10px 12px !important;
        font-size: 0.8em !important;
    }
    
    .undo-btn-content {
        gap: 6px !important;
    }
    
    .undo-text {
        display: none !important;
    }
    
    .undo-notification,
    .restore-notification,
    .undo-success-notification,
    .heartbeat-success-notification,
    .deletion-notification {
        max-width: 95vw !important;
        top: 8px !important;
        right: 8px !important;
        left: 8px !important;
    }
    
    .undo-notification .glass-card,
    .restore-notification .glass-card,
    .undo-success-notification .glass-card,
    .heartbeat-success-notification .glass-card,
    .deletion-notification .glass-card {
        padding: 10px !important;
    }
    
    .undo-notification svg,
    .restore-notification svg,
    .undo-success-notification svg,
    .heartbeat-success-notification svg,
    .deletion-notification svg {
        width: 18px !important;
        height: 18px !important;
    }
}

@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutToTop {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

/* Enhanced File Item Styling to Match Theme */
.file-item {
    background: rgba(31, 41, 55, 0.2) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border: 1px solid rgba(75, 85, 99, 0.3) !important;
    border-radius: 8px !important;
    margin-bottom: 8px !important;
    padding: 12px !important;
    transition: all 0.2s ease !important;
}

.file-item:hover {
    background: rgba(31, 41, 55, 0.3) !important;
    border-color: rgba(75, 85, 99, 0.4) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.file-info {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex: 1 !important;
}

.file-icon {
    color: rgba(156, 163, 175, 0.8) !important;
    font-size: 1.2em !important;
    flex-shrink: 0 !important;
}

.file-details {
    flex: 1 !important;
    min-width: 0 !important;
}

.file-name {
    color: rgba(243, 244, 246, 0.9) !important;
    font-weight: 500 !important;
    word-break: break-all !important;
    display: block !important;
}

.file-meta {
    display: flex !important;
    gap: 12px !important;
    margin-top: 4px !important;
    font-size: 0.75em !important;
    color: rgba(156, 163, 175, 0.7) !important;
}

.file-size,
.upload-date {
    color: rgba(156, 163, 175, 0.7) !important;
}

.file-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.remove-file-btn {
    background: rgba(239, 68, 68, 0.1) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    color: rgba(239, 68, 68, 0.8) !important;
    border-radius: 6px !important;
    padding: 6px !important;
    transition: all 0.2s ease !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

.remove-file-btn:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: rgba(239, 68, 68, 1) !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2) !important;
}

.remove-file-btn:active {
    transform: scale(0.95) !important;
}

/* Upload Progress Styling */
[data-progress-id] {
    background: rgba(59, 130, 246, 0.2) !important;
    border-radius: 4px !important;
    height: 4px !important;
    transition: width 0.3s ease !important;
}

/* File Counter Styling */
[data-file-counter],
[data-total-size] {
    color: rgba(156, 163, 175, 0.8) !important;
    font-weight: 500 !important;
}

/* Accessibility Improvements */
.glassmorphism-undo-btn:focus-visible {
    outline: 2px solid rgba(16, 185, 129, 0.6) !important;
    outline-offset: 2px !important;
}

.glassmorphism-action-btn:focus-visible {
    outline: 2px solid rgba(16, 185, 129, 0.6) !important;
    outline-offset: 1px !important;
}

.remove-file-btn:focus-visible {
    outline: 2px solid rgba(239, 68, 68, 0.6) !important;
    outline-offset: 1px !important;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .glassmorphism-undo-btn {
        border-width: 2px !important;
        background: rgba(16, 185, 129, 0.3) !important;
    }
    
    .undo-notification .glass-card,
    .restore-notification .glass-card {
        border-width: 2px !important;
        background: rgba(16, 185, 129, 0.2) !important;
    }
    
    .file-item {
        border-width: 2px !important;
        background: rgba(31, 41, 55, 0.4) !important;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .glassmorphism-undo-btn,
    .glassmorphism-action-btn,
    .remove-file-btn,
    .file-item,
    .undo-notification,
    .restore-notification,
    .heartbeat-success-notification {
        transition: none !important;
        animation: none !important;
    }
    
    .glassmorphism-undo-btn.has-undo {
        animation: none !important;
    }
}

/* Countdown Warning States - Red urgency at 5 seconds */
.undo-notification .glass-card.warning-red {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
}

.undo-notification .countdown-text.warning-red {
    color: rgba(239, 68, 68, 1) !important;
}

.undo-notification .countdown-progress.warning-red {
    background: rgba(239, 68, 68, 0.8) !important;
}

.undo-notification svg.warning-red {
    color: rgba(239, 68, 68, 0.9) !important;
}

.undo-notification .undo-btn-action.warning-red {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: rgba(239, 68, 68, 1) !important;
}

/* Deletion Notification Styling - Green success theme */
.deletion-notification {
    pointer-events: auto !important;
    max-width: 400px !important;
    min-height: 60px !important; /* Ensure consistent minimum height */
}

.deletion-notification .glass-card {
    background: rgba(16, 185, 129, 0.15) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.1) !important;
    border-radius: 8px !important;
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 0.625rem !important; /* p-2.5 = 10px */
}

/* Ensure undo notifications have consistent max-width */
.undo-notification {
    max-width: 400px !important;
    min-height: 100px !important; /* Slightly taller due to progress bar */
}

.undo-notification .glass-card {
    padding: 0.75rem !important; /* p-3 = 12px */
}

/* Print Styles */
@media print {
    .glassmorphism-undo-btn,
    .undo-notification,
    .restore-notification,
    .heartbeat-success-notification,
    .deletion-notification {
        display: none !important;
    }
}