/* Live Demo Section */
#demo {
    padding: 6rem 0;
    position: relative;
    z-index: 2;
}

.demo-box {
    padding: 2rem;
    background: rgba(17, 25, 40, 0.75);
}

.demo-controls {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1.5rem;
    align-items: end;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 0.6rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
}

.demo-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.result-pane h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.image-placeholder {
    width: 100%;
    height: 300px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

#json-output {
    width: 100%;
    height: 300px;
    background: #0d1117;
    padding: 1rem;
    border-radius: 8px;
    overflow: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #00ff9d;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.status-badge.hidden {
    display: none;
}

.status-badge.running {
    background: rgba(0, 195, 255, 0.2);
    color: #00c3ff;
    animation: pulse 1.5s infinite;
}

.status-badge.success {
    background: rgba(0, 255, 157, 0.2);
    color: #00ff9d;
}

.status-badge.error {
    background: rgba(255, 0, 85, 0.2);
    color: #ff0055;
}

.demo-results {
    grid-template-columns: 1fr;
}
}

/* Structured Result Styles */
.structured-result {
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease-out;
}

.structured-result.hidden {
    display: none;
}

.result-card {
    background: rgba(13, 17, 23, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #00c3ff, #a855f7);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.result-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.doc-type-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    text-transform: uppercase;
}

.validity-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.validity-badge.valid {
    background: rgba(0, 255, 157, 0.15);
    color: #00ff9d;
}

.validity-badge.expired {
    background: rgba(255, 0, 85, 0.15);
    color: #ff0055;
}

.result-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .result-body {
        grid-template-columns: 200px 1fr;
    }
}

.face-image {
    width: 100%;
    aspect-ratio: 3/4;
    background: #000;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.field-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem;
    border-radius: 6px;
}

.field-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.field-value {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
}

.mrz-block {
    margin-top: 1.5rem;
    background: #000;
    padding: 1rem;
    border-radius: 6px;
    font-family: 'OCR-B', 'Courier New', monospace;
    letter-spacing: 2px;
    line-height: 1.5;
    color: var(--text-primary);
    overflow-x: auto;
    white-space: pre;
}

.antifraud-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.antifraud-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.check-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.check-chip.passed {
    border-color: rgba(0, 255, 157, 0.3);
    color: #00ff9d;
}

.check-chip.failed {
    border-color: rgba(255, 0, 85, 0.3);
    color: #ff0055;
}

.toggle-raw-btn {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
}

.toggle-raw-btn:hover {
    color: var(--primary-color);
}