<!DOCTYPE html>
<?php
$cacheFile = __DIR__ . '/last_collector_run.txt';
$updateInterval = 1800; // каждые 30 минут

if (!file_exists($cacheFile) || (time() - filemtime($cacheFile)) > $updateInterval) {
    // Безопасный вызов collector.php
    $url = 'https://avatiah.com/collector.php?key=MYSECRETKEY';
    @file_get_contents($url);
    file_put_contents($cacheFile, date('Y-m-d H:i:s'));
}

// Получаем реальные данные
$apiData = [];
try {
    $apiUrl = 'https://avatiah.com/api/latest.php';
    $apiResponse = @file_get_contents($apiUrl);
    if ($apiResponse) {
        $apiData = json_decode($apiResponse, true);
    }
} catch (Exception $e) {
    // В случае ошибки используем fallback данные
    $apiData = [
        'security_index' => 4.2,
        'aal_level' => 4,
        'timestamp' => date('c'),
        'components' => [
            'pizza' => ['raw' => 2.8, 'score' => 4.5],
            'oil' => ['raw' => 85, 'score' => 3.8],
            'media' => ['raw' => 1200, 'score' => 5.2],
            'navy' => ['raw' => 2, 'score' => 4.0],
            'vip' => ['raw' => 3, 'score' => 2.5],
            'gov' => ['raw' => 2, 'score' => 3.0],
            'gold' => ['raw' => 45, 'score' => 2.8],
            'cyber' => ['raw' => 2, 'score' => 3.5],
            'energy' => ['raw' => 75, 'score' => 3.2],
            'social' => ['raw' => 3, 'score' => 4.1]
        ],
        'time_to_aa3' => 8.5,
        'signal_detection_time' => 28,
        'data_quality' => 'good',
        'data_age_minutes' => 15
    ];
}
?>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Avatiah Security Index: Israel</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.9.1/chart.min.js"></script>
    <style>
        /* СТИЛИ ОСТАЮТСЯ ТАКИМИ ЖЕ КАК В ПРЕДЫДУЩЕЙ ВЕРСИИ */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }
        body {
            background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
            min-height: 100vh;
            padding: 1rem;
        }
        .container {
            max-width: 1600px;
            margin: 0 auto;
        }
        .header {
            text-align: center;
            color: white;
            margin-bottom: 2rem;
            background: rgba(0,0,0,0.3);
            padding: 2rem;
            border-radius: 15px;
            backdrop-filter: blur(10px);
            position: relative;
        }
        .language-switcher {
            position: absolute;
            top: 1rem;
            right: 1rem;
            display: flex;
            gap: 0.5rem;
        }
        .lang-btn {
            background: rgba(255,255,255,0.2);
            border: 1px solid rgba(255,255,255,0.3);
            color: white;
            padding: 0.3rem 0.8rem;
            border-radius: 5px;
            cursor: pointer;
            font-size: 0.9rem;
            transition: all 0.3s ease;
        }
        .lang-btn:hover {
            background: rgba(255,255,255,0.3);
        }
        .lang-btn.active {
            background: rgba(52, 152, 219, 0.5);
            border-color: #3498db;
        }
        .header h1 {
            font-size: 2.8rem;
            margin-bottom: 0.5rem;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
        }
        .header .subtitle {
            font-size: 1.2rem;
            opacity: 0.9;
        }
        .focus-region {
            background: rgba(231, 76, 60, 0.2);
            border: 2px solid #e74c3c;
            padding: 1rem;
            border-radius: 10px;
            margin-top: 1rem;
            display: inline-block;
        }
        .key-metrics {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }
        .metric-card {
            background: white;
            border-radius: 15px;
            padding: 1.5rem;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
            text-align: center;
        }
        .metric-card.critical {
            border-top: 6px solid #e74c3c;
        }
        .metric-card.warning {
            border-top: 6px solid #f39c12;
        }
        .metric-card.info {
            border-top: 6px solid #3498db;
        }
        .metric-value {
            font-size: 3rem;
            font-weight: bold;
            margin: 1rem 0;
        }
        .metric-card.critical .metric-value {
            color: #e74c3c;
        }
        .metric-card.warning .metric-value {
            color: #f39c12;
        }
        .metric-card.info .metric-value {
            color: #3498db;
        }
        .metric-label {
            font-size: 1.2rem;
            color: #2c3e50;
            margin-bottom: 0.5rem;
        }
        .metric-description {
            color: #7f8c8d;
            font-size: 0.9rem;
        }
        .index-visualization {
            background: white;
            border-radius: 15px;
            padding: 2rem;
            margin-bottom: 2rem;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
        }
        .viz-title {
            font-size: 2rem;
            color: #2c3e50;
            margin-bottom: 1.5rem;
            text-align: center;
        }
        .current-index-display {
            text-align: center;
            padding: 2rem;
            background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
            border-radius: 15px;
            margin-bottom: 2rem;
            color: white;
            box-shadow: 0 5px 15px rgba(243, 156, 18, 0.4);
        }
        .index-value-big {
            font-size: 5rem;
            font-weight: bold;
            margin: 1rem 0;
        }
        .index-label-big {
            font-size: 1.5rem;
            margin-bottom: 0.5rem;
        }
        .index-status {
            font-size: 1.8rem;
            font-weight: bold;
            background: rgba(0,0,0,0.2);
            padding: 1rem;
            border-radius: 10px;
            margin-top: 1rem;
        }
        .index-scale {
            display: flex;
            height: 40px;
            border-radius: 20px;
            overflow: hidden;
            margin: 2rem 0;
            box-shadow: 0 3px 10px rgba(0,0,0,0.2);
        }
        .scale-segment {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            font-size: 0.9rem;
            position: relative;
        }
        .scale-segment.aal-5 { background: #27ae60; }
        .scale-segment.aal-4 { background: #f39c12; }
        .scale-segment.aal-3 { background: #e67e22; }
        .scale-segment.aal-2 { background: #e74c3c; }
        .scale-segment.aal-1 { background: #8e44ad; }
        .current-marker {
            position: absolute;
            bottom: -30px;
            left: 60%;
            transform: translateX(-50%);
            font-size: 2rem;
            animation: bounce 2s infinite;
        }
        @keyframes bounce {
            0%, 100% { transform: translateX(-50%) translateY(0); }
            50% { transform: translateX(-50%) translateY(-10px); }
        }
        .components-section {
            background: white;
            border-radius: 15px;
            padding: 2rem;
            margin-bottom: 2rem;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
        }
        .component-title {
            font-size: 2rem;
            color: #2c3e50;
            margin-bottom: 1.5rem;
        }
        .components-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
            gap: 1.5rem;
        }
        .component-card {
            background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
            border-radius: 12px;
            padding: 1.5rem;
            border-left: 6px solid;
            transition: all 0.3s ease;
            cursor: pointer;
        }
        .component-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 20px rgba(0,0,0,0.15);
        }
        .component-card.weight-critical {
            border-left-color: #c0392b;
        }
        .component-card.weight-high {
            border-left-color: #e74c3c;
        }
        .component-card.weight-medium {
            border-left-color: #f39c12;
        }
        .component-card.weight-low {
            border-left-color: #3498db;
        }
        .component-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }
        .component-name {
            font-size: 1.3rem;
            font-weight: bold;
            color: #2c3e50;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .component-icon {
            font-size: 1.8rem;
        }
        .component-weight {
            background: #3498db;
            color: white;
            padding: 0.4rem 1rem;
            border-radius: 20px;
            font-weight: bold;
            font-size: 1.1rem;
        }
        .weight-critical .component-weight { background: #c0392b; }
        .weight-high .component-weight { background: #e74c3c; }
        .weight-medium .component-weight { background: #f39c12; }
        .weight-low .component-weight { background: #3498db; }
        .simple-explanation {
            background: rgba(52, 152, 219, 0.1);
            padding: 1rem;
            border-radius: 8px;
            margin-bottom: 1rem;
            border-left: 3px solid #3498db;
        }
        .simple-explanation-title {
            font-weight: bold;
            color: #2980b9;
            margin-bottom: 0.5rem;
            font-size: 0.95rem;
        }
        .simple-explanation-text {
            font-size: 0.95rem;
            line-height: 1.5;
            color: #34495e;
        }
        .component-region {
            background: rgba(52, 152, 219, 0.05);
            padding: 0.5rem;
            border-radius: 5px;
            font-size: 0.9rem;
            color: #2c3e50;
            margin-bottom: 1rem;
        }
        .component-current {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: white;
            padding: 1rem;
            border-radius: 8px;
            margin: 1rem 0;
        }
        .current-value {
            font-size: 1.8rem;
            font-weight: bold;
            color: #e74c3c;
        }
        .current-trend {
            display: flex;
            align-items: center;
            gap: 0.3rem;
            font-size: 1rem;
            color: #e74c3c;
        }
        .component-impact {
            background: rgba(231, 76, 60, 0.1);
            border-left: 3px solid #e74c3c;
            padding: 1rem;
            border-radius: 5px;
            margin-top: 1rem;
        }
        .impact-title {
            font-weight: bold;
            color: #c0392b;
            margin-bottom: 0.5rem;
        }
        .component-sources {
            font-size: 0.85rem;
            color: #7f8c8d;
            margin-top: 1rem;
            font-style: italic;
        }
        .explanation-box {
            background: rgba(52, 152, 219, 0.2);
            border-left: 4px solid #3498db;
            padding: 1.5rem;
            border-radius: 8px;
            margin-top: 2rem;
        }
        .explanation-title {
            font-weight: bold;
            font-size: 1.2rem;
            margin-bottom: 1rem;
            color: #3498db;
        }
        .methodology-section {
            background: #2c3e50;
            color: white;
            border-radius: 15px;
            padding: 2rem;
            margin-bottom: 2rem;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
            display: none;
        }
        .methodology-title {
            font-size: 2rem;
            margin-bottom: 1.5rem;
            text-align: center;
        }
        .methodology-content {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 1.5rem;
        }
        .methodology-card {
            background: rgba(255,255,255,0.1);
            padding: 1.5rem;
            border-radius: 10px;
        }
        .methodology-card h3 {
            color: #3498db;
            margin-bottom: 1rem;
            font-size: 1.3rem;
        }
        .methodology-card ul {
            margin-left: 1.5rem;
            line-height: 1.6;
        }
        .methodology-card li {
            margin: 0.5rem 0;
        }
        .correlation-section {
            background: white;
            border-radius: 15px;
            padding: 2rem;
            margin-bottom: 2rem;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
        }
        .chart-container {
            position: relative;
            height: 400px;
            margin: 2rem 0;
        }
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }
        .stat-card {
            background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
            padding: 1.5rem;
            border-radius: 10px;
            text-align: center;
            color: white;
        }
        .stat-card.critical {
            background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
        }
        .stat-card.warning {
            background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
        }
        .stat-card.success {
            background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
        }
        .stat-value {
            font-size: 2.5rem;
            font-weight: bold;
            margin-bottom: 0.5rem;
        }
        .stat-label {
            font-size: 0.9rem;
        }
        .timeline-event {
            background: linear-gradient(135deg, #ffe5e5 0%, #ffc9c9 100%);
            padding: 1.5rem;
            border-radius: 10px;
            margin-bottom: 1.5rem;
            border-left: 5px solid #e67e22;
        }
        .timeline-event.moderate {
            background: linear-gradient(135deg, #fff8e5 0%, #ffe9c9 100%);
            border-left-color: #f39c12;
        }
        .timeline-event.low {
            background: linear-gradient(135deg, #ecf0f1 0%, #bdc3c7 100%);
            border-left-color: #27ae60;
        }
        .event-date {
            font-weight: bold;
            color: #e67e22;
            margin-bottom: 0.5rem;
        }
        .event-date.moderate {
            color: #f39c12;
        }
        .event-date.low {
            color: #27ae60;
        }
        .event-badge {
            background: #e74c3c;
            color: white;
            padding: 0.2rem 0.5rem;
            border-radius: 10px;
            font-size: 0.8rem;
            margin-right: 0.5rem;
        }
        .event-badge.moderate {
            background: #f39c12;
        }
        .event-badge.low {
            background: #27ae60;
        }
        .new-factors-section {
            background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%);
            color: white;
            border-radius: 15px;
            padding: 2rem;
            margin-bottom: 2rem;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
        }
        .new-factors-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
            gap: 1.5rem;
            margin-top: 1.5rem;
        }
        .new-factor-card {
            background: rgba(255,255,255,0.1);
            backdrop-filter: blur(10px);
            border-radius: 12px;
            padding: 1.5rem;
            border: 2px solid rgba(255,255,255,0.2);
            transition: all 0.3s ease;
        }
        .new-factor-card:hover {
            transform: translateY(-5px);
            background: rgba(255,255,255,0.15);
            border-color: rgba(255,255,255,0.4);
        }
        .new-factor-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }
        .new-factor-title {
            font-size: 1.4rem;
            font-weight: bold;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .new-badge {
            background: #e74c3c;
            padding: 0.3rem 0.8rem;
            border-radius: 15px;
            font-size: 0.75rem;
            font-weight: bold;
        }
        .new-factor-weight {
            background: rgba(255,255,255,0.2);
            padding: 0.4rem 1rem;
            border-radius: 20px;
            font-weight: bold;
        }
        .new-factor-description {
            line-height: 1.6;
            margin-bottom: 1rem;
        }
        .new-factor-details {
            background: rgba(0,0,0,0.2);
            padding: 1rem;
            border-radius: 8px;
            font-size: 0.9rem;
            line-height: 1.5;
        }
        .new-factor-details ul {
            margin-left: 1.5rem;
            margin-top: 0.5rem;
        }
        .new-factor-details li {
            margin: 0.3rem 0;
        }
        .change-indicator {
            display: inline-block;
            margin-left: 5px;
            font-size: 0.8em;
        }
        .change-positive {
            color: #e74c3c;
        }
        .change-negative {
            color: #27ae60;
        }
        .change-neutral {
            color: #7f8c8d;
        }
        .data-update-info {
            text-align: center;
            font-size: 0.9rem;
            color: #7f8c8d;
            margin-top: 1rem;
        }
        .enhanced-factors-toggle {
            background: rgba(255,255,255,0.2);
            border: 2px solid rgba(255,255,255,0.3);
            color: white;
            padding: 0.8rem 1.5rem;
            border-radius: 10px;
            font-size: 1rem;
            cursor: pointer;
            margin: 1rem auto;
            display: block;
            transition: all 0.3s ease;
        }
        .enhanced-factors-toggle:hover {
            background: rgba(255,255,255,0.3);
        }
        .enhanced-factors-toggle.active {
            background: rgba(231, 76, 60, 0.5);
            border-color: #e74c3c;
        }
        .dynamic-explanation {
            background: rgba(52, 152, 219, 0.15);
            border-left: 4px solid #3498db;
            padding: 1.5rem;
            border-radius: 8px;
            margin-top: 1.5rem;
        }
        .dynamic-explanation-title {
            font-weight: bold;
            font-size: 1.2rem;
            margin-bottom: 1rem;
            color: #3498db;
        }
        .dynamic-risk-indicator {
            display: inline-block;
            padding: 0.5rem 1rem;
            border-radius: 20px;
            font-weight: bold;
            margin: 0.5rem 0;
        }
        .risk-low { background: #27ae60; color: white; }
        .risk-medium { background: #f39c12; color: white; }
        .risk-high { background: #e74c3c; color: white; }
        .risk-critical { background: #8e44ad; color: white; }
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.7; }
        }
        .live-indicator {
            display: inline-block;
            width: 12px;
            height: 12px;
            background: #27ae60;
            border-radius: 50%;
            margin-right: 0.5rem;
            animation: pulse 2s infinite;
        }
        .quality-indicator {
            display: inline-block;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            margin-left: 5px;
        }
        .quality-high { background: #27ae60; }
        .quality-medium { background: #f39c12; }
        .quality-low { background: #e74c3c; }
        .data-source-info {
            font-size: 0.8rem;
            color: #7f8c8d;
            margin-top: 0.5rem;
        }
        .disclaimer-section {
            background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
            color: white;
            border-radius: 15px;
            padding: 2rem;
            margin-bottom: 2rem;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
            border: 2px solid #e74c3c;
        }
        .disclaimer-header {
            text-align: center;
            margin-bottom: 2rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 1rem;
        }
        .disclaimer-header h2 {
            font-size: 2rem;
            margin: 0;
        }
        .disclaimer-icon {
            font-size: 2.5rem;
            animation: pulse 2s infinite;
        }
        .disclaimer-content {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }
        .disclaimer-card {
            background: rgba(255,255,255,0.1);
            padding: 1.5rem;
            border-radius: 10px;
            border-left: 4px solid;
            backdrop-filter: blur(10px);
        }
        .disclaimer-card.critical { border-left-color: #e74c3c; }
        .disclaimer-card.warning { border-left-color: #f39c12; }
        .disclaimer-card.info { border-left-color: #3498db; }
        .disclaimer-card.success { border-left-color: #27ae60; }
        .disclaimer-card h3 {
            margin-bottom: 1rem;
            font-size: 1.2rem;
            color: #ecf0f1;
        }
        .disclaimer-card ul {
            margin-left: 1.5rem;
            line-height: 1.6;
        }
        .disclaimer-card li {
            margin: 0.5rem 0;
        }
        .disclaimer-footer {
            background: rgba(0,0,0,0.3);
            padding: 1.5rem;
            border-radius: 10px;
            text-align: center;
            border-top: 2px solid #e74c3c;
        }
        .disclaimer-footer p {
            margin: 0.5rem 0;
            font-size: 0.9rem;
            line-height: 1.5;
        }
        .copyright-section {
            background: linear-gradient(135deg, #1a2530 0%, #2c3e50 100%);
            color: #bdc3c7;
            border-radius: 15px;
            padding: 2rem;
            margin-bottom: 1rem;
            box-shadow: 0 5px 15px rgba(0,0,0,0.3);
            border-top: 3px solid #3498db;
        }
        .copyright-content {
            max-width: 1200px;
            margin: 0 auto;
        }
        .copyright-info {
            display: flex;
            align-items: center;
            gap: 1rem;
            margin-bottom: 2rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid #34495e;
        }
        .copyright-icon {
            font-size: 2.5rem;
            color: #3498db;
            background: rgba(52, 152, 219, 0.1);
            padding: 0.5rem;
            border-radius: 8px;
            min-width: 60px;
            text-align: center;
        }
        .copyright-text {
            flex: 1;
        }
        .copyright-text p {
            margin: 0.3rem 0;
            line-height: 1.4;
        }
        .copyright-text p:first-child {
            color: #ecf0f1;
            font-size: 1.1rem;
        }
        .copyright-legal {
            background: rgba(0,0,0,0.3);
            padding: 1.5rem;
            border-radius: 8px;
            text-align: center;
            border: 1px solid #34495e;
        }
        .copyright-legal p {
            margin: 0.5rem 0;
            font-size: 0.85rem;
            line-height: 1.4;
            color: #95a5a6;
        }

        /* --- Модальные окна --- */
        .modal-overlay {
            position: fixed;
            top: 0; left: 0;
            width: 100%; height: 100%;
            background: rgba(0,0,0,0.7);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.3s, visibility 0.3s;
        }
        .modal-overlay.active {
            opacity: 1;
            visibility: visible;
        }
        .modal-content {
            background: white;
            border-radius: 15px;
            max-width: 90%;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 10px 50px rgba(0,0,0,0.5);
            position: relative;
            padding: 2rem;
        }
        .modal-close {
            position: absolute;
            top: 1rem; right: 1rem;
            font-size: 1.5rem;
            cursor: pointer;
            color: #7f8c8d;
            background: none;
            border: none;
        }
        .modal-title {
            font-size: 1.8rem;
            margin-bottom: 1.5rem;
            color: #2c3e50;
        }
        .modal-chart {
            height: 250px;
            margin: 1.5rem 0;
        }
        .knowledge-content {
            line-height: 1.6;
            color: #34495e;
        }
        .knowledge-content h3 {
            margin: 1.5rem 0 1rem;
            color: #2980b9;
        }

        @media (max-width: 768px) {
            .header h1 { font-size: 2rem; }
            .index-value-big { font-size: 3.5rem; }
            .components-grid {
                display: flex;
                flex-wrap: nowrap;
                overflow-x: auto;
                scroll-snap-type: x mandatory;
                gap: 1rem;
                padding-bottom: 1rem;
            }
            .component-card {
                scroll-snap-align: start;
                min-width: 85%;
            }
            .component-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
            .component-current { flex-direction: column; gap: 0.5rem; text-align: center; }
            .stats-grid { grid-template-columns: repeat(2, 1fr); }
            .key-metrics { grid-template-columns: 1fr; }
            .methodology-content { grid-template-columns: 1fr; }
            .disclaimer-content { grid-template-columns: 1fr; }
            .disclaimer-header { flex-direction: column; text-align: center; }
            .copyright-info { flex-direction: column; text-align: center; }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="language-switcher">
                <button class="lang-btn active" data-lang="en">EN</button>
                <button class="lang-btn" data-lang="he">HE</button>
                <button class="lang-btn" data-lang="ru">RU</button>
            </div>
            <h1 data-i18n="title">🎯 Avatiah Security Index: Israel</h1>
            <p class="subtitle" data-i18n="subtitle">Comprehensive real-time analysis of the geopolitical situation</p>
            <div class="focus-region">
                <strong data-i18n="focus_region">🔴 Focus region:</strong> <span data-i18n="focus_region_text">Israel and its security threats</span>
            </div>
        </div>
        
        <div class="key-metrics">
            <div class="metric-card critical">
                <div class="metric-label" data-i18n="current_security_index">Current Security Index</div>
                <div class="metric-value" id="current-index">-- / 10</div>
                <div class="metric-description" id="aal-status" data-i18n="loading">Loading...</div>
            </div>
            <div class="metric-card warning">
                <div class="metric-label" data-i18n="avg_time_to_aa3">Average Time to AAL 3</div>
                <div class="metric-value" id="time-to-aa3">-- days</div>
                <div class="metric-description" data-i18n="at_current_trend">At current index trend</div>
            </div>
            <div class="metric-card info">
                <div class="metric-label" data-i18n="signal_detection_time">Signal Detection Time</div>
                <div class="metric-value" id="signal-detection">-- hours</div>
                <div class="metric-description" data-i18n="detection_to_aal">Average time between detection and official AAL increase</div>
            </div>
        </div>
        
        <div class="index-visualization">
            <h2 class="viz-title" data-i18n="current_security_index_viz">📊 Current Security Index</h2>
            <div class="current-index-display">
                <div class="index-label-big"><span class="live-indicator"></span><span id="header-time" data-i18n="loading">Loading...</span> (Israel)</div>
                <div class="index-value-big" id="main-index-value">-- / 10</div>
                <div class="index-status" id="index-status" data-i18n="loading">Loading...</div>
            </div>
            <div style="position: relative;">
                <div class="index-scale">
                    <div class="scale-segment aal-5" data-i18n="aal_5">0-2<br>NORMAL</div>
                    <div class="scale-segment aal-4" data-i18n="aal_4">2-3.5<br>ELEVATED</div>
                    <div class="scale-segment aal-3" data-i18n="aal_3">3.5-5<br>HIGH</div>
                    <div class="scale-segment aal-2" data-i18n="aal_2">5-7<br>CRITICAL</div>
                    <div class="scale-segment aal-1" data-i18n="aal_1">7-10<br>MAXIMUM</div>
                </div>
                <div class="current-marker" id="current-marker">👇</div>
            </div>
            <div class="explanation-box">
                <div class="explanation-title" data-i18n="how_to_understand">💡 How to understand the index?</div>
                <p><strong data-i18n="security_index">Security Index</strong> <span data-i18n="security_index_desc">— is a numerical value from 0 to 10 that shows the level of geopolitical tension around Israel.</span></p>
                <