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

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

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

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 5px;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
}

/* Main */
main {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

/* Search Section */
.search-section h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #555;
}

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

.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

select, input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

select:focus, input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.error {
    color: #e53e3e;
    font-size: 0.9rem;
    display: block;
    margin-top: 5px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

/* Results Section */
.results-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #e0e0e0;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.results-stats {
    color: #666;
    font-size: 1rem;
}

/* Case Cards */
.vendor-group {
    margin-bottom: 40px;
}

.vendor-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.cases-grid {
    display: grid;
    gap: 20px;
    margin-top: 0;
}

.case-card {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.case-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.case-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 10px;
}

.case-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #666;
}

.case-meta span {
    display: flex;
    align-items: center;
}

.case-summary {
    color: #555;
    line-height: 1.8;
    margin-bottom: 15px;
}

.case-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.case-link:hover {
    color: #764ba2;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.page-btn {
    padding: 10px 15px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.page-btn:hover {
    background: #667eea;
    color: white;
}

.page-btn.active {
    background: #667eea;
    color: white;
}

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

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
}

/* Progress Section */
.progress-section {
    margin-top: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.progress-header h3 {
    font-size: 1.2rem;
    color: #333;
    margin: 0;
}

#progressPercent {
    font-size: 1.4rem;
    font-weight: 700;
    color: #667eea;
}

.progress-bar-container {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

.logs-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e0e0e0;
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.logs-header h4 {
    font-size: 1.1rem;
    color: #333;
    margin: 0;
}

.btn-clear-logs {
    padding: 5px 15px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-clear-logs:hover {
    background: #d32f2f;
}

.logs-content {
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.log-entry {
    padding: 8px 12px;
    margin-bottom: 5px;
    border-radius: 4px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

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

.log-entry.info {
    background: #e3f2fd;
    border-left: 3px solid #2196F3;
}

.log-entry.success {
    background: #e8f5e9;
    border-left: 3px solid #4CAF50;
}

.log-entry.warning {
    background: #fff3e0;
    border-left: 3px solid #ff9800;
}

.log-entry.error {
    background: #ffebee;
    border-left: 3px solid #f44336;
}

.log-timestamp {
    color: #666;
    font-size: 0.8rem;
    white-space: nowrap;
    min-width: 80px;
}

.log-message {
    flex: 1;
    color: #333;
}

.log-icon {
    font-size: 1.1rem;
}

/* Scrollbar styling for logs */
.logs-content::-webkit-scrollbar {
    width: 8px;
}

.logs-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.logs-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.logs-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: white;
}

footer a {
    color: white;
    text-decoration: underline;
}

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

    .subtitle {
        font-size: 1rem;
    }

    main {
        padding: 20px;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .btn-primary {
        padding: 12px 30px;
    }
}
