<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>WaifuBoard - Schedule</title>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link rel="icon" href="/public/assets/waifuboards.ico" type="image/x-icon">
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="/views/css/globals.css">
    <link rel="stylesheet" href="/views/css/schedule/schedule.css">
    <link rel="stylesheet" href="/views/css/components/navbar.css">
    <link rel="stylesheet" href="/views/css/components/updateNotifier.css">
</head>
<body>
    <div class="ambient-bg" id="ambientBg"></div>

    <div class="calendar-wrapper">
        <div class="calendar-controls">
            <div class="month-selector">
                <button class="icon-btn" onclick="navigate(-1)">
                    <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M15 18l-6-6 6-6"/></svg>
                </button>
                <div class="month-title" id="monthTitle">Loading...</div>
                <button class="icon-btn" onclick="navigate(1)">
                    <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 18l6-6-6-6"/></svg>
                </button>
            </div>

            <div class="controls-right">

                <div class="view-toggles">
                    <button class="toggle-item active" id="btnViewMonth" onclick="setViewType('MONTH')">Month</button>
                    <button class="toggle-item" id="btnViewWeek" onclick="setViewType('WEEK')">Week</button>
                </div>

                <div class="view-toggles">
                    <button class="toggle-item active" id="btnSub" onclick="setMode('SUB')">Sub</button>
                    <button class="toggle-item" id="btnDub" onclick="setMode('DUB')">Dub</button>
                </div>
            </div>
        </div>

        <div class="calendar-board">
            <div class="weekdays-grid">
                <div class="weekday-header">Mon</div>
                <div class="weekday-header">Tue</div>
                <div class="weekday-header">Wed</div>
                <div class="weekday-header">Thu</div>
                <div class="weekday-header">Fri</div>
                <div class="weekday-header">Sat</div>
                <div class="weekday-header">Sun</div>
            </div>
            <div class="days-grid" id="daysGrid">

            </div>
        </div>
    </div>

    <div class="loader" id="loader">
        <div class="spinner"></div>
        <span id="loadingText">Syncing Schedule...</span>
    </div>

    <div id="updateToast" class="hidden">
        <p>Update available: <span id="latestVersionDisplay">v1.x</span></p>

        <a
                id="downloadButton"
                href="https://git.waifuboard.app/ItsSkaiya/WaifuBoard/releases"
                target="_blank"
        >
            Click To Download
        </a>
    </div>

    <script src="/src/scripts/updateNotifier.js"></script>
    <script src="/src/scripts/schedule/schedule.js"></script>
    <script src="/src/scripts/auth-guard.js"></script>
</body>
</html>