/* MegaConvert - Custom Styles */

/* ── Upload Zone ────────────────────────────────────── */
.upload-zone {
    transition: all 0.2s ease;
}

.upload-zone:hover {
    transform: translateY(-1px);
}

.upload-zone.dragover {
    animation: upload-pulse 1.5s ease-in-out infinite;
}

@keyframes upload-pulse {
    0%, 100% { border-color: #6366f1; background-color: rgba(99, 102, 241, 0.05); }
    50% { border-color: #818cf8; background-color: rgba(99, 102, 241, 0.1); }
}

/* ── Progress Bar Stripes ───────────────────────────── */
.progress-bar-striped {
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
    animation: progress-stripes 1s linear infinite;
}

@keyframes progress-stripes {
    0% { background-position: 1rem 0; }
    100% { background-position: 0 0; }
}

/* ── Custom Scrollbar ───────────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.dark ::-webkit-scrollbar-thumb {
    background: #374151;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.dark * {
    scrollbar-color: #374151 transparent;
}

/* ── RTL Overrides ──────────────────────────────────── */
[dir="rtl"] .gap-2 > * + * {
    margin-left: 0;
}

[dir="rtl"] .ml-2 {
    margin-left: 0;
    margin-right: 0.5rem;
}

[dir="rtl"] .mr-auto {
    margin-right: 0;
    margin-left: auto;
}

[dir="rtl"] .text-left {
    text-align: right;
}

[dir="rtl"] .text-right {
    text-align: left;
}

/* ── Print Styles ───────────────────────────────────── */
@media print {
    header, footer, .no-print, #toast-container {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    main {
        padding: 0 !important;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* ── Dark Mode Tweaks ───────────────────────────────── */
.dark .upload-zone {
    border-color: #374151;
}

.dark .upload-zone:hover {
    border-color: #6366f1;
}

/* ── Format Icon Colors ─────────────────────────────── */
.format-icon-pdf { color: #ef4444; }
.format-icon-doc, .format-icon-docx { color: #3b82f6; }
.format-icon-xls, .format-icon-xlsx { color: #22c55e; }
.format-icon-ppt, .format-icon-pptx { color: #f97316; }
.format-icon-jpg, .format-icon-jpeg, .format-icon-png { color: #8b5cf6; }
.format-icon-mp4, .format-icon-avi, .format-icon-mkv { color: #ec4899; }
.format-icon-mp3, .format-icon-wav, .format-icon-flac { color: #14b8a6; }
.format-icon-zip, .format-icon-rar, .format-icon-7z { color: #eab308; }
.format-icon-epub, .format-icon-mobi { color: #f59e0b; }
.format-icon-svg { color: #06b6d4; }
.format-icon-webp { color: #a855f7; }
.format-icon-gif { color: #10b981; }

/* ── Transitions ────────────────────────────────────── */
.fade-enter-active, .fade-leave-active {
    transition: opacity 0.2s ease;
}

.fade-enter-from, .fade-leave-to {
    opacity: 0;
}

/* ── Alpine.js cloak (hide elements before Alpine init) */
[x-cloak] {
    display: none !important;
}

/* ── Selection Color ────────────────────────────────── */
::selection {
    background-color: rgba(99, 102, 241, 0.2);
    color: inherit;
}

/* ── Focus Ring ─────────────────────────────────────── */
:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* ── Smooth page transitions ────────────────────────── */
html {
    scroll-behavior: smooth;
}

/* ── Loading skeleton ───────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.dark .skeleton {
    background: linear-gradient(90deg, #1f2937 25%, #374151 50%, #1f2937 75%);
    background-size: 200% 100%;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
