/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    padding: 2rem 1rem;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
    overflow: hidden;
    animation: fadeInUp 0.5s ease-out;
}

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

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.step-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.step-badge.success {
    background: var(--success);
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.card-body {
    padding: 2rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.label-hint {
    display: block;
    font-weight: 400;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

input[type="url"],
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
}

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

/* File Input */
.file-input-wrapper {
    position: relative;
}

input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-preview {
    padding: 2rem;
    border: 2px dashed var(--border);
    border-radius: 0.5rem;
    text-align: center;
    background: var(--bg);
    transition: all 0.2s;
    cursor: pointer;
}

.file-preview:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

.file-preview.has-file {
    border-color: var(--success);
    background: #f0fdf4;
}

.placeholder {
    color: var(--text-light);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

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

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-loader {
    animation: spin 1s linear infinite;
}

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

/* Status Box */
.status-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.status-icon {
    font-size: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-size: 1.125rem;
    font-weight: 500;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 2rem;
}

.progress-bar {
    height: 1.5rem;
    background: var(--bg);
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%);
    border-radius: 1rem;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 600;
}

/* Processing Details */
.processing-details {
    background: var(--bg);
    padding: 1.5rem;
    border-radius: 0.5rem;
}

.processing-details h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text);
}

#processed-leads-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

#processed-leads-list li {
    padding: 0.75rem;
    background: white;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    border-left: 3px solid var(--success);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Success Card */
.success-card .card-header {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
}

.success-message {
    text-align: center;
    padding: 2rem 0;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.success-message p {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.success-hint {
    color: var(--text-light);
    font-size: 0.975rem;
}

.success-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.success-actions .btn {
    flex: 1;
}

/* Error Box */
.error-box {
    background: #fef2f2;
    border: 2px solid var(--error);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.error-icon {
    font-size: 2rem;
}

.error-message {
    flex: 1;
    color: var(--error);
    font-weight: 500;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    opacity: 0.9;
    margin-top: 3rem;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 640px) {
    header h1 {
        font-size: 2rem;
    }

    .card-body {
        padding: 1.5rem;
    }

    .success-actions {
        flex-direction: column;
    }
}
