/* CSS Variables & Reset */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --bg-dark: #0f0f23;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --radius: 16px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated Background */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(16, 185, 129, 0.1) 0%, transparent 40%);
    z-index: -1;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    color: var(--primary);
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Cards */
.upload-card,
.results-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    color: var(--primary);
    opacity: 0.8;
}

.upload-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.upload-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Buttons */
.btn-select,
.btn-upload,
.btn-copy-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-select {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-select:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.btn-select svg,
.btn-upload svg,
.btn-copy-all svg {
    width: 18px;
    height: 18px;
}

/* Queue Section */
.queue-section {
    display: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.queue-section.active {
    display: block;
}

.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.queue-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.queue-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-clear {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-clear:hover {
    color: var(--error);
    border-color: var(--error);
}

.btn-upload {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
}

.btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
}

.btn-upload:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* File List */
.file-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.file-item .file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item .file-size {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.file-item .file-status {
    width: 20px;
    height: 20px;
}

.file-item .file-status.pending {
    color: var(--text-muted);
}

.file-item .file-status.uploading {
    color: var(--primary);
    animation: spin 1s linear infinite;
}

.file-item .file-status.success {
    color: var(--success);
}

.file-item .file-status.error {
    color: var(--error);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Progress Section */
.progress-section {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
}

.progress-section.active {
    display: block;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.progress-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

/* Results Card */
.results-card {
    display: none;
}

.results-card.active {
    display: block;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.results-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--success);
}

.results-header h3 svg {
    width: 20px;
    height: 20px;
}

.results-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.results-stats {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.success-count {
    color: var(--success);
    font-weight: 600;
}

.error-count {
    color: var(--error);
    font-weight: 600;
}

.btn-copy-all {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-copy-all:hover {
    background: var(--primary-dark);
}

.btn-copy-all.copied {
    background: var(--success);
}

/* URL List */
.url-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.url-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.url-item.success {
    border-left: 3px solid var(--success);
}

.url-item.error {
    border-left: 3px solid var(--error);
}

.url-item .url-index {
    color: var(--text-muted);
    min-width: 30px;
}

.url-item .url-filename {
    color: var(--text-secondary);
    min-width: 120px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.url-item .url-link {
    flex: 1;
    color: var(--primary-light);
    text-decoration: none;
    word-break: break-all;
    font-family: 'Courier New', monospace;
}

.url-item .url-link:hover {
    text-decoration: underline;
}

.url-item .url-error {
    flex: 1;
    color: var(--error);
}

.url-item .btn-copy {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.url-item .btn-copy:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.url-item .btn-copy.copied {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

/* Footer */
.footer {
    text-align: center;
    padding-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    border-color: var(--success);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    .upload-card,
    .results-card {
        padding: 1rem;
    }

    .queue-header,
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .url-item .url-filename {
        display: none;
    }
}