/* Font Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-card-hover: rgba(30, 41, 59, 0.9);
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --primary-glow: linear-gradient(135deg, rgba(99, 102, 241, 0.5) 0%, rgba(168, 85, 247, 0.5) 50%, rgba(236, 72, 153, 0.5) 100%);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(148, 163, 184, 0.1);
    --success: #10b981;
}

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

body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, sans-serif;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
.bg-glow {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.15) 0%, rgba(15, 23, 42, 0) 50%);
    animation: rotate 20s linear infinite;
    z-index: -2;
    pointer-events: none;
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: -1;
    pointer-events: none;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 8px;
}

.logo-container {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
}

.logo-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: var(--primary-gradient);
    opacity: 0.5;
    filter: blur(8px);
    animation: pulse 3s ease-in-out infinite;
}

.logo-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.logo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.title-text {
    color: #fff;
}

.title-highlight {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
}

.subtitle-icon {
    width: 16px;
    height: 16px;
    color: #10b981;
}

/* Upload Area */
.upload-area {
    width: 100%;
}

.upload-label {
    display: block;
    position: relative;
    min-height: 280px;
    border-radius: 20px;
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(12px);
    border: 2px dashed rgba(148, 163, 184, 0.2);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-label:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-4px);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.3);
}

.upload-label.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.upload-decoration {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.upload-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    border-color: rgba(99, 102, 241, 0.3);
    border-style: solid;
    transition: all 0.3s ease;
}

.upload-label:hover .upload-corner {
    width: 36px;
    height: 36px;
    border-color: rgba(99, 102, 241, 0.8);
}

.top-left {
    top: 16px;
    left: 16px;
    border-width: 2px 0 0 2px;
    border-radius: 8px 0 0 0;
}

.top-right {
    top: 16px;
    right: 16px;
    border-width: 2px 2px 0 0;
    border-radius: 0 8px 0 0;
}

.bottom-left {
    bottom: 16px;
    left: 16px;
    border-width: 0 0 2px 2px;
    border-radius: 0 0 0 8px;
}

.bottom-right {
    bottom: 16px;
    right: 16px;
    border-width: 0 2px 2px 0;
    border-radius: 0 0 8px 0;
}

.upload-content {
    height: 100%;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    z-index: 2;
}

.upload-icon-container {
    position: relative;
    margin-bottom: 32px;
}

.upload-icon-glow {
    position: absolute;
    inset: -12px;
    background: var(--primary-gradient);
    border-radius: 50%;
    opacity: 0.2;
    filter: blur(16px);
    transition: opacity 0.3s ease;
}

.upload-label:hover .upload-icon-glow {
    opacity: 0.4;
}

.upload-icon-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #334155, #1e293b);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.upload-label:hover .upload-icon-wrapper {
    transform: scale(1.1) rotate(-5deg);
}

.upload-icon {
    width: 40px;
    height: 40px;
    color: #94a3b8;
    transition: color 0.3s ease;
}

.upload-label:hover .upload-icon {
    color: #fff;
}

.upload-text-container {
    text-align: center;
    margin-bottom: 32px;
}

.upload-text-main {
    display: block;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

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

.upload-features {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.feature-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 100px;
    font-size: 13px;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.feature-tag svg {
    width: 14px;
    height: 14px;
    color: #6366f1;
}

/* Status Area */
.status-area {
    padding: 16px;
    border-radius: 12px;
    animation: slideUp 0.4s ease-out;
}

.status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
}

.status-loading {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.status-error {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    color: #fb7185;
}

.status svg {
    width: 20px;
    height: 20px;
}

.spin {
    animation: spin 1s linear infinite;
}

/* Result Area */
.batch-result-area {
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.batch-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.batch-select-all {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.batch-select-all:hover {
    color: var(--text-main);
}

.batch-select-all input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #6366f1;
    cursor: pointer;
}

.batch-info {
    flex: 1;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

/* Batch List */
.batch-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    max-height: 500px;
    padding: 4px;
    margin-bottom: 16px;
}

.batch-list::-webkit-scrollbar {
    width: 8px;
}

.batch-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.batch-list::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 4px;
}

.batch-list::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* Batch Item */
.batch-item {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    overflow: hidden;
    flex-shrink: 0;
}

.batch-item:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(99, 102, 241, 0.3);
}

.batch-item.selected {
    border-color: rgba(99, 102, 241, 0.5);
}

.batch-item.active {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(99, 102, 241, 0.5);
}

.batch-item-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    width: 100%;
    cursor: pointer;
}

