<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Subscription Expired - RestPO</title>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
        body {
            min-height: 100vh;
            background: #0f172a;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }
        .bg-glow {
            position: fixed;
            width: 600px; height: 600px;
            border-radius: 50%;
            filter: blur(150px);
            opacity: 0.15;
            pointer-events: none;
        }
        .glow-1 { top: -200px; left: -100px; background: #ef4444; }
        .glow-2 { bottom: -200px; right: -100px; background: #f59e0b; }

        .card {
            position: relative;
            z-index: 1;
            width: 100%;
            max-width: 520px;
            margin: 20px;
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 24px;
            padding: 48px 40px;
            text-align: center;
            backdrop-filter: blur(20px);
        }

        .icon-wrap {
            width: 88px; height: 88px;
            border-radius: 24px;
            background: rgba(239,68,68,0.12);
            border: 1px solid rgba(239,68,68,0.25);
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 28px;
            animation: pulse-glow 2s ease-in-out infinite;
        }
        .icon-wrap i {
            font-size: 36px;
            color: #f87171;
        }

        @keyframes pulse-glow {
            0%, 100% { box-shadow: 0 0 20px rgba(239,68,68,0.15); }
            50% { box-shadow: 0 0 40px rgba(239,68,68,0.25); }
        }

        h1 {
            font-size: 26px;
            font-weight: 800;
            color: white;
            margin-bottom: 8px;
            letter-spacing: -0.02em;
        }
        .subtitle {
            font-size: 15px;
            color: #94a3b8;
            line-height: 1.6;
            margin-bottom: 32px;
        }

        .info-box {
            background: rgba(239,68,68,0.06);
            border: 1px solid rgba(239,68,68,0.15);
            border-radius: 16px;
            padding: 20px;
            margin-bottom: 28px;
        }
        .info-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 0;
        }
        .info-row:not(:last-child) {
            border-bottom: 1px solid rgba(255,255,255,0.05);
        }
        .info-label {
            font-size: 13px;
            color: #64748b;
            font-weight: 500;
        }
        .info-value {
            font-size: 13px;
            color: #e2e8f0;
            font-weight: 600;
        }
        .info-value.expired {
            color: #f87171;
        }

        .contact-text {
            font-size: 13px;
            color: #64748b;
            margin-bottom: 24px;
            line-height: 1.6;
        }
        .contact-text i { color: #f59e0b; margin-right: 4px; }

        .btn-logout {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 12px 32px;
            border-radius: 12px;
            background: rgba(239,68,68,0.15);
            border: 1px solid rgba(239,68,68,0.3);
            color: #fca5a5;
            font-weight: 600;
            font-size: 14px;
            text-decoration: none;
            transition: all 0.2s;
            cursor: pointer;
        }
        .btn-logout:hover {
            background: rgba(239,68,68,0.25);
            color: #fecaca;
            transform: translateY(-1px);
        }

        .logo-badge {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 32px;
            padding: 6px 14px;
            border-radius: 10px;
            background: rgba(139,92,246,0.12);
            border: 1px solid rgba(139,92,246,0.25);
        }
        .logo-badge .dot {
            width: 28px; height: 28px;
            border-radius: 8px;
            background: linear-gradient(135deg, #8b5cf6, #3b82f6);
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .logo-badge .dot i { color: white; font-size: 12px; }
        .logo-badge span { color: white; font-weight: 700; font-size: 14px; }
    </style>
</head>
<body>
    <div class="bg-glow glow-1"></div>
    <div class="bg-glow glow-2"></div>

    <div class="card">
        <div class="logo-badge">
            <div class="dot"><i class="fas fa-utensils"></i></div>
            <span>RestPO</span>
        </div>

        <div class="icon-wrap">
            <i class="fas fa-calendar-xmark"></i>
        </div>

        <h1>Subscription Expired</h1>
        <p class="subtitle">
            Your restaurant's subscription has expired. All operational features
            (POS, waiter panel, QR ordering, kitchen display) are currently disabled.
        </p>

        <div class="info-box">
            <div class="info-row">
                <span class="info-label">Restaurant</span>
                <span class="info-value"><?php echo htmlspecialchars($_SESSION['restaurant_name'] ?? 'Your Restaurant'); ?></span>
            </div>
            <div class="info-row">
                <span class="info-label">Your Role</span>
                <span class="info-value"><?php echo ucfirst($_SESSION['role'] ?? 'Staff'); ?></span>
            </div>
            <div class="info-row">
                <span class="info-label">Status</span>
                <span class="info-value expired"><i class="fas fa-circle" style="font-size:8px;margin-right:4px"></i> Expired</span>
            </div>
        </div>

        <p class="contact-text">
            <i class="fas fa-info-circle"></i>
            Please contact your restaurant administrator to renew the subscription
            and restore access to all features.
        </p>

        <div class="flex flex-col sm:flex-row gap-3 justify-center items-center">
            <?php if (isset($_SESSION['role']) && $_SESSION['role'] === 'admin'): ?>
            <a href="/restpo/admin/subscription" class="inline-flex items-center gap-2 py-3 px-6 rounded-xl font-bold text-sm text-white transition-all shadow-lg hover:brightness-110" style="background: linear-gradient(135deg, #10b981, #059669); cursor: pointer; text-decoration: none;">
                <i class="fas fa-credit-card"></i>
                Manage Subscription
            </a>
            <?php endif; ?>
            <a href="/restpo/logout" class="btn-logout <?php echo (isset($_SESSION['role']) && $_SESSION['role'] === 'admin') ? 'w-full sm:w-auto' : ''; ?>">
                <i class="fas fa-sign-out-alt"></i>
                Sign Out
            </a>
        </div>
    </div>
</body>
</html>
