<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><%= cloudname %> | <%= lang["My-Profile"] %></title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css">
</head>
<body>
    <style>
    @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500&display=swap');
    body {
            background-image: linear-gradient(to right bottom, #1f74cc, #3c7ed1, #5087d6, #6291db, #729be0, #87a6e4, #9ab1e9, #acbced, #c5cbf1, #dadcf5, #eeedfa, #ffffff);
            width: 100vw;
            height: 100vh;
            margin: 0;
        }

        .flex-container {
            display: flex;
            width: 100%;
            height: 96%;
            flex-flow: column nowrap;
            justify-content: center;
            align-items: center;
        }

        .profile {
            width: 25%;
            height: 30%;
            background-color: #111111;
            border-radius: 50px;
            align-items: center;
            justify-content: center;
            align-items: center;
        }

        .profile > h1, .profile > h2, .profile > img, .profile > h3, h3 {
            font-family: 'Montserrat', sans-serif;
            text-align: center;
            color: #1f74cc;
            line-height: 40%;
        }

        table {
            border-collapse: collapse;
            margin-left: auto;
            margin-right: auto;
            border: 2px solid #555555;
        }

        td, th {
            border: 2px solid #555555;
            padding: 8px;
            text-align: center;
            color: #1f74cc;
            font-family: "Montserrat", sans-serif;
        }

        img {
            width: 50px;
        }

        a:link, a:visited, a:hover, a:active {
            color: #1f74cc;
            text-decoration: none;
            background-color: transparent;
        }

        button {
          display: flex;
            justify-content: center;
            align-items: center;
            margin: 10% auto;
            width: 100%;
            height: 60%;
            background-color: #1f74cc;
            border-radius: 20px;
            font-size: 20px;
            color: white;
            border: none;
            transition-duration: 0.4s;
            font-family: "Montserrat", sans-serif;
        }
        button:hover {
            height: 61%;
            width: auto + 1%;
            color:#1f74cc;
            background-color: white;
        }

        .footer {
            width: 40%;
            height: 3%;
            background-color: black;
            border-radius: 50px;
            display: flex;
            justify-content: center;
            align-items: center;
            margin: auto;
            color: white;
            font-family: 'Montserrat', sans-serif;
        }
         /* Laptop support */
         @media screen and (max-width: 1825px) {
            .profile {
                width: 35%;
                height: 40%;
            }
            .footer {
                height: 5%;
            }
            .flex-container {
                height: 94%;
            }
        }
        /* Mobile support */
        @media screen and (max-width: 426px) {
            .profile {
                width: 70%;
                height: 45%;
            }
            .profile > form > label {
                width: 80%;
            }

            .footer {
                width: 100%;
                font-size: 12px;
            }
            td, th {
                font-size: 9.5px;
            }
            img {
                width: 25px;
            }

        }
    </style>
    <div class="flex-container">
        <div class="profile">
            <h1><%= cloudname %></h1>
            <h2><%= lang["My-Profile"] %></h2>
            <% let hashedemail = md5(user.email) %>
            <% let gravatar = `https://www.gravatar.com/avatar/${hashedemail}` %>
            <% let isVerified; %>
            <% if (user.isVerified) { %>
            <% isVerified = lang["Yes"] %>
            <% } else { %>
            <% isVerified = lang["No"] %>
            <% } %>
            <table>
                <tbody>
                <tr>
                    <td><%= lang["Profile-Picture"] %></td>
                    <td><img src=<%= gravatar %>></td>
                </tr>
                <tr>
                    <td><%= lang["Username2"] %></td>
                    <td><%= user.username %></td>
                </tr>
                <tr>
                    <td><%= lang["Email2"] %></td>
                    <td><%= user.email %></td>
                </tr>
                <tr>
                    <td><%= lang["Is-Verified"] %></td>
                    <td><%= isVerified %></td>
                </tr>
                <tr>
                    <td><%= lang["Role"] %></td>
                    <td><%= user.role %></td>
                </tr>
                <tr>
                    <td><%= lang["Actions"] %></td>
                    <td><a href="/editmyaccount"><i class="fa-solid fa-pen-to-square"></i></a>&nbsp;<a href="/delmyaccount"><i class="fa-solid fa-trash"></i></a></td>
                </tr>           
                </tbody>
            </table>
        </div>
        <form action="/">
            <button type="submit"><i class="fa-solid fa-arrow-left-long"></i>&nbsp;<%= lang["Back"] %></button>
          </form>
    </div>
    <div class="footer">
        <p><%= cloudname %> ©️ 2022 - 2023 | Developed by <a href="https://github.com/DaneeSkripter">DaneeSkripter</a></p>
    </div>
</body>
</html>