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

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --info-color: #06b6d4;
    --info-hover: #0891b2;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

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

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

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

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

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.card-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.status-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 8px;
}

.status-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.status-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 8px;
    margin-top: 16px;
}

.indicator-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--secondary-color);
    animation: pulse 2s infinite;
}

.indicator-dot.active {
    background: var(--success-color);
}

.indicator-dot.processing {
    background: var(--warning-color);
}

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

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.file-input-wrapper {
    position: relative;
}

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

.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    background: var(--bg-color);
    cursor: pointer;
    transition: all 0.2s;
}

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

.file-icon {
    font-size: 1.5rem;
}

.file-text {
    font-weight: 500;
    color: var(--text-primary);
}

.file-name {
    padding: 12px;
    background: var(--bg-color);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: none;
}

.file-name.show {
    display: block;
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

.btn-secondary:hover:not(:disabled) {
    background: var(--secondary-hover);
    transform: translateY(-1px);
}

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

.btn-danger:hover:not(:disabled) {
    background: var(--danger-hover);
    transform: translateY(-1px);
}

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

.btn-info:hover:not(:disabled) {
    background: var(--info-hover);
    transform: translateY(-1px);
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.message {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: none;
}

.message.show {
    display: block;
}

.message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.message.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    z-index: 1000;
    color: white;
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Results Table Styles */
.results-card {
    margin-top: 24px;
}

.results-container {
    width: 100%;
}

.table-wrapper {
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    /* Custom scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-color);
}

.table-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.results-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--primary-color);
    color: white;
}

.results-table th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

.results-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-color);
    word-break: break-word;
}

.results-table tbody tr {
    transition: background-color 0.2s;
}

.results-table tbody tr:hover {
    background-color: var(--bg-color);
}

.results-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.results-table tbody tr:nth-child(even):hover {
    background-color: var(--bg-color);
}

.no-results {
    text-align: center;
    padding: 40px !important;
    color: var(--text-secondary);
    font-style: italic;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.success {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.failed {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.error {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.results-info {
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
}

.url-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.url-cell a {
    color: var(--primary-color);
    text-decoration: none;
}

.url-cell a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 2rem;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    .actions-grid {
        grid-template-columns: 1fr;
    }

    .results-table {
        font-size: 0.8rem;
    }

    .results-table th,
    .results-table td {
        padding: 8px 4px;
    }

    .table-wrapper {
        max-height: 400px;
    }
}

