<?php
$settingsFile = __DIR__ . '/data/settings.json';
$settings = file_exists($settingsFile) ? json_decode(file_get_contents($settingsFile), true) : [];
$pageSettings = $settings['pages'] ?? [];
$brandingSettings = $settings['branding'] ?? [];

$siteName = $brandingSettings['siteName'] ?? 'Weather Portal';
$aboutContent = $pageSettings['aboutContent'] ?? '';
$aboutMission = $pageSettings['aboutMission'] ?? 'Our mission is to provide accurate weather forecasts and air quality information for cities worldwide. We believe that having access to this information should be simple, fast, and free.';
$aboutIntro = $pageSettings['aboutIntro'] ?? $siteName . ' is your comprehensive platform for accessing accurate weather forecasts for cities around the world. We are dedicated to providing reliable information to help you plan your day.';

include 'header.php';
?>

<div class="page-header">
    <h1 class="page-title" data-translate="about_us">About Us</h1>
    <p class="page-subtitle" data-translate="about_subtitle">Your trusted source for weather forecasts</p>
</div>

<div class="content-card">
    <?php if (!empty($aboutContent)): ?>
        <?php echo $aboutContent; ?>
    <?php else: ?>
    <h2 data-translate="welcome_site">Welcome to <?php echo htmlspecialchars($siteName); ?></h2>
    <p><?php echo htmlspecialchars($aboutIntro); ?></p>
    
    <h3 style="margin-top: 30px; margin-bottom: 15px;" data-translate="our_mission">Our Mission</h3>
    <p><?php echo htmlspecialchars($aboutMission); ?></p>
    
    <h3 style="margin-top: 30px; margin-bottom: 15px;" data-translate="what_we_offer">What We Offer</h3>
    <ul>
        <li><strong data-translate="accurate_weather">Accurate Weather Forecasts:</strong> <span data-translate="weather_offer_desc">Get today's weather, hourly forecasts, and 14-day predictions for cities worldwide</span></li>
        <li><strong data-translate="air_quality">Air Quality Index:</strong> <span data-translate="aqi_offer_desc">Monitor air quality with PM2.5, PM10 readings and health advice</span></li>
        <li><strong data-translate="global_weather">Global Weather:</strong> <span data-translate="global_offer_desc">Track weather conditions across 30+ major cities worldwide</span></li>
        <li><strong>Sun Times:</strong> <span>View sunrise and sunset times for any city</span></li>
        <li><strong>Moon Phases:</strong> <span>Track moon phases and lunar cycles</span></li>
        <li><strong>Weather Alerts:</strong> <span>Get notified about severe weather conditions</span></li>
    </ul>
    
    <h3 style="margin-top: 30px; margin-bottom: 15px;" data-translate="our_features">Our Features</h3>
    <p data-translate="features_intro">We've designed our platform with you in mind:</p>
    <ul>
        <li><strong data-translate="mobile_responsive">Mobile Responsive:</strong> <span data-translate="mobile_desc">Access our portal from any device - desktop, tablet, or smartphone</span></li>
        <li><strong data-translate="dark_mode">Dark Mode:</strong> <span data-translate="dark_mode_desc">Easy on the eyes with our dark/light mode toggle</span></li>
        <li><strong data-translate="fast_loading">Fast Loading:</strong> <span data-translate="fast_desc">Optimized for speed so you get the information you need quickly</span></li>
        <li><strong data-translate="multi_language">Multi-Language:</strong> <span data-translate="language_desc">Available in English, Arabic, Urdu, Turkish, and Indonesian</span></li>
        <li><strong data-translate="notifications">Notifications:</strong> <span data-translate="notifications_desc">Get weather alerts with browser notifications</span></li>
        <li><strong data-translate="multiple_cities">Multiple Cities:</strong> <span data-translate="cities_desc">Coverage for major cities across the world</span></li>
    </ul>
    
    <h3 style="margin-top: 30px; margin-bottom: 15px;" data-translate="data_accuracy">Data Accuracy</h3>
    <p data-translate="accuracy_desc">We strive to provide the most accurate information possible. Our weather data is sourced from reliable APIs updated in real-time.</p>
    <?php endif; ?>
</div>

<div class="content-card">
    <h2 data-translate="contact_us">Contact Us</h2>
    <p data-translate="contact_intro">We value your feedback and suggestions. If you have any questions, concerns, or ideas for improvement, please don't hesitate to reach out to us through our <a href="/contact.php" data-translate="contact_page">contact page</a>.</p>
</div>

<div class="ad-space">Advertisement Space</div>

<?php include 'footer.php'; ?>
