<?php $this->load->view("partial/header"); ?>

<style>
.report_page {
    padding: 28px;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f0f4ff;
    min-height: calc(100vh - 120px);
}

.report_header {
    text-align: center;
    margin-bottom: 24px;
}

.report_title {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 6px;
}

.report_subtitle {
    font-size: 14px;
    color: #999;
    font-weight: 500;
}

.report_actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.back_btn {
    background: rgba(15,52,96,0.08);
    color: #0f3460;
    border: 1px solid rgba(15,52,96,0.2);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    font-family: 'Segoe UI', Arial, sans-serif;
    display: inline-block;
}

.back_btn:hover {
    background: #0f3460;
    color: white;
    text-decoration: none;
}

.flash_notice {
    background: rgba(102,126,234,0.08);
    border: 1px solid rgba(102,126,234,0.25);
    border-radius: 14px;
    padding: 40px 32px;
    text-align: center;
    margin-bottom: 24px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.flash_notice .flash_icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.flash_notice h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 10px;
}

.flash_notice p {
    font-size: 14px;
    color: #777;
    line-height: 1.6;
    margin-bottom: 16px;
}

.flash_notice .alt_btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 14px rgba(102,126,234,0.4);
    transition: all 0.2s;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.flash_notice .alt_btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102,126,234,0.5);
    color: white;
    text-decoration: none;
}

.summary_card {
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.9);
    border-radius: 16px;
    padding: 24px 28px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    max-width: 400px;
    margin: 0 auto;
}

.summary_card_title {
    font-size: 12px;
    font-weight: 700;
    color: #f47f20;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(244,127,32,0.2);
}

.summary_row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    color: #444;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-family: 'Segoe UI', Arial, sans-serif;
}

.summary_row:last-child {
    border-bottom: none;
    font-weight: 700;
    color: #1a1a2e;
    font-size: 15px;
    padding-top: 12px;
    margin-top: 4px;
}
</style>

<div class="report_page">

    <div class="report_header">
        <div class="report_title"><?php echo $title; ?></div>
        <div class="report_subtitle"><?php echo $subtitle; ?></div>
    </div>

    <div class="report_actions">
        <a href="<?php echo site_url('reports'); ?>" class="back_btn">← Back to Reports</a>
    </div>

    <!-- Flash not supported notice -->
    <div class="flash_notice">
        <span class="flash_icon">📊</span>
        <h3>Graphical Reports Not Available</h3>
        <p>
            This report uses Adobe Flash which was permanently discontinued in all browsers in 2021.
            The data is still available — use the Summary Reports section to view the same data in table format.
        </p>
        <a href="<?php echo site_url('reports'); ?>" class="alt_btn">
            📋 View Summary Reports Instead
        </a>
    </div>

    <!-- Summary Data -->
    <?php if(count($summary_data) > 0): ?>
    <div class="summary_card">
        <div class="summary_card_title">📊 Data Summary</div>
        <?php foreach($summary_data as $name=>$value): ?>
        <div class="summary_row">
            <span><?php echo $this->lang->line('reports_'.$name); ?></span>
            <span><?php echo to_currency($value); ?></span>
        </div>
        <?php endforeach; ?>
    </div>
    <?php endif; ?>

</div>

<?php $this->load->view("partial/footer"); ?>