.batch-item-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #6366f1;
    cursor: pointer;
    flex-shrink: 0;
}

.batch-item-thumbnail {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(15, 23, 42, 0.5);
    flex-shrink: 0;
}

.batch-item-info {
    flex: 1;
    min-width: 0;
}

.batch-item-name {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.batch-item-status {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.batch-item-status.pending {
    color: var(--text-muted);
}

.batch-item-status.processing {
    color: #a855f7;
}

.batch-item-status.done {
    color: #10b981;
}

.batch-item-status.error {
    color: #f43f5e;
}

.status-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.status-icon {
    width: 14px;
    height: 14px;
}

.batch-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.batch-item-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-decoration: none;
}

.batch-item-btn:hover {
    background: rgba(99, 102, 241, 0.4);
    color: #fff;
}

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

.btn-toggle {
    background: transparent;
    color: var(--text-muted);
}

.btn-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.btn-toggle svg {
    transition: transform 0.3s ease;
}

.batch-item.active .btn-toggle svg {
    transform: rotate(180deg);
}

.batch-item-preview {
    width: 100%;
    height: 0;
    overflow: hidden;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(15, 23, 42, 0.3);
}

.batch-item.active .batch-item-preview {
    height: 240px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.preview-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background-image:
        linear-gradient(45deg, #1e293b 25%, transparent 25%),
        linear-gradient(-45deg, #1e293b 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1e293b 75%),
        linear-gradient(-45deg, transparent 75%, #1e293b 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.text-muted {
    color: var(--text-muted);
    font-size: 13px;
}

/* Buttons */
.btn {
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    position: relative;
    text-decoration: none;
    overflow: hidden;
    height: 44px;
    padding: 0 20px;
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-secondary {
    flex: 1;
    background: rgba(30, 41, 59, 0.5);
    color: #94a3b8;
    padding: 0 16px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover {
    background: rgba(30, 41, 59, 0.8);
    color: #fff;
}

.btn-primary {
    flex: 2;
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 6px 16px -2px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -2px rgba(99, 102, 241, 0.6);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-sm {
    height: 36px;
    padding: 0 14px;
    font-size: 13px;
}

.btn-sm svg {
    width: 16px;
    height: 16px;
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    transform: skewX(-20deg);
    animation: shine 3s infinite;
}

/* Actions */
.actions {
    display: flex;
    gap: 12px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 16px 0;
    position: relative;
}

.footer-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.footer p {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    opacity: 0.6;
}

.footer svg {
    width: 14px;
    height: 14px;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.3;
    }
    100% {
        transform: scale(0.95);
        opacity: 0.5;
    }
}

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

@keyframes shine {
    0% {
        left: -100%;
    }
    20% {
        left: 200%;
    }
    100% {
        left: 200%;
    }
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 24px 16px;
    }

    .title {
        font-size: 26px;
    }

    .upload-label {
        min-height: 240px;
    }

    .upload-content {
        min-height: 240px;
        padding: 32px 16px;
    }

    .upload-features {
        gap: 10px;
    }

    .feature-tag {
        padding: 6px 12px;
        font-size: 12px;
    }

    .batch-toolbar {
        flex-wrap: wrap;
        gap: 12px;
    }

    .batch-select-all {
        order: 1;
    }

    .batch-info {
        order: 3;
        width: 100%;
    }

    .batch-download-btn {
        order: 2;
        margin-left: auto;
    }
}
