/* Custom animations and styles */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Drag and drop states */
.drag-over {
    border-color: #4F46E5 !important;
    background-color: #EEF2FF !important;
}

/* File card hover effect */
.file-card {
    transition: all 0.2s ease;
}

.file-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Progress bar animation */
@keyframes progress {
    0% {
        width: 0%;
    }
}

/* Toast notification animation */
@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-animate {
    animation: toast-in 0.3s ease-out;
}

/* Loading spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    animation: spin 1s linear infinite;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Existing styles... */

/* Better touch targets for mobile */
.touch-manipulation {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Larger touch targets on mobile */
@media (max-width: 768px) {
    button {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Make close buttons easier to tap */
    button[id*="close"] {
        padding: 12px !important;
    }
}

/* Prevent text selection on buttons */
button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Modal improvements for mobile */
@media (max-width: 640px) {
    .modal-content {
        max-height: 85vh;
    }
}

/* iOS specific fixes */
.touch-manipulation {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

/* Ensure modals are scrollable on iOS */
.fixed {
    -webkit-overflow-scrolling: touch;
}

/* Prevent iOS zoom on input focus */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    font-size: 16px; /* Prevents zoom on iOS */
}

/* Better modal header for long filenames */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Ensure filename truncates properly */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Make close buttons always visible and clickable */
button[id*="close"] {
    flex-shrink: 0;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Better touch targets on mobile */
@media (max-width: 768px) {
    button {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Make close buttons larger on mobile */
    button[id*="close"] {
        min-width: 48px;
        min-height: 48px;
        padding: 12px !important;
    }
    
    /* Prevent filename from pushing button off screen */
    .flex.items-center.justify-between {
        flex-wrap: nowrap;
    }
}

/* Prevent text selection on buttons (better for iOS) */
button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Modal overlay should be fully opaque on touch */
.fixed.inset-0 {
    -webkit-tap-highlight-color: transparent;
}

/* Ensure modal content doesn't overflow on small screens */
@media (max-width: 640px) {
    .max-w-4xl,
    .max-w-md {
        max-width: calc(100vw - 32px);
    }
    
    .max-h-\[90vh\] {
        max-height: 90vh;
    }
}

/* Fix for iOS Safari bottom bar */
@supports (-webkit-touch-callout: none) {
    .min-h-screen {
        min-height: -webkit-fill-available;
    }
}

/* Improve scrolling on iOS */
.overflow-auto {
    -webkit-overflow-scrolling: touch;
}

