:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --bg-card: rgba(255, 255, 255, 0.95);
    --border-color: rgba(0, 0, 0, 0.1);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.main-content {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
}

.tool-header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.tool-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.tool-header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Upload Section */
.upload-section {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 2px dashed var(--primary-color);
    border-radius: 24px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: 800px;
    margin: 0 auto;
}

.upload-section:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.upload-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.upload-card h3 {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 10px;
}

.upload-card p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.upload-card p span {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
}

.upload-card small {
    display: block;
    margin-top: 15px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Tool Container */
.tool-container {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden {
    display: none !important;
}

.bulk-actions-bar {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
    gap: 15px;
    position: sticky;
    top: 80px;
    z-index: 10;
}

.bulk-info {
    font-weight: 600;
    color: var(--text-main);
}

.bulk-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.global-format-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f1f5f9;
    padding: 8px 15px;
    border-radius: 10px;
}

.global-format-selector label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.global-format-selector select {
    background: transparent;
    border: none;
    font-weight: 600;
    color: var(--primary-color);
    outline: none;
    cursor: pointer;
}

/* Button Styles */
.primary-btn, .secondary-btn, .add-btn, .danger-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.primary-btn { background: var(--primary-color); color: white; }
.primary-btn:hover { background: var(--primary-hover); transform: translateY(-2px); }

.secondary-btn { background: var(--success-color); color: white; }
.secondary-btn:hover:not(:disabled) { opacity: 0.9; transform: translateY(-2px); }
.secondary-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.add-btn { background: #f1f5f9; color: var(--text-main); }
.add-btn:hover { background: #e2e8f0; }

.danger-btn { background: #fee2e2; color: var(--danger-color); }
.danger-btn:hover { background: #fecaca; }

/* Conversion List */
.conversion-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.conversion-item {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 15px 20px;
    display: grid;
    grid-template-columns: 80px 1fr 150px 150px 100px 50px;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.conversion-item:hover {
    transform: scale(1.01);
}

.item-preview {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f5f9;
}

.item-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-info h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.item-info p {
    margin: 5px 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.item-format select {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 0.85rem;
    outline: none;
}

.item-status {
    text-align: center;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending { background: #f1f5f9; color: var(--text-muted); }
.status-processing { background: #e0e7ff; color: var(--primary-color); }
.status-completed { background: #dcfce7; color: var(--success-color); }
.status-error { background: #fee2e2; color: var(--danger-color); }

.item-actions {
    display: flex;
    justify-content: flex-end;
}

.download-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--success-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
}

.download-icon-btn:hover { transform: scale(1.1); }
.download-icon-btn.disabled { opacity: 0.3; pointer-events: none; }

.remove-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.remove-btn:hover { color: var(--danger-color); }

/* Progress Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loader-container {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    width: 90%;
    max-width: 400px;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-info {
    margin-top: 15px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    margin: 10px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

/* Responsive */
@media (max-width: 992px) {
    .conversion-item {
        grid-template-columns: 80px 1fr 120px 80px 40px;
        gap: 15px;
    }
    .item-status { display: none; }
}

@media (max-width: 768px) {
    .bulk-actions-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .bulk-controls {
        flex-direction: column;
    }
    .conversion-item {
        grid-template-columns: 60px 1fr 50px;
        grid-template-rows: auto auto;
    }
    .item-format {
        grid-column: 1 / span 3;
    }
}
