:root {
    --primary: #0a0e17;
    --secondary: #131a2a;
    --accent: #00d4ff;
    --accent-secondary: #7b61ff;
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --success: #48bb78;
    --warning: #ed8936;
    --danger: #f56565;
    --border: #2d3748;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--primary);
    color: var(--text-primary);
    overflow-x: hidden;
}

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

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-image {
    height: 72px;
    width: 72px;
    border-radius: 8px;
}
.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(to right, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    padding: 8px 12px;
    border-radius: 6px;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--accent);
    background: rgba(0, 212, 255, 0.1);
}
/* ============================================
   User Authentication & Logout Styles
   ============================================ */

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-wallet {
    color: var(--accent);
    font-family: monospace;
    font-size: 14px;
    background: rgba(0, 212, 255, 0.1);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.logout-btn {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: var(--danger);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.3);
}

.logout-btn:active {
    transform: translateY(0);
}

/* Back to home link */
.back-home {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}

.back-home:hover {
    color: var(--accent);
}

}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-weight: 600;
}

/* KPI Cards */
.kpi-section {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin: 30px 0;
}

@media (max-width: 1400px) {
    .kpi-section {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .kpi-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

.kpi-card {
    background: var(--secondary);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.kpi-card:hover::before {
    transform: scaleX(1);
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.kpi-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    font-variant-numeric: tabular-nums;
}

.kpi-sparkline {
    height: 40px;
    margin-top: 10px;
}

/* Chart Containers */
.chart-container {
    background: var(--secondary);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
    margin-bottom: 30px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
}

.chart-actions {
    display: flex;
    gap: 10px;
}

.btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

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

.btn-primary:hover {
    background: #00b8e6;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto auto;
    gap: 20px;
    margin-bottom: 40px;
}

@media (max-width: 1400px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Tables */
.table-container {
    background: var(--secondary);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
    margin-bottom: 30px;
}

.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.table-info {
    color: var(--text-secondary);
    font-size: 14px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-info {
    color: var(--text-secondary);
    font-size: 14px;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 11px;
}

.response-snippet {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sortable table headers */
#event-log-table th[data-sort] {
    cursor: pointer;
    user-select: none;
    transition: color 0.3s;
}

#event-log-table th[data-sort]:hover {
    color: var(--accent);
}

/* Active time buttons */
.time-btn.active,
.risk-time-btn.active {
    background: var(--accent);
    color: var(--primary);
    border-color: var(--accent);
}

/* Risk badges */
.risk-high {
    background: rgba(245, 101, 101, 0.2);
    color: var(--danger);
}

.risk-medium {
    background: rgba(237, 137, 54, 0.2);
    color: var(--warning);
}

.risk-low {
    background: rgba(72, 187, 120, 0.2);
    color: var(--success);
}

/* Input group for API key */
.input-group {
    display: flex;
    align-items: center;
}

.input-group .form-input {
    flex: 1;
}

/* Status indicators */
.status-ok {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-warning {
    background: var(--warning);
    box-shadow: 0 0 8px var(--warning);
}

.status-error {
    background: var(--danger);
    box-shadow: 0 0 8px var(--danger);
}

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

th {
    text-align: left;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.risk-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.risk-high {
    background: rgba(245, 101, 101, 0.2);
    color: var(--danger);
}

.risk-medium {
    background: rgba(237, 137, 54, 0.2);
    color: var(--warning);
}

.risk-low {
    background: rgba(72, 187, 120, 0.2);
    color: var(--success);
}

/* Filters */
.filter-section {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-select {
    background: var(--primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
}

/* System Health */
.system-health {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

@media (max-width: 768px) {
    .system-health {
        grid-template-columns: 1fr;
    }
}

.health-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-ok {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-warning {
    background: var(--warning);
    box-shadow: 0 0 8px var(--warning);
}

.status-error {
    background: var(--danger);
    box-shadow: 0 0 8px var(--danger);
}

.health-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.health-value {
    font-size: 14px;
    font-weight: 600;
    margin-left: auto;
}

/* Background Pattern */
.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.03;
    background-image: 
        radial-gradient(circle at 25% 25%, var(--accent) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, var(--accent-secondary) 2px, transparent 2px);
    background-size: 50px 50px;
}

/* Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 1400px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .metric-grid {
        grid-template-columns: 1fr;
    }
}

.metric-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    margin: 10px 0 5px;
}

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

/* Alerts Section */
.alert-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 15px;
}

.alert-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.alert-critical {
    background: rgba(245, 101, 101, 0.2);
    color: var(--danger);
}

.alert-warning {
    background: rgba(237, 137, 54, 0.2);
    color: var(--warning);
}

.alert-info {
    background: rgba(0, 212, 255, 0.2);
    color: var(--accent);
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.alert-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

.alert-time {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Reports Grid */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}
/* Modal Styles */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    background-color: var(--secondary);
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.close {
    color: var(--text-secondary);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid var(--border);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--primary);
    border-radius: 4px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Notifications */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .modal-body {
        padding: 20px;
    }
}

@media (max-width: 1400px) {
    .reports-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .reports-grid {
        grid-template-columns: 1fr;
    }
}

.report-card {
    background: var(--secondary);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.report-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.report-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: rgba(0, 212, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    color: var(--accent);
    font-size: 20px;
}

.report-title {
    font-weight: 600;
    margin-bottom: 10px;
}

.report-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

/* Settings Section */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 1400px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

.settings-card {
    background: var(--secondary);
    border-radius: 12px;
    padding: 25px;
    border: 1px solid var(--border);
}

.settings-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    background: var(--primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
}

.form-select {
    width: 100%;
    background: var(--primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    background: var(--primary);
    border-radius: 3px;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

.slider-value {
    min-width: 40px;
    text-align: right;
    font-weight: 600;
}
/* Full Width Event Log */
.event-log {
    grid-column: 1 / -1 !important;
    margin: 30px 0 0 0;
    width: 100%;
}

.event-log .chart-container {
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
}

.event-log .table-container {
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 20px;
}

/* Adjust table for full width */
.event-log table {
    width: 100%;
}

.event-log th:nth-child(5),
.event-log td:nth-child(5) {
    max-width: 400px;
}

.response-snippet {
    max-width: 380px !important;
}
