<?php
// Header include file - Navigation and head section
?>
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>متجر روز سكين - العناية الطبيعية للبشرة</title>
    <link href="https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <link rel="stylesheet" href="output.css">
</head>
<body>
    <!-- Modern Navigation -->
    <nav class="navbar">
        <div class="flex justify-between items-center h-20 px-4 md:px-6">
            <!-- Logo -->
            <a href="index.php" class="flex items-center">
                <?php if ($user_model->getSetting('logo_image')): ?>
                    <img src="<?php echo htmlspecialchars($user_model->getSetting('logo_image')); ?>" alt="Logo" class="h-12 w-12 md:h-14 md:w-14 rounded-full object-cover border-2 border-white shadow-lg">
                <?php else: ?>
                    <div class="h-12 w-12 md:h-14 md:w-14 bg-gradient-to-br from-purple-500 to-pink-500 rounded-full flex items-center justify-center text-white font-bold text-lg shadow-lg">
                        RS
                    </div>
                <?php endif; ?>
                <span class="mr-3 text-white font-bold text-lg">💄 روز سكين</span>
            </a>

            <!-- Profile on Left -->
            <?php if (isset($_SESSION['user_id'])): ?>
                <div class="relative" id="profileDropdown">
                    <a href="account.php" class="text-white hover:text-gray-200 transition-colors icon-bounce cursor-pointer flex items-center">
                        <?php if ($user_data && isset($user_data['profile_picture']) && $user_data['profile_picture']): ?>
                            <img src="<?php echo htmlspecialchars($user_data['profile_picture']); ?>" alt="Profile" class="w-8 h-8 rounded-full object-cover border border-white">
                        <?php else: ?>
                            <div class="w-8 h-8 bg-blue-500 rounded-full flex items-center justify-center text-white text-sm border border-white">
                                <?php echo htmlspecialchars(substr($_SESSION['user_name'] ?? 'U', 0, 1)); ?>
                            </div>
                        <?php endif; ?>
                        <svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
                        </svg>
                    </a>
                </div>
            <?php else: ?>
                <a href="login.php" class="text-white hover:text-gray-200 transition-colors icon-bounce">
                    <i class="fas fa-user text-xl"></i>
                </a>
            <?php endif; ?>
        </div>
    </nav>