/* Custom CSS for FixItFast */

/* Upload area styles */
.upload-area {
    transition: all 0.3s ease;
    position: relative;
}

.upload-area:hover {
    border-color: #3b82f6 !important;
    background-color: #f8fafc;
}

.upload-area.dragover {
    border-color: #3b82f6 !important;
    background-color: #dbeafe !important;
}

/* Tool cards */
.tool-card {
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

/* Loading animation */
.loading-spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Progress bar */
.progress-bar {
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    background-color: #065f46;
    color: white;
}

.notification.error {
    background-color: #dc2626;
    color: white;
}

.notification.info {
    background-color: #1e40af;
    color: white;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* File type icons */
.file-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.file-icon.video { color: #ef4444; }
.file-icon.audio { color: #3b82f6; }
.file-icon.image { color: #22c55e; }
.file-icon.document { color: #8b5cf6; }
.file-icon.archive { color: #f59e0b; }

/* Responsive utilities */
@media (max-width: 640px) {
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .tool-card {
        text-align: center;
    }
    
    .grid-responsive {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Admin panel styles */
.admin-sidebar {
    background: linear-gradient(180deg, #1e40af 0%, #1e3a8a 100%);
}

.admin-nav-item {
    transition: all 0.2s ease;
}

.admin-nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.admin-nav-item.active {
    background-color: rgba(255, 255, 255, 0.2);
    border-right: 3px solid white;
}

/* Charts container */
.chart-container {
    position: relative;
    height: 300px;
}

/* Table styles */
.data-table {
    border-collapse: collapse;
    width: 100%;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.data-table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.data-table tr:hover {
    background-color: #f9fafb;
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge.success {
    background-color: #dcfce7;
    color: #166534;
}

.badge.warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge.error {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge.info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Modal styles */
.modal-overlay {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Form validation */
.form-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.form-success {
    border-color: #22c55e !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1) !important;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .dark-mode-auto {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .dark-mode-auto .bg-white {
        background-color: #374151;
    }
    
    .dark-mode-auto .text-gray-900 {
        color: #f9fafb;
    }
    
    .dark-mode-auto .text-gray-600 {
        color: #d1d5db;
    }
}

/* Accessibility improvements */
.focus-visible:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Custom utilities */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animation utilities */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button hover effects */
.btn-hover-scale {
    transition: transform 0.2s ease;
}

.btn-hover-scale:hover {
    transform: scale(1.05);
}

.btn-hover-shadow {
    transition: box-shadow 0.2s ease;
}

.btn-hover-shadow:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Line clamp utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Smart converter specific styles */
.smart-converter .border-dashed {
    transition: all 0.2s ease-in-out;
}

.smart-converter .border-dashed:hover {
    transform: scale(1.02);
}

/* Tool grid animations */
.tool-card[style*="animation-delay"] {
    animation: fadeInUp 0.6s ease-out both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Feature highlight sections */
.feature-highlight {
    animation: slideInFromSide 0.8s ease-out;
}

@keyframes slideInFromSide {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Category filter buttons */
.category-filter {
    transition: all 0.2s ease-in-out;
}

.category-filter:hover {
    transform: translateY(-1px);
}

/* File upload drag and drop states */
.file-upload-area.dragover {
    border-color: #3b82f6 !important;
    background-color: #eff6ff !important;
    transform: scale(1.02);
}

/* Icon animations */
.icon-float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Search input focus states */
#tool-search:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-color: #3b82f6;
}

/* ===== Mega menu alignment tweaks (Next.js-style) ===== */
#mega-menu .rounded-2xl {
    /* keep the panel fully visible with comfortable breathing room */
    max-height: calc(100vh - 64px);
}

/* Responsive grid adjustments */
@media (max-width: 1280px) {
    .grid.xl\:grid-cols-4 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .grid.lg\:grid-cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .grid.md\:grid-cols-2 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    
    .smart-converter .min-w-\[280px\] {
        min-width: 100%;
    }
    
    .smart-converter .min-h-\[300px\] {
        min-height: 250px;
    }
}