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

body {
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 90vh;
}

header {
    background: linear-gradient(135deg, #002868 0%, #004ba0 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

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

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

.upload-section {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.upload-area {
    border: 3px dashed #002868;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9fa;
}

.upload-area:hover {
    border-color: #004ba0;
    background: #e9ecef;
}

.upload-area.drag-over {
    border-color: #BF0A30;
    background: #fff5f5;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.upload-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #002868;
    margin-bottom: 10px;
}

.upload-hint {
    font-size: 0.9rem;
    color: #666;
}

.status-message {
    padding: 15px;
    border-radius: 8px;
    font-size: 0.95rem;
    text-align: center;
    display: none;
}

.status-message.show {
    display: block;
}

.status-message.processing {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.status-message.success {
    background: #d4edda;
    border: 1px solid #28a745;
    color: #155724;
}

.status-message.error {
    background: #f8d7da;
    border: 1px solid #dc3545;
    color: #721c24;
}

.results-section {
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.results-section h2 {
    color: #002868;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.result-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.result-label {
    font-weight: 600;
    color: #002868;
    font-size: 1rem;
}

.result-value {
    color: #BF0A30;
    font-weight: 600;
    font-size: 1rem;
}

.summary-text {
    color: #333;
    line-height: 1.6;
    font-size: 0.95rem;
}

.key-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.field-item {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.field-name {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 4px;
}

.field-value {
    font-size: 0.95rem;
    color: #333;
    font-weight: 500;
}

.extracted-text {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    max-height: 300px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.clear-button {
    padding: 14px 24px;
    background: #002868;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    align-self: center;
}

.clear-button:hover {
    background: #004ba0;
}

footer {
    padding: 15px;
    text-align: center;
    background: #f8f9fa;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid #e0e0e0;
}

footer p {
    margin-bottom: 8px;
}

.back-link {
    color: #BF0A30;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.3s;
    display: inline-block;
    font-weight: 500;
}

.back-link:hover {
    background: #e9ecef;
}

.diagram-link {
    color: #002868;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.diagram-link:hover {
    color: #004ba0;
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        min-height: 95vh;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .upload-section,
    .results-section {
        padding: 20px;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .key-fields {
        grid-template-columns: 1fr;
    }
}
