/* Dashboard styles */
.dashboard {
    min-height: 100vh;
    background: #f9fafb;
    padding: 24px 0;
}

.header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 20px 0;
    margin-bottom: 32px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.header h1 {
    margin: 0;
    color: #111827;
    font-size: 24px;
    font-weight: 600;
}

.main-action {
    text-align: center;
    margin-bottom: 32px;
}

.source-selection {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.source-selection label {
    font-weight: 500;
    color: #374151;
}

.preparation-message {
    display: none;
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background-color: #f0f8ff;
    border: 1px solid #4a90e2;
    border-radius: 8px;
    color: #2c5aa0;
    font-weight: 500;
}

.preparation-message .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.source-selection select {
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 14px;
}

.filter-container {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    overflow: hidden;
    display: none;
}

.filter-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f3f4f6;
    background: #f9fafb;
}

.filter-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.filter-body {
    padding: 24px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 20px;
    align-items: start;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    width: 100%;
}

.filter-group label {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.filter-group select {
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #1f2937;
    font-size: 16px;
    transition: all 0.2s ease-in-out;
    min-height: 48px;
    appearance: auto;
    -webkit-appearance: auto;
    -moz-appearance: auto;
}

.filter-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-group select option {
    padding: 8px 12px;
    background: #ffffff;
    color: #1f2937;
    font-size: 16px;
    line-height: 1.5;
}

.progress-container {
    display: none;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    overflow: hidden;
}

.progress-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f3f4f6;
    background: #f9fafb;
}

.progress-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.progress-body {
    padding: 24px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f3f4f6;
    border-radius: 8px;
    overflow: hidden;
    margin: 16px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb 0%, #1d4ed8 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 8px;
}

.progress-text {
    font-weight: 500;
    color: #111827;
    margin-bottom: 8px;
}

.progress-current {
    font-size: 14px;
    color: #6b7280;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    background: #f9fafb;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    margin-top: 16px;
}

#results-container {
    display: none;
}

.results-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.results-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f3f4f6;
    background: #f9fafb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

th, td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    line-height: 1.5;
}

th {
    background: #f9fafb;
    color: #374151;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 5;
}

tbody tr {
    transition: background-color 0.15s ease-in-out;
}

tbody tr:hover {
    background: #f9fafb;
}

tbody tr:last-child td {
    border-bottom: none;
}

.hash {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 12px;
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 4px;
    max-width: 140px;
    word-break: break-all;
    color: #6b7280;
}

.grade {
    font-weight: 600;
    color: #059669;
    text-align: center;
    background: #ecfdf5;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    min-width: 60px;
}

.no-grade {
    color: #9ca3af;
    font-style: italic;
    text-align: center;
}

.error {
    color: #dc2626;
    background: #fef2f2;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 500;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.status-success {
    background: #ecfdf5;
    color: #059669;
}

.status-error {
    background: #fef2f2;
    color: #dc2626;
}

.status-warning {
    background: #fffbeb;
    color: #d97706;
}

@media (max-width: 768px) {
    .dashboard {
        padding: 16px 0;
    }

    .header-content {
        padding: 0 16px;
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .filter-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .results-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    th, td {
        padding: 12px 8px;
        font-size: 13px;
    }

    .hash {
        max-width: 100px;
        font-size: 11px;
    }
}