/* Tailwind Custom Configuration */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom Font Family */
.font-iranyekan {
    font-family: 'IRANYekanXFaNum', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Custom Styles */
body {
    font-family: 'IRANYekanXFaNum', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e0e7ff 100%);
    min-height: 100vh;
}

/* Modern Header Gradient */
.header-gradient {
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #1e40af 100%);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* File Name Highlight - Modern Style */
.file-name {
    font-weight: 700;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.5;
    word-break: break-word;
}

/* Modern Card with Glassmorphism Effect */
.file-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.file-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa, #93c5fd);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.file-card:hover::before {
    transform: scaleX(1);
}

.file-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: rgba(59, 130, 246, 0.3);
}

/* Modern Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3), 0 2px 4px -1px rgba(37, 99, 235, 0.2);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.4), 0 4px 6px -2px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    box-shadow: 0 10px 15px -3px rgba(5, 150, 105, 0.4);
    transform: translateY(-1px);
}

/* Modern Input Styles */
.input-modern {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s ease;
}

.input-modern:focus {
    background: rgba(255, 255, 255, 1);
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* Search Bar Modern Style */
.search-bar-modern {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Custom Scrollbar - Modern Style */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.8);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    border-radius: 10px;
    border: 2px solid rgba(241, 245, 249, 0.8);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

/* Loading Animation - Modern Spinner */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.5;
    }
    100% {
        transform: scale(0.8);
        opacity: 1;
    }
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

.loading-pulse {
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Progress Bar Animation - Modern */
@keyframes progress {
    from { width: 0%; }
}

.progress-bar {
    animation: progress 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(90deg, #3b82f6, #60a5fa, #93c5fd);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* Toast Notification - Modern Style */
@keyframes slideInRight {
    from {
        transform: translateX(calc(100% + 1rem));
        opacity: 0;
        scale: 0.95;
    }
    to {
        transform: translateX(0);
        opacity: 1;
        scale: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
        scale: 1;
    }
    to {
        transform: translateX(calc(100% + 1rem));
        opacity: 0;
        scale: 0.95;
    }
}

.toast-show {
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-hide {
    animation: slideOutRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-modern {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    border-left: 4px solid;
    border-radius: 1rem;
}

/* Multi-select styling - Modern */
#fileTypeSelect option:checked {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
    font-weight: 500;
}

/* Drag and Drop - Modern Style */
.drop-zone-modern {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(96, 165, 250, 0.05) 100%);
    border: 2px dashed rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.drop-zone-active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(96, 165, 250, 0.1) 100%);
    border-color: #3b82f6;
    border-style: solid;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Modal - Modern Glassmorphism */
.modal-backdrop {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease-out;
}

/* Badge Modern Style */
.badge-modern {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #3730a3;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Footer Gradient */
.footer-gradient {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

/* Pagination Modern Style */
.pagination-btn {
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

/* File Icon Container */
.file-icon-container {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.file-card:hover .file-icon-container {
    background: linear-gradient(135deg, #c7d2fe 0%, #a5b4fc 100%);
    transform: scale(1.05);
}

/* File Type Dropdown Modern Style */
#fileTypeDropdownMenu {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
    z-index: 9999 !important;
    position: absolute;
}

#fileTypeDropdownMenu::-webkit-scrollbar {
    width: 6px;
}

#fileTypeDropdownMenu::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

#fileTypeDropdownMenu::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.file-type-checkbox:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

#fileTypeDropdown.open #fileTypeDropdownIcon {
    transform: rotate(180deg);
}

#fileTypeDropdownMenu .file-type-item:hover {
    background-color: #eff6ff;
}

/* Ensure dropdown parent has proper stacking context */
#fileTypeDropdown {
    position: relative;
}

/* Modal Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Logo responsive styles */
.logo-responsive,
header img {
    object-fit: contain;
    max-width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 640px) {
    .logo-responsive {
        max-width: 50px !important;
        max-height: 40px !important;
        width: auto !important;
        height: auto !important;
    }
    
    .logo-container {
        max-width: 60px;
        max-height: 50px;
        padding: 0.5rem !important;
        min-width: 60px;
        min-height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (min-width: 641px) {
    .logo-responsive {
        max-width: 80px;
        max-height: 56px;
    }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .file-name {
        font-size: 1rem;
    }
    
    .header-gradient {
        padding: 1rem;
    }
    
    header img {
        max-width: 50px !important;
        max-height: 40px !important;
        width: auto !important;
        height: auto !important;
    }
    
    header .bg-white\/30,
    header [class*="bg-white/30"] {
        padding: 0.5rem !important;
        max-width: 60px;
        max-height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    header img {
        max-width: 70px;
        max-height: 56px;
    }
}

/* Smooth transitions for all interactive elements */
button, a, input, select {
    transition: all 0.2s ease;
}

/* Empty State Modern Style */
.empty-state {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 3rem;
    border: 2px dashed rgba(148, 163, 184, 0.3);
}
