/* AI Governance Framework Styles */

:root {
    --primary-color: #2563eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 2rem;
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 400;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.help-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group.half {
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

textarea,
select,
input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

textarea {
    resize: vertical;
    font-family: 'Monaco', 'Courier New', monospace;
}

textarea:focus,
select:focus,
input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--text-secondary);
    color: white;
    margin-bottom: 1rem;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-upload {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    width: auto;
}

.btn-link {
    background: transparent;
    color: var(--danger-color);
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    text-decoration: none;
    border: none;
}

.btn-link:hover {
    color: #dc2626;
    text-decoration: underline;
    background: transparent;
    transform: none;
    box-shadow: none;
}

.btn-clear {
    margin-left: 0.5rem;
}

/* File Upload Section */
.file-upload-section {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.file-upload-label {
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
}

.file-name {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.9rem;
    flex: 1;
}

.document-info {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    border-left: 3px solid var(--success-color);
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* Azure DevOps URL Section */
.ado-url-section {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.05);
    border: 2px dashed rgba(59, 130, 246, 0.3);
    border-radius: 8px;
}

.ado-url-label {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: block;
}

.ado-url-input,
.ado-token-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-family: 'Courier New', monospace;
}

.ado-url-input:focus,
.ado-token-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Loading */
.loading-indicator {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Status Banner */
.status-banner {
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid;
}

.status-banner.blocked {
    background: #fee2e2;
    border-left-color: var(--danger-color);
}

.status-banner.allowed {
    background: #d1fae5;
    border-left-color: var(--success-color);
}

.status-banner.warning {
    background: #fef3c7;
    border-left-color: var(--warning-color);
}

.status-banner.error {
    background: #fee2e2;
    border-left-color: var(--danger-color);
}

.status-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-icon {
    font-size: 2rem;
}

#statusTitle {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

#statusMessage {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Domain mismatch warning (e.g. WAM query on RAI-only server) */
.domain-mismatch-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    border-left: 4px solid var(--warning-color);
}

.domain-mismatch-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.domain-mismatch-banner p {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.info-card {
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.info-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge.cache { background: #dbeafe; color: #1e40af; }
.badge.embeddings { background: #fef3c7; color: #92400e; }
.badge.llm { background: #fce7f3; color: #9f1239; }
.badge.override { background: #f3e8ff; color: #6b21a8; }

.badge.critical { background: #fee2e2; color: #991b1b; }
.badge.high { background: #fed7aa; color: #9a3412; }
.badge.medium { background: #fef3c7; color: #92400e; }
.badge.low { background: #d1fae5; color: #065f46; }

/* Lists */
.violations-container,
.recommendations-container {
    margin-bottom: 2rem;
}

.violations-container h3,
.recommendations-container h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.violations-list,
.recommendations-list {
    list-style: none;
    padding: 0;
}

.violations-list li {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #fee2e2;
    border-left: 3px solid var(--danger-color);
    border-radius: 4px;
}

.recommendations-list li {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #dbeafe;
    border-left: 3px solid var(--info-color);
    border-radius: 4px;
}

/* Details */
.details-container {
    margin-bottom: 2rem;
}

.details-content {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
}

/* Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.metric {
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.metric-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Examples */
.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.example-card {
    padding: 1rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.example-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.example-card h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.example-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Stats */
.stats-content {
    margin-top: 1rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: white;
    opacity: 0.9;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 1.75rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 1.5rem;
    }
}
