<?php
// ============================================================
// INDEX PAGE - CAOSCE
// ============================================================
session_start();

// Get current page name for active navigation
$current_page = basename($_SERVER['PHP_SELF']);
?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CAOSCE · Network</title>
    <link rel="icon" type="image/x-icon" href="CAOSCE Network.ico">
    <!-- Font Awesome 6 (Free) -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
    <style>
        /* ----- RESET & BASE ----- */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: #f0f4fb;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            color: #10233f;
        }

        /* ----- NAVIGATION (SOLID, NON-TRANSPARENT) ----- */
        .navbar {
            position: sticky;
            top: 0;
            z-index: 60;
            background: #ffffff;
            border-bottom: 2px solid #e2eaf2;
            padding: 0 5vw;
            height: 74px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: 0 2px 12px rgba(16, 35, 63, 0.06);
        }

        .brand {
            display: flex;
            align-items: center;
            gap: 12px;
            font-weight: 800;
            font-size: 20px;
            color: #10233f;
            text-decoration: none;
        }

        .brand-icon {
            width: 38px;
            height: 38px;
            background: linear-gradient(135deg, #1a6cf0, #6d5dfc);
            border-radius: 12px;
            display: grid;
            place-items: center;
            color: white;
            font-size: 18px;
            font-weight: 900;
            box-shadow: 0 8px 18px rgba(26, 108, 240, 0.25);
        }

        .brand-light {
            font-weight: 500;
            color: #4f6580;
        }

        .nav-links {
            display: flex;
            align-items: center;
            gap: 28px;
        }

        .nav-links a {
            font-size: 14px;
            font-weight: 600;
            color: #4f6580;
            text-decoration: none;
            transition: 0.2s;
            position: relative;
            padding: 6px 0;
        }

        .nav-links a i {
            margin-right: 6px;
            font-size: 13px;
        }

        .nav-links a:hover {
            color: #1a6cf0;
        }

        .nav-links a.active {
            color: #1a6cf0;
        }

        .nav-links a.active::after {
            content: '';
            position: absolute;
            bottom: -2px;
            left: 0;
            width: 100%;
            height: 3px;
            background: #1a6cf0;
            border-radius: 4px;
        }

        .nav-logout {
            background: #f0f4fb;
            border: 1px solid #d9e2eb;
            border-radius: 30px;
            padding: 6px 18px;
            font-weight: 600;
            font-size: 13px;
            color: #10233f;
            transition: 0.2s;
        }

        .nav-logout:hover {
            background: #e2eaf2;
            border-color: #b0c4d8;
            color: #1a6cf0;
        }

        /* ----- MAIN CONTAINER ----- */
        main {
            flex: 1;
            padding: 30px 5vw;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .container {
            max-width: 900px;
            width: 100%;
            margin: 0 auto;
            background: #ffffff;
            padding: 50px 40px 45px;
            border-radius: 28px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
            border: 1px solid #eef4fa;
            text-align: center;
            transition: 0.3s;
        }

        .container:hover {
            box-shadow: 0 30px 80px rgba(0, 0, 0, 0.12);
        }

        /* ----- WELCOME SECTION ----- */
        .welcome-section {
            margin-bottom: 30px;
        }

        .welcome-section .greeting {
            font-size: 16px;
            font-weight: 500;
            color: #1a6cf0;
            letter-spacing: 2px;
            text-transform: uppercase;
            margin-bottom: 6px;
        }

        .welcome-section h1 {
            font-size: 48px;
            font-weight: 900;
            color: #10233f;
            line-height: 1.2;
            margin-bottom: 4px;
        }

        .welcome-section h1 .highlight {
            background: linear-gradient(135deg, #1a6cf0, #6d5dfc);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .welcome-section .subtitle {
            font-size: 16px;
            color: #6b7a8f;
            margin-top: 4px;
        }

        /* ----- LOGO / IMAGE ----- */
        .logo-container {
            margin: 25px auto 30px;
            padding: 20px;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .logo-container img {
            max-width: 100%;
            height: auto;
            max-height: 300px;
            border-radius: 16px;
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
            transition: 0.3s;
            border: 2px solid #eef4fa;
            object-fit: contain;
        }

        .logo-container img:hover {
            transform: scale(1.02);
            box-shadow: 0 16px 50px rgba(0, 0, 0, 0.12);
        }

        /* ----- DIVIDER ----- */
        .divider {
            width: 80px;
            height: 4px;
            background: linear-gradient(135deg, #1a6cf0, #6d5dfc);
            border-radius: 4px;
            margin: 0 auto 30px;
        }

        /* ----- ADMIN BUTTON ----- */
        .admin-btn-wrapper {
            margin-top: 10px;
        }

        .btn-admin {
            display: inline-flex;
            align-items: center;
            gap: 12px;
            padding: 16px 48px;
            background: linear-gradient(135deg, #1a6cf0, #6d5dfc);
            color: white;
            border: none;
            border-radius: 50px;
            font-size: 18px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s ease;
            text-decoration: none;
            box-shadow: 0 8px 28px rgba(26, 108, 240, 0.3);
            letter-spacing: 0.5px;
        }

        .btn-admin:hover {
            transform: translateY(-4px) scale(1.02);
            box-shadow: 0 14px 40px rgba(26, 108, 240, 0.4);
        }

        .btn-admin i {
            font-size: 20px;
        }

        .btn-admin .arrow {
            transition: 0.3s;
        }

        .btn-admin:hover .arrow {
            transform: translateX(6px);
        }

        /* ----- FEATURES/INFO BADGES ----- */
        .info-badges {
            display: flex;
            justify-content: center;
            gap: 30px;
            margin-top: 35px;
            flex-wrap: wrap;
        }

        .info-badge {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 14px;
            color: #6b7a8f;
            background: #f8fafc;
            padding: 8px 20px;
            border-radius: 30px;
            border: 1px solid #eef4fa;
        }

        .info-badge i {
            color: #1a6cf0;
            font-size: 16px;
        }

        .info-badge span {
            font-weight: 500;
            color: #10233f;
        }

        /* ----- FOOTER ----- */
        .footer {
            margin-top: auto;
            padding: 24px 5vw 20px;
            background: #071a31;
            color: #b6c9dd;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
            font-size: 13px;
            border-top: 1px solid #1f3550;
        }

        .footer strong {
            color: #dce7f5;
        }

        .footer .meta {
            display: flex;
            gap: 24px;
            align-items: center;
        }

        .footer .meta span {
            color: #7c92ab;
        }

        /* ----- RESPONSIVE ----- */
        @media (max-width: 900px) {
            .navbar {
                padding: 0 4vw;
                height: 68px;
            }

            .nav-links a:not(.nav-logout) {
                display: none;
            }

            .nav-links a.nav-logout {
                display: inline-block;
            }

            .container {
                padding: 35px 25px;
            }

            .welcome-section h1 {
                font-size: 36px;
            }

            .logo-container img {
                max-height: 200px;
            }

            .btn-admin {
                padding: 14px 36px;
                font-size: 16px;
            }
        }

        @media (max-width: 600px) {
            main {
                padding: 16px 4vw;
            }

            .container {
                padding: 28px 18px;
                border-radius: 20px;
            }

            .welcome-section h1 {
                font-size: 28px;
            }

            .welcome-section .greeting {
                font-size: 13px;
            }

            .logo-container {
                margin: 15px auto 20px;
                padding: 10px;
            }

            .logo-container img {
                max-height: 150px;
            }

            .btn-admin {
                padding: 12px 28px;
                font-size: 15px;
                width: 100%;
                justify-content: center;
            }

            .info-badges {
                gap: 12px;
            }

            .info-badge {
                font-size: 12px;
                padding: 6px 14px;
            }

            .footer {
                flex-direction: column;
                gap: 10px;
                align-items: flex-start;
            }
        }

        @media (max-width: 400px) {
            .brand {
                font-size: 16px;
            }

            .brand-icon {
                width: 30px;
                height: 30px;
                font-size: 14px;
            }

            .welcome-section h1 {
                font-size: 24px;
            }

            .logo-container img {
                max-height: 120px;
            }

            .btn-admin {
                font-size: 14px;
                padding: 10px 20px;
            }
        }
    </style>
</head>

<body>

    <!-- ============================================================
         NAVIGATION (SOLID, NON-TRANSPARENT)
         ============================================================ -->
    <header class="navbar">
        <a href="index.php" class="brand">
            <span class="brand-icon">CN</span>
            <span>CAOSCE <span class="brand-light">Network</span></span>
        </a>
        <div class="nav-links">
            <a href="index.php" class="<?php echo $current_page == 'index.php' ? 'active' : ''; ?>">
                <i class="fas fa-home"></i> Home
            </a>
            <a href="admin.php" class="<?php echo $current_page == 'admin.php' ? 'active' : ''; ?>">
                <i class="fas fa-user-shield"></i> Admin
            </a>
            <a href="logout.php" class="nav-logout">
                <i class="fas fa-sign-out-alt"></i> Logout
            </a>
        </div>
    </header>

    <!-- ============================================================
         MAIN CONTENT
         ============================================================ -->
    <main>
        <div class="container">

            <!-- CAOSCE Logo Image -->
            <div class="logo-container">
                <img src="CAOSCE.webp" alt="CAOSCE Logo" onerror="this.onerror=null; this.alt='CAOSCE'; this.style.fontSize='48px'; this.style.color='#1a6cf0'; this.style.fontWeight='800'; this.parentElement.innerHTML='<div style=\'font-size:80px; color:#1a6cf0; font-weight:900;\'>CAOSCE</div><div style=\'color:#6b7a8f; font-size:16px; margin-top:8px;\'>Clinical Assessment &amp; OSCE System</div>'">
            </div>

            <!-- Divider -->
            <div class="divider"></div>

            <!-- Admin Button -->
            <div class="admin-btn-wrapper">
                <a href="admin.php" class="btn-admin">
                    <i class="fas fa-user-shield"></i>
                    Enter Admin Panel
                    <span class="arrow"><i class="fas fa-arrow-right"></i></span>
                </a>
            </div>

            <!-- Info Badges -->
            <div class="info-badges">
                <div class="info-badge">
                    <i class="fas fa-users"></i>
                    <span>Student Management</span>
                </div>
                <div class="info-badge">
                    <i class="fas fa-chart-bar"></i>
                    <span>Results &amp; Scores</span>
                </div>
                <div class="info-badge">
                    <i class="fas fa-list-check"></i>
                    <span>OSCE Procedures</span>
                </div>
            </div>

        </div>
    </main>

    <!-- ============================================================
         FOOTER
         ============================================================ -->
    <footer class="footer">
        <div>
            <strong><i class="fas fa-network-wired" style="margin-right:8px;"></i> CAOSCE Network</strong>
            <span style="margin-left:18px;">© <?php echo date('Y'); ?> All rights reserved</span>
        </div>
        <div class="meta">
            <span><i class="fas fa-code"></i> v2.0</span>
            <span>|</span>
            <span><i class="fas fa-user-cog"></i> Admin Panel</span>
            <span>|</span>
        </div>
    </footer>

</body>

</html>