:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Animation */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    filter: blur(80px);
}

.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.4;
    animation: move 20s infinite alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #4f46e5;
    top: -10%;
    left: -10%;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: #7c3aed;
    bottom: -10%;
    right: -10%;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #2563eb;
    top: 40%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes move {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(100px, 50px) scale(1.1); }
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

header {
    text-align: center;
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Glass Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Config Section */
.config-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.input-group input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* File Section */
.file-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.file-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.back-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.file-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Mode Selector */
.mode-selector {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 12px;
    gap: 4px;
    margin-bottom: 8px;
}

.mode-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: none;
}

.mode-tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    transform: none;
}

.mode-tab.active {
    background: var(--primary);
    color: white;
}

.split-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

/* Split Config */
.split-config {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.input-mini-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-mini-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.input-mini-group input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    font-size: 0.9rem;
}

.input-mini-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.status.error {
    color: #ef4444;
    font-weight: 500;
}

.status.warning {
    color: #f59e0b;
    font-weight: 500;
    font-size: 0.85rem;
    margin-top: 8px;
    text-align: center;
    background: rgba(245, 158, 11, 0.1);
    padding: 8px;
    border-radius: 8px;
}

.drop-zone {
    border: 2px dashed var(--glass-border);
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.drop-zone .icon {
    font-size: 2.5rem;
}

.drop-zone p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.file-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

/* Previews */
.preview {
    width: 100%;
    height: 100%;
    min-height: 150px;
    border-radius: 12px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: rgba(0, 0, 0, 0.2);
    display: none;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 12px;
}

.preview-item {
    aspect-ratio: 2/3;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    border: 1px solid var(--glass-border);
}

/* Action Section */
.action-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 10px;
}

button {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    background: #334155;
    cursor: not-allowed;
    opacity: 0.6;
}

.status {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #6366f1, #c084fc);
    transition: width 0.3s ease;
}

footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .config-section, .file-section {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2.2rem;
    }
    
    .glass-panel {
        padding: 24px;
    }
}
