/* Risk & Compliance Analytics Dashboard - Main Styles */
/* TBE Consulting | Data Visuals */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-bg: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
    color: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.header-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

.branding {
    font-size: 0.85rem;
    opacity: 0.8;
    font-weight: 500;
}

/* Navigation */
.nav {
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 0;
}

.nav-link {
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-link:hover {
    background-color: var(--light-bg);
    border-bottom-color: var(--secondary-color);
}

.nav-link.active {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
    background-color: rgba(52, 152, 219, 0.05);
}

/* Main Container */
.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Alert Banner */
.alert-banner {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 1rem 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.alert-icon {
    font-size: 1.5rem;
}

.alert-text {
    flex: 1;
}

.alert-count {
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
}

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

.metric-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.metric-status {
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    display: inline-block;
    font-weight: 600;
}

.metric-status.excellent { background: #d5f4e6; color: #27ae60; }
.metric-status.good { background: #d4e9f7; color: #3498db; }
.metric-status.warning { background: #fef3d4; color: #f39c12; }
.metric-status.critical { background: #fadbd8; color: #e74c3c; }

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.chart-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-bg);
}

.chart-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.chart-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.chart-container {
    position: relative;
    height: 300px;
}

/* Alerts Table */
.alerts-section {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-bg);
}

.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn:hover {
    background: var(--light-bg);
}

.filter-btn.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.alerts-table {
    width: 100%;
    border-collapse: collapse;
}

.alerts-table th {
    text-align: left;
    padding: 0.75rem;
    background: var(--light-bg);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.alerts-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.alerts-table tr:last-child td {
    border-bottom: none;
}

.alerts-table tr:hover {
    background: rgba(52, 152, 219, 0.05);
}

.severity-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.severity-high { background: #fadbd8; color: #e74c3c; }
.severity-medium { background: #fef3d4; color: #f39c12; }
.severity-low { background: #d4e9f7; color: #3498db; }

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-under_review { background: #fef3d4; color: #f39c12; }
.status-monitoring { background: #d4e9f7; color: #3498db; }
.status-action_required { background: #fadbd8; color: #e74c3c; }
.status-resolved { background: #d5f4e6; color: #27ae60; }

/* Executive Summary Styles */
.summary-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
    color: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.summary-date {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

.summary-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.summary-section {
    margin-bottom: 2rem;
}

.summary-section:last-child {
    margin-bottom: 0;
}

.summary-section h2 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-bg);
}

.summary-section h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin: 1.5rem 0 0.75rem 0;
}

.summary-section p {
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.summary-section ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.summary-section li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.key-findings {
    background: #e8f4f8;
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid var(--secondary-color);
    margin: 1rem 0;
}

.recommendations {
    background: #fff9e6;
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid var(--warning-color);
    margin: 1rem 0;
}

.critical-alert {
    background: #fee;
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid var(--danger-color);
    margin: 1rem 0;
}

/* AI Agent Styles */
.chat-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
    height: calc(100vh - 250px);
}

.chat-sidebar {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.suggested-questions {
    margin-top: 1.5rem;
}

.suggested-questions h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.question-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.question-btn:hover {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.chat-main {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.chat-message {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--secondary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.message-avatar.user {
    background: var(--primary-color);
}

.message-content {
    flex: 1;
    background: var(--light-bg);
    padding: 1rem;
    border-radius: 8px;
    line-height: 1.6;
}

.message-content.user {
    background: #e3f2fd;
}

.chat-input-container {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.chat-input-wrapper {
    display: flex;
    gap: 0.75rem;
}

.chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.send-btn {
    padding: 0.75rem 2rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.send-btn:hover {
    background: #2980b9;
}

/* Documentation Styles */
.doc-content {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    max-width: 900px;
    margin: 0 auto;
}

.doc-content h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.doc-content h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-bg);
}

.doc-content h3 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.doc-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.doc-content ul, .doc-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.doc-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.doc-content code {
    background: var(--light-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.doc-content pre {
    background: var(--light-bg);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.toc {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 6px;
    margin-bottom: 2rem;
}

.toc h3 {
    margin-top: 0;
}

.toc ul {
    margin-left: 1.5rem;
}

.toc a {
    color: var(--secondary-color);
    text-decoration: none;
}

.toc a:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--primary-color);
}

.btn-secondary:hover {
    background: #1a252f;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .chat-container {
        grid-template-columns: 1fr;
    }
    
    .chat-sidebar {
        display: none;
    }
    
    .nav-content {
        flex-wrap: wrap;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}
