<?php require_once __DIR__ . '/site_data.php';
function ugfx_nav_is_active(string $href): string {
  $current = basename(parse_url($_SERVER['REQUEST_URI'] ?? 'index.php', PHP_URL_PATH) ?: 'index.php');
  return $current === basename($href) || ($current === '' && basename($href)==='index.php') ? ' active' : '';
}
function ugfx_public_header($title='Underground FX Radio'){ $settings=ugfx_settings(); $listenLinks=$settings['listen_links'] ?? []; ?>
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title><?= htmlspecialchars($title) ?></title><meta name="description" content="Underground FX Radio — live-ready community radio platform with stream, DJs, requests, chat, news, events, charts, and control-room admin."><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap" rel="stylesheet"><link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"><link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css" rel="stylesheet"><link href="assets/css/ugfx-master.css" rel="stylesheet"></head><body><div class="fx-bg"></div><div class="fx-image"></div><div class="fx-grid"></div><div class="fx-scanlines"></div><div class="fx-vignette"></div><div class="fx-glow fx-glow-1"></div><div class="fx-glow fx-glow-2"></div><div class="fx-glow fx-glow-3"></div><canvas class="fx-particles" id="fxParticles"></canvas><div class="station-ticker"><div class="container-xxl d-flex flex-wrap gap-3 justify-content-between align-items-center"><div class="ticker-track"><span class="live-dot"></span> Underground FX • live stream • requests • DJs • website chat • Discord • station news • events • charts • admin studio</div><div class="ticker-right d-flex flex-wrap gap-2"><?php foreach($listenLinks as $link): ?><a href="<?= htmlspecialchars($link['url']) ?>" target="_blank" rel="noopener"><?= htmlspecialchars($link['label']) ?></a><?php endforeach; ?></div></div></div><nav class="navbar navbar-expand-xxl navbar-dark ugfx-nav"><div class="container-xxl"><div class="nav-shell w-100"><div class="nav-row nav-row-main"><a class="navbar-brand" href="index.php"><span class="brand-orb"><i class="bi bi-broadcast-pin"></i></span><span class="brand-copy"><span class="eyebrow">LIVE COMMUNITY RADIO</span><span class="wordmark">UNDERGROUND FX</span><span class="tagline"><?= htmlspecialchars($settings['station_tagline']) ?></span></span></a><div class="nav-actions d-flex flex-wrap gap-2 align-items-center"><a class="btn btn-neon" href="<?= htmlspecialchars($settings['stream_url']) ?>" target="_blank" rel="noopener"><i class="bi bi-play-circle-fill"></i> Listen Live</a><a class="btn btn-darkglass" href="<?= htmlspecialchars($settings['discord_url']) ?>" target="_blank" rel="noopener"><i class="bi bi-discord"></i> Discord</a><a class="btn btn-darkglass" href="admin/login.php"><i class="bi bi-shield-lock"></i> Admin</a><button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mainNav"><span class="navbar-toggler-icon"></span></button></div></div><div class="nav-status-row"><div class="status-block"><span class="status-label">Now playing</span><span class="status-value" data-nowplaying><?= htmlspecialchars(ugfx_nowplaying_text()) ?></span></div><div class="status-block"><span class="status-label">Primary stream</span><span class="status-value"><?= htmlspecialchars($settings['stream_url']) ?></span></div><div class="status-block"><span class="status-label">Station links</span><span class="status-value">MyTuner • RadioBox • US-RADIO • RadioSpinner</span></div></div><div class="collapse navbar-collapse w-100" id="mainNav"><div class="nav-row nav-row-links"><ul class="navbar-nav nav-main-links"><?php $links=[['Home','index.php','house-door'],['About','about.php','broadcast'],['DJs','djs.php','mic-fill'],['Schedule','schedule.php','calendar-week'],['News','news.php','newspaper'],['Events','events.php','calendar-event'],['Requests','requests.php','music-note-list'],['Chat','chat.php','chat-dots'],['Charts','top50.php','bar-chart'],['Friends','friends.php','people'],['Fans','fans.php','heart'],['Join Team','team.php','person-plus'],['Contact','contact.php','envelope'],['Player','popout-player.php','play-btn']]; foreach($links as [$label,$href,$icon]): ?><li class="nav-item"><a class="nav-link<?= ugfx_nav_is_active($href) ?>" href="<?= $href ?>"><i class="bi bi-<?= $icon ?>"></i><span><?= $label ?></span></a></li><?php endforeach; ?></ul></div></div></div></div></nav><?php }
function ugfx_public_footer(){ $settings=ugfx_settings(); $listenLinks=$settings['listen_links'] ?? []; ?><footer class="ugfx-footer mt-5"><div class="container-xxl"><div class="row g-4"><div class="col-xl-4"><div class="glass-panel p-4 h-100"><div class="footer-title">Underground FX Radio</div><p class="mb-3">Underground FX is built to feel live, bold, visual, and impossible to miss — with real shows, real personalities, listener routes, station updates, and a stronger control-room presence behind the scenes.</p><div class="d-flex gap-2 flex-wrap"><span class="mini-pill">Live stream</span><span class="mini-pill">Now playing</span><span class="mini-pill">News</span><span class="mini-pill">Events</span><span class="mini-pill">Requests</span><span class="mini-pill">Admin Studio</span></div></div></div><div class="col-xl-4"><div class="glass-panel p-4 h-100"><div class="footer-title">Station routes</div><div class="footer-links"><a href="schedule.php">Schedule</a><a href="news.php">News</a><a href="events.php">Events</a><a href="requests.php">Requests</a><a href="chat.php">Website Chat</a><a href="top50.php">Charts</a><a href="friends.php">Friends</a><a href="team.php">Join Team</a></div></div></div><div class="col-xl-4"><div class="glass-panel p-4 h-100"><div class="footer-title">Listen everywhere</div><p class="mb-2">Primary stream</p><code><?= htmlspecialchars($settings['stream_url']) ?></code><div class="listen-grid mt-3"><?php foreach($listenLinks as $link): ?><a class="listen-link" href="<?= htmlspecialchars($link['url']) ?>" target="_blank" rel="noopener"><?= htmlspecialchars($link['label']) ?></a><?php endforeach; ?></div><p class="small mt-3 mb-0">Temporary admin access stays removable before launch from <code>admin/config/master_admin.php</code>.</p></div></div></div><div class="footer-bottom">© <?= date('Y') ?> Underground FX Radio • live-ready master build • desktop / tablet / mobile</div></div></footer><script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script><script src="assets/js/ugfx-master.js"></script></body></html><?php }
