:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #10b981;
    --danger: #ef4444;
    --bg-main: #f9fafb;
    --bg-card: #ffffff;
    --bg-hover: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 20%, rgba(239, 68, 68, 0.03) 0%, transparent 50%);
    z-index: -1;
    animation: backgroundShift 30s ease-in-out infinite;
}

@keyframes backgroundShift {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(10deg); }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin: 60px 0 40px;
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    letter-spacing: -2px;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.25rem;
    font-weight: 300;
}

nav {
    margin-top: 20px;
}

nav a {
    color: var(--primary);
    text-decoration: none;
    padding: 8px 16px;
    margin: 0 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

nav a:hover {
    background: var(--bg-hover);
    transform: translateY(-1px);
}

.upload-area {
    background: var(--bg-card);
    border: 3px dashed var(--border-color);
    border-radius: 20px;
    padding: 60px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: slideIn 0.8s ease-out 0.2s both;
    box-shadow: var(--shadow-md);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.upload-area::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.upload-area:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.upload-area.dragover {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
    transform: scale(1.02);
}

.upload-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.upload-area:hover .upload-icon {
    opacity: 0.8;
    transform: scale(1.1) rotate(-5deg);
}

.upload-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.upload-hint {
    font-size: 14px;
    color: var(--text-secondary);
}

#fileInput {
    display: none;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-hover);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 20px;
    display: none;
}

.progress-bar.active {
    display: block;
    animation: progressFadeIn 0.3s ease;
}

@keyframes progressFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: progressShine 1.5s linear infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.backend-selection {
    margin-top: 30px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    animation: slideIn 0.8s ease-out 0.4s both;
}

.backend-selection h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

#backendCheckboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.backend-checkbox-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-hover);
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.backend-checkbox-item:hover {
    background: var(--bg-main);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.backend-checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--primary);
}

.backend-checkbox-item label {
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
}

.preview-area {
    margin-top: 40px;
}

.preview-item {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    animation: slideInFromBottom 0.5s ease;
}

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

.preview-item img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.preview-info {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    padding: 8px 12px;
    background: var(--bg-hover);
    border-radius: 8px;
    display: inline-block;
}
.preview-header {
    display: flex;
    flex-direction: column; 
    align-items: flex-start; 
    gap: 2px; 
    margin-bottom: 0px;
}

.preview-links {
    margin-top: 2px;
}

.link-group {
    margin-bottom: 16px;
    background: var(--bg-hover);
    padding: 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.link-label {
    font-size: 14px;
    color: var(--text-secondary);
    min-width: 100px;
    font-weight: 600;
}

.link-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-card);
    font-family: monospace;
    transition: all 0.2s ease;
}

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

.copy-btn {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.copy-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
}

.copy-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.copy-btn:active::before {
    width: 200px;
    height: 200px;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2.5rem;
    }
    
    .backend-checkbox-item {
        width: 100%;
    }
    
    .link-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .link-label {
        min-width: unset;
    }
}