:root {
    --bg-dark: #0a0a0c;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent-glow: rgba(0, 150, 255, 0.4);
    --primary: #0096ff;
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0ab;
    --success: #00d26a;
    --error: #ff4757;
    --card-bg: rgba(20, 20, 25, 0.7);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(0, 150, 255, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(150, 0, 255, 0.05) 0%, transparent 40%);
    overflow-x: hidden;
}

.glass-container {
    width: 90%;
    max-width: 800px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.8s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #0096ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -2px;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.api-config {
    margin-bottom: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 16px;
    animation: slideUp 0.5s ease-out;
}

.api-config label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#apiKeyInput {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}

#apiKeyInput:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 150, 255, 0.1);
}

.info-tip {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.info-tip a {
    color: var(--primary);
    text-decoration: none;
}

.upload-area {
    border: 2px dashed var(--glass-border);
    border-radius: 20px;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.01);
    margin-bottom: 2rem;
    position: relative;
}

.upload-area.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(1);
}

.upload-area:hover:not(.disabled) {
    border-color: var(--primary);
    background: rgba(0, 150, 255, 0.05);
    box-shadow: 0 0 20px rgba(0, 150, 255, 0.1);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    color: var(--primary);
}

.browse-btn {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 600;
}

.url-input-section {
    margin-bottom: 2rem;
    animation: slideUp 0.5s ease-out;
}

.input-group-row {
    display: flex;
    gap: 1rem;
}

#manualUrlInput {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}

#manualUrlInput:focus {
    border-color: var(--primary);
}

.progress-section,
.result-section {
    margin-top: 2rem;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h3 {
    margin-bottom: 0;
}

.pulse {
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 150, 255, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 150, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 150, 255, 0);
    }
}

h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.file-item {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.file-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.file-preview {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--glass-border);
    flex-shrink: 0;
}

.preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.file-name {
    font-weight: 500;
    font-size: 0.95rem;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.uploading {
    background: rgba(0, 150, 255, 0.1);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.status-badge.success {
    background: rgba(0, 210, 106, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-badge.failed {
    background: rgba(255, 71, 87, 0.1);
    color: var(--error);
    border: 1px solid var(--error);
}

.reorder-controls {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover:not(:disabled) {
    background: var(--glass-border);
    color: white;
    border-color: var(--primary);
}

.icon-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.copy-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

textarea {
    width: 100%;
    height: 120px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-primary);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    resize: none;
    outline: none;
}

textarea:focus {
    border-color: var(--primary);
}

.primary-btn,
.secondary-btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.primary-btn {
    background: var(--primary);
    color: white;
}

.primary-btn:hover {
    background: #0076cc;
    transform: translateY(-2px);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

.secondary-btn:hover {
    background: var(--glass-border);
    color: white;
}

footer {
    margin-top: 3rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: none;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}