<?php
/**
 * Camera detail partial — Battery & Solar section.
 *
 * Expected variables in scope (via include):
 *   $mtc_cam, $mtc_battery_cached
 *
 * @package My Trail Camera
 * @since   8.2.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

?>
<!-- Battery & Solar -->
<div class="mtcam-full-width-row">
    <h4>🔋 <?php esc_html_e('Battery & Solar', 'my-trail-camera'); ?></h4>

    <!-- Basic battery estimate -->
    <div class="mtcam-flex-center mtcam-gap-10 mtcam-mb-8">
        <div class="mtcam-battery-bar-bg">
            <div class="mtcam-battery-bar-fill" style="width:<?php echo intval($mtc_battery_cached['battery_pct']); ?>%; background:<?php echo esc_attr(mtcam_battery_color($mtc_battery_cached['battery_pct'])); ?>;"></div>
        </div>
        <strong class="mtcam-text-lg" style="color:<?php echo esc_attr(mtcam_battery_color($mtc_battery_cached['battery_pct'])); ?>;"><?php echo esc_html(number_format($mtc_battery_cached['battery_pct'], 1)); ?> %</strong>
        <small class="mtcam-text-muted">(<?php esc_html_e('Consumption/day:', 'my-trail-camera'); ?> −<?php echo esc_html($mtc_battery_cached['consumed_mah']); ?> mAh)</small>
    </div>
</div>
