:root {
    --bg-dark: #0f172a;
    --bg-glass: rgba(30, 41, 59, 0.7);
    --border-glass: rgba(255, 255, 255, 0.08);
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #4338ca;
    --secondary: #ec4899;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --radius-lg: 1.5rem;
    --radius-md: 0.75rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 2rem;
}

/* Background animated blobs */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: -1;
}

.blob {
    position: absolute;
    filter: blur(80px);
    border-radius: 50%;
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 30%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
    animation-duration: 25s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 50px) scale(1.1);
    }
}

/* Layout */
.container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 1;
}

.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Header */
header {
    text-align: center;
    margin-bottom: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo i {
    font-size: 2.5rem;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.gradient-text {
    background: linear-gradient(135deg, #a5b4fc 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Dropzone */
.dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--primary-light);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-2px);
}

.dropzone i {
    font-size: 3.5rem;
    color: var(--primary-light);
    margin-bottom: 0.5rem;
}

.dropzone h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.dropzone p {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

.btn-primary:not(:disabled):hover {
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.6);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

/* Video List Container */
.video-list-container {
    margin-top: 2rem;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.list-header {
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.video-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.video-item {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: grab;
}

.video-item:active {
    cursor: grabbing;
}

.video-item.dragging {
    opacity: 0.5;
    background: rgba(99, 102, 241, 0.1);
}

.drag-handle {
    color: var(--text-muted);
    margin-right: 1rem;
    cursor: grab;
}

.video-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.video-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-size {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.video-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
}

#merge-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.125rem;
}

/* Settings Container */
.settings-container {
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

.settings-container label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-select {
    width: 100%;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.form-select option {
    background: var(--bg-dark);
    color: var(--text-main);
    padding: 1rem;
}

/* Processing */
.processing-container {
    margin-top: 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    animation: fadeIn 0.5s ease;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    align-items: center;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.log-terminal {
    background: #000;
    border-radius: var(--radius-md);
    padding: 1rem;
    height: 150px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.8rem;
    color: #10b981;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.log-entry {
    margin: 0;
}

.log-error {
    color: #ef4444;
}

/* Result */
.result-container {
    margin-top: 2rem;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.success-icon {
    font-size: 4rem;
    color: var(--success);
    margin-bottom: 1rem;
    display: inline-block;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

.result-container h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.preview-video {
    width: 100%;
    max-height: 400px;
    border-radius: var(--radius-md);
    background: #000;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Utilities */
.hidden {
    display: none !important;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--danger);
    color: #fca5a5;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: fadeIn 0.3s ease;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 1rem;
}