---
// Demo page for the new authentication system
---

<html>
<head>
    <title>New Authentication System Demo</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            min-height: 100vh;
            padding: 2rem;
        }
        
        .container {
            max-width: 1200px;
            margin: 0 auto;
        }
        
        h1 {
            text-align: center;
            font-size: 3rem;
            margin-bottom: 3rem;
            font-weight: 700;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
        }
        
        .demo-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
            gap: 2rem;
            margin-bottom: 3rem;
        }
        
        .demo-card {
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            border-radius: 20px;
            padding: 2rem;
            border: 1px solid rgba(255, 255, 255, 0.2);
            transition: all 0.3s ease;
        }
        
        .demo-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
        }
        
        .demo-card h2 {
            margin-bottom: 1rem;
            font-size: 1.8rem;
            color: #a8d8ff;
        }
        
        .demo-card p {
            margin-bottom: 1.5rem;
            opacity: 0.9;
            line-height: 1.6;
        }
        
        .demo-button {
            display: inline-block;
            background: rgba(255, 255, 255, 0.2);
            color: white;
            padding: 0.75rem 1.5rem;
            border-radius: 10px;
            text-decoration: none;
            font-weight: 600;
            transition: all 0.3s ease;
            border: 1px solid rgba(255, 255, 255, 0.3);
            margin-right: 1rem;
            margin-bottom: 0.5rem;
        }
        
        .demo-button:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: translateY(-2px);
        }
        
        .demo-button.primary {
            background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
            color: white;
        }
        
        .demo-button.primary:hover {
            background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
        }
        
        .features {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 20px;
            padding: 2rem;
            margin-bottom: 2rem;
        }
        
        .features h2 {
            text-align: center;
            margin-bottom: 2rem;
            font-size: 2rem;
            color: #a8d8ff;
        }
        
        .features-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 1.5rem;
        }
        
        .feature-item {
            background: rgba(255, 255, 255, 0.05);
            padding: 1.5rem;
            border-radius: 15px;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }
        
        .feature-item h3 {
            margin-bottom: 0.5rem;
            color: #fbbf24;
        }
        
        .feature-item p {
            opacity: 0.8;
            font-size: 0.9rem;
        }
        
        .test-credentials {
            background: rgba(255, 255, 255, 0.1);
            border-radius: 15px;
            padding: 1.5rem;
            margin-bottom: 2rem;
            border: 1px solid rgba(255, 255, 255, 0.2);
        }
        
        .test-credentials h3 {
            margin-bottom: 1rem;
            color: #fbbf24;
        }
        
        .credentials {
            background: rgba(0, 0, 0, 0.2);
            padding: 1rem;
            border-radius: 10px;
            font-family: 'Courier New', monospace;
            margin-bottom: 1rem;
        }
        
        .footer {
            text-align: center;
            margin-top: 3rem;
            opacity: 0.8;
        }
        
        @media (max-width: 768px) {
            h1 {
                font-size: 2rem;
            }
            
            .demo-grid {
                grid-template-columns: 1fr;
            }
            
            .demo-card {
                padding: 1.5rem;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>🚀 New Authentication System Demo</h1>
        
        <div class="test-credentials">
            <h3>🔑 Test Credentials</h3>
            <div class="credentials">
                <strong>Email:</strong> test@example.com<br>
                <strong>Password:</strong> password123
            </div>
            <p>Use these credentials to test the authentication system functionality.</p>
        </div>
        
        <div class="demo-grid">
            <div class="demo-card">
                <h2>🧪 Interactive Test</h2>
                <p>Test the complete authentication flow with mock data. Sign in, sign up, and explore role-based permissions.</p>
                <a href="/auth-test-new" class="demo-button primary">Try Interactive Test</a>
            </div>
            
            <div class="demo-card">
                <h2>🔐 Production Login</h2>
                <p>Experience the new login system with production-ready components and glassmorphism design.</p>
                <a href="/login-new" class="demo-button primary">Test New Login</a>
            </div>
            
            <div class="demo-card">
                <h2>📊 System Status</h2>
                <p>Check the health and status of all authentication system components and services.</p>
                <a href="/auth-status" class="demo-button">View Status</a>
            </div>
            
            <div class="demo-card">
                <h2>🏠 Main Application</h2>
                <p>Navigate to the main application homepage to see the system in its full context.</p>
                <a href="/" class="demo-button">Go to Homepage</a>
            </div>
        </div>
        
        <div class="features">
            <h2>🛠️ System Features</h2>
            <div class="features-grid">
                <div class="feature-item">
                    <h3>🔧 Modular Architecture</h3>
                    <p>Clean separation of concerns with pluggable providers and components.</p>
                </div>
                
                <div class="feature-item">
                    <h3>🔒 Secure by Default</h3>
                    <p>httpOnly cookies, CSRF protection, and secure session management.</p>
                </div>
                
                <div class="feature-item">
                    <h3>⚡ React Integration</h3>
                    <p>Custom hooks, context providers, and pre-built components.</p>
                </div>
                
                <div class="feature-item">
                    <h3>🛡️ Route Protection</h3>
                    <p>Declarative guards for protecting pages and components.</p>
                </div>
                
                <div class="feature-item">
                    <h3>👥 Role-based Access</h3>
                    <p>Granular permissions and role management system.</p>
                </div>
                
                <div class="feature-item">
                    <h3>🔄 Auto Token Refresh</h3>
                    <p>Seamless token renewal without user intervention.</p>
                </div>
                
                <div class="feature-item">
                    <h3>🧪 Comprehensive Testing</h3>
                    <p>Full Playwright test suite with integration tests.</p>
                </div>
                
                <div class="feature-item">
                    <h3>📚 Complete Documentation</h3>
                    <p>Migration guides, API docs, and deployment checklists.</p>
                </div>
            </div>
        </div>
        
        <div class="footer">
            <p>🐳 Running in Docker on Port 3000</p>
            <p>✅ Authentication System Replacement Complete</p>
        </div>
    </div>
</body>
</html>