/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Futuristic Color Palette */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-color: #00ffff;
    --accent-glow: rgba(0, 255, 255, 0.5);
    --bg-dark: #0a0a0a;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: #b8b8b8;
    --border-glow: rgba(102, 126, 234, 0.3);
    --success-color: #00ff88;
    --error-color: #ff4757;
    
    /* Spacing */
    --container-max-width: 1200px;
    --section-padding: 2rem;
    --border-radius: 16px;
    --border-radius-small: 8px;
    
    /* Animations */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Exo 2', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(102, 126, 234, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(102, 126, 234, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.floating-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(2px 2px at 20px 30px, var(--accent-color), transparent),
                radial-gradient(2px 2px at 40px 70px, var(--accent-color), transparent),
                radial-gradient(1px 1px at 90px 40px, var(--accent-color), transparent),
                radial-gradient(1px 1px at 130px 80px, var(--accent-color), transparent);
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: particleFloat 15s ease-in-out infinite;
    opacity: 0.3;
}

@keyframes particleFloat {
    0%, 100% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-20px) translateX(10px); }
    50% { transform: translateY(-40px) translateX(-5px); }
    75% { transform: translateY(-20px) translateX(-10px); }
}

/* Container */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    padding: 2rem 0;
    text-align: center;
    position: relative;
}

.logo {
    font-family: 'Orbitron', monospace;
    font-size: 3rem;
    font-weight: 900;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.highlight {
    color: var(--accent-color);
    text-shadow: 0 0 20px var(--accent-glow);
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Main Content */
.main {
    padding: 2rem 0 4rem;
}

/* Upload Section */
.upload-section {
    margin-bottom: 3rem;
}

.upload-area {
    position: relative;
    border: 2px dashed var(--border-glow);
    border-radius: var(--border-radius);
    padding: 4rem 2rem;
    text-align: center;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    transition: all var(--transition-smooth);
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, var(--accent-glow), transparent);
    animation: rotate 4s linear infinite;
    opacity: 0;
    transition: opacity var(--transition-smooth);
}

.upload-area:hover::before {
    opacity: 1;
}

.upload-area.drag-over {
    border-color: var(--accent-color);
    background: rgba(0, 255, 255, 0.1);
    transform: scale(1.02);
}

.upload-area.drag-over::before {
    opacity: 1;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

.upload-content {
    position: relative;
    z-index: 1;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.upload-area h2 {
    font-family: 'Orbitron', monospace;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.upload-area p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
    pointer-events: none;
}

.upload-overlay.show {
    opacity: 1;
}

.upload-overlay-content {
    text-align: center;
    position: relative;
}

.pulse-ring {
    width: 80px;
    height: 80px;
    border: 3px solid var(--accent-color);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        box-shadow: 0 0 0 0 var(--accent-glow);
    }
    50% {
        transform: scale(1);
        box-shadow: 0 0 0 20px rgba(0, 255, 255, 0);
    }
    100% {
        transform: scale(0.8);
        box-shadow: 0 0 0 0 rgba(0, 255, 255, 0);
    }
}

/* Buttons */
.btn {
    position: relative;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--border-radius-small);
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all var(--transition-smooth);
    overflow: hidden;
    background: transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--text-primary);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
}

.btn-secondary {
    border: 2px solid var(--border-glow);
    color: var(--text-primary);
    background: var(--bg-card);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    border-color: var(--accent-color);
    background: rgba(0, 255, 255, 0.1);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.btn:hover .btn-glow {
    left: 100%;
}

/* Files Section */
.files-section {
    margin-bottom: 3rem;
}

.files-section h3 {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
    text-align: center;
}

.files-list {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.file-item {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glow);
    border-radius: var(--border-radius-small);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
    cursor: default;
}

.file-item:hover {
    border-color: var(--accent-color);
    transform: translateX(5px);
}

/* SortableJS states */
.drag-chosen {
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4), 0 0 0 1px var(--border-glow) inset;
}

.drag-ghost {
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.06);
    transform: rotate(1deg) scale(0.99);
}

.drag-dragging {
    cursor: grabbing;
}

.files-list .file-item {
    will-change: transform;
}

.file-icon {
    font-size: 2rem;
    opacity: 0.7;
    cursor: grab;
}

.file-info {
    flex: 1;
    cursor: grab;
}

.file-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.file-size {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.file-action {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.file-action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.file-action:hover {
    color: var(--accent-color);
    background: rgba(0, 255, 255, 0.1);
}

.file-remove:hover {
    color: var(--error-color);
    background: rgba(255, 71, 87, 0.1);
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Progress Section */
.progress-section {
    margin-bottom: 3rem;
}

.progress-container {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    width: 0%;
    transition: width var(--transition-smooth);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 20px 20px;
    animation: progressStripes 1s linear infinite;
}

@keyframes progressStripes {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

.progress-text {
    font-family: 'Orbitron', monospace;
    color: var(--accent-color);
    font-weight: 600;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    padding: 2rem 0;
    margin-top: auto;
    border-top: 1px solid var(--border-glow);
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer p {
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--accent-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo {
        font-size: 2rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .upload-area h2 {
        font-size: 1.4rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .footer .container {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .logo {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .tagline {
        font-size: 0.9rem;
    }
    
    .upload-area {
        padding: 1.5rem 0.5rem;
    }
    
    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Utility Classes */
.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;
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scale-in {
    animation: scaleIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}