@using Microsoft.AspNetCore.Identity;
@using SimpleClinic.Common;
@inject UserManager<ApplicationUser> userManager;


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <meta name="author" content="" />
    <link rel="shortcut icon" href="~/img/images/favicon.png" type="">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">

    <title> Orthoc </title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">

    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap" rel="stylesheet">

    <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css" />

    <link href="~/css/font-awesome.min.css" rel="stylesheet" />

    <link href="~/css/navigation.css" rel="stylesheet" />
    <link href="~/css/style.css" rel="stylesheet" />
    <link href="~/css/responsive.css" rel="stylesheet" />

</head>
<body>
    <div class="hero_area">

        <div class="hero_bg_box">
            <img src="~/img/images/hero-bg.png" alt="">
        </div>

        <header class="header_section">
            <div style="box-sizing:content-box" class="container">
                <nav class="navbar navbar-expand-lg custom_nav-container ">
                    <a class="navbar-brand" asp-controller="Home" asp-action="Index">
                        <span>
                            Simple Clinic
                        </span>
                    </a>

                    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                        <span class=""> </span>
                    </button>
                    @{
                        bool isInPatientRole;
                        bool isInDoctorRole;

                        if (User.Identity?.Name != null)
                        {
                            var user = await userManager.FindByNameAsync(User.Identity.Name);
                            isInPatientRole = await userManager.IsInRoleAsync(user, RoleNames.PatientRoleName);
                            isInDoctorRole = await userManager.IsInRoleAsync(user, RoleNames.DoctorRoleName);
                        }
                        else
                        {
                            isInPatientRole = false;
                            isInDoctorRole = false;
                        }

                    }

                    <div class="collapse navbar-collapse" id="navbarSupportedContent">
                        <ul class="navbar-nav">
                            @if (isInPatientRole)
                            {
                                <li class="nav-item active">
                                    <a class="nav-link" asp-controller="Home" asp-action="Index" asp-area="Patient">Home <span class="sr-only">(current)</span></a>
                                </li>
                            }
                            else if (isInDoctorRole)
                            {
                                <li class="nav-item active">
                                    <a class="nav-link" asp-controller="Home" asp-action="Index" asp-area="Doctor">Home <span class="sr-only">(current)</span></a>
                                </li>

                            }
                            else
                            {
                                <li class="nav-item active">
                                    <a class="nav-link" asp-controller="Home" asp-action="Index">Home <span class="sr-only">(current)</span></a>
                                </li>

                                <li class="nav-item">
                                    <a class="nav-link" asp-controller="Home" asp-action="Departments">Departments</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" asp-controller="Home" asp-action="Doctors">Doctors</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" asp-controller="Home" asp-action="Services">Services</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" asp-controller="Home" asp-action="Contacts">Contact Us</a>
                                </li>
                                <form class="form-inline">
                                    <button class="btn  my-2 my-sm-0 nav_search-btn" type="submit">
                                        <i class="fa fa-search" aria-hidden="true"></i>
                                    </button>
                                </form>
                            }

                        </ul>
                        <ul class="navbar-nav ms-auto d-flex flex-row">
                            <partial name="_LoginPartial" />
                        </ul>
                    </div>
                </nav>
            </div>
        </header>
        @using static SimpleClinic.Common.ExceptionMessages.NotificationMessages

        @if (!string.IsNullOrEmpty((string?)TempData[ErrorMessage]))
        {
            @await Html.PartialAsync("_ErrorPartial")
        }
        @if (!string.IsNullOrEmpty((string?)TempData[SuccessMessage]))
        {
            @await Html.PartialAsync("_SuccessPartial")
        }
        @RenderBody()
    </div>

    <footer class="footer_section">
        <div class="container">
            <div class="row">
                <div class="col-md-6 col-lg-3 footer_col">
                    <div class="footer_contact">
                        <h4>
                            Reach at..
                        </h4>
                        <div class="contact_link_box">
                            <a asp-controller="Home" asp-action="Contacts">
                                <i class="fa fa-map-marker" aria-hidden="true"></i>
                                <span>
                                    Location
                                </span>
                            </a>
                            <a href="">
                                <i class="fa fa-phone" aria-hidden="true"></i>
                                <span>
                                    Call +01 1234567890
                                </span>
                            </a>
                            <a asp-controller="Home" asp-action="Contacts">
                                <i class="fa fa-envelope" aria-hidden="true"></i>
                                <span>
                                    clinicinfomail@gmail.com
                                </span>
                            </a>
                        </div>
                    </div>
                    <div class="footer_social">
                        <a href="">
                            <i class="fa fa-facebook" aria-hidden="true"></i>
                        </a>
                        <a href="">
                            <i class="fa fa-twitter" aria-hidden="true"></i>
                        </a>
                        <a href="">
                            <i class="fa fa-linkedin" aria-hidden="true"></i>
                        </a>
                        <a href="">
                            <i class="fa fa-instagram" aria-hidden="true"></i>
                        </a>
                    </div>
                </div>
                <div class="col-md-6 col-lg-3 footer_col">
                    <div class="footer_detail">
                        <h4>
                            About
                        </h4>
                        <p>
                            At SimpleClinic, we're dedicated to revolutionizing the way patients connect with healthcare professionals and access essential medical services. Our platform serves as a bridge between patients seeking quality healthcare and skilled medical practitioners offering a range of specialized services.
                        </p>
                    </div>
                </div>
                <div class="col-md-6 col-lg-2 mx-auto footer_col">
                    <div class="footer_link_box">
                        <h4>
                            Links
                        </h4>
                        <div class="footer_links">
                            <a class="active" asp-controller="Home" asp-action="Index">
                                Home
                            </a>
                            <a class="" asp-controller="Home" asp-action="Departments">
                                Departments
                            </a>
                            <a class="" asp-controller="Home" asp-action="Doctors">
                                Doctors
                            </a>
                            <a class="" asp-controller="Home" asp-action="Contacts">
                                Contact Us
                            </a>
                        </div>
                    </div>
                </div>
                <div class="col-md-6 col-lg-3 footer_col ">
                    <h4>
                        Newsletter
                    </h4>
                    <form action="#">
                        <input type="email" placeholder="Enter email" />
                        <button type="submit">
                            Subscribe
                        </button>
                    </form>
                </div>
            </div>
            <div class="footer-info">
                <p>
                    &copy; <span id="displayYear"></span> All Rights Reserved By
                </p>

            </div>
        </div>
    </footer>
    <script type="text/javascript" src="~/js/jquery-3.4.1.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous">
    </script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js">
    </script>
    <script type="text/javascript" src="~/js/custom.js"></script>
    @await RenderSectionAsync("Scripts", required: false)
</body>
</html>

