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

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

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

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    position: relative;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

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

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

small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 0.85rem;
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    display: inline-block;
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

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

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
    margin-top: 5px;
    background: #667eea;
    color: white;
}

.btn-small:hover {
    background: #5568d3;
}

.btn-small:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Case Header */
.case-header {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.case-header h2 {
    color: #667eea;
    margin-bottom: 10px;
}

.case-meta {
    display: flex;
    gap: 20px;
    color: #666;
}

.case-meta code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

/* Workflow Progress */
.workflow-progress {
    margin-bottom: 30px;
}

.workflow-progress h3 {
    margin-bottom: 20px;
    color: #333;
}

.steps {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.step {
    flex: 1;
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
}

.step.active {
    border-color: #667eea;
    background: #f0f4ff;
}

.step.complete {
    border-color: #4caf50;
    background: #f1f8f4;
}

.step.error {
    border-color: #f44336;
    background: #fff5f5;
}

.step-icon {
    width: 40px;
    height: 40px;
    line-height: 40px;
    margin: 0 auto 10px;
    background: #e0e0e0;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.2rem;
}

.step.active .step-icon {
    background: #667eea;
    color: white;
}

.step.complete .step-icon {
    background: #4caf50;
    color: white;
}

.step-label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #555;
}

.ai-badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    margin-left: 4px;
    font-weight: 500;
    vertical-align: middle;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

/* Default tab button styling (for white/light backgrounds) */
.tab-btn {
    padding: 12px 24px;
    background: #f0f0f0;
    border: none;
    border-radius: 8px 8px 0 0;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: #e0e0e0;
    color: #333;
    transform: translateY(-2px);
}

.tab-btn.active {
    background: white;
    color: #667eea;
    border-bottom: 3px solid #667eea;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* Tab buttons on gradient backgrounds */
[style*="linear-gradient"] .tab-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

[style*="linear-gradient"] .tab-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    color: white;
}

[style*="linear-gradient"] .tab-btn.active {
    background: white;
    color: #667eea;
    border-bottom: none;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.output-box {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    min-height: 300px;
    max-height: 600px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.placeholder {
    color: #999;
    font-style: italic;
    text-align: center;
    margin-top: 100px;
}

/* Evidence Items */
.evidence-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.evidence-header {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.evidence-meta {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
}

.chunk-preview {
    background: #f5f5f5;
    padding: 10px;
    border-left: 3px solid #667eea;
    margin-top: 10px;
    font-size: 0.85rem;
    max-height: 200px;
    overflow-y: auto;
}

/* Status Message */
.status-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
}

.status-message.show {
    opacity: 1;
    transform: translateY(0);
}

.status-message.success {
    background: #4caf50;
    color: white;
}

.status-message.error {
    background: #f44336;
    color: white;
}

.status-message.info {
    background: #2196f3;
    color: white;
}

/* Markdown Rendering */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #333;
}

.markdown-content p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.markdown-content code {
    background: #fff9e6;
    padding: 2px 6px;
    border-radius: 3px;
    color: #d63384;
}

/* JSON Display */
.json-display {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
}

.json-key {
    color: #9cdcfe;
}

.json-string {
    color: #ce9178;
}

.json-number {
    color: #b5cea8;
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .steps {
        flex-direction: column;
    }
    
    .case-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .tabs {
        overflow-x: auto;
    }
}
