{% extends 'layouts/base.html' %}

{% block title %} {{cloudName}} {% endblock title %}

{% block stylesheets %}
<style>
    body {
        font-family: Arial, sans-serif;
        background-color: #f2f2f2;
        margin: 0;
        padding: 0;
    }

    .container {
        max-width: 800px;
        margin: 0 auto;
        background-color: #fff;
        padding: 20px;
        border-radius: 5px;
        box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
        
    }

    h1 {
        text-align: center;
    }

    .note-input {
        width: 600px;
        padding: 10px;
        margin-right: 10px;
        border: 1px solid #ccc;
        border-radius: 5px;
    }

    .add-button {
        padding: 10px 20px;
        background-color: #007bff;
        color: #fff;
        border: none;
        border-radius: 5px;
        cursor: pointer;
    }

    .note-list {
        list-style-type: none;
        padding: 0;
    }

    .note-item {
        background-color: #ffffcc;
        padding: 10px;
        margin: 10px 0;
        border: 1px solid #ccc;
        border-radius: 5px;
        display: flex;
        flex-direction: column;
         /* Display content vertically */
    }

    .note-text {
        margin-bottom: 10px; /* Add spacing between text and meta info */
    }

    .note-meta {
        font-size: 12px;
        color: #666;
    }

    .delete-link {
        color: #ff0000;
        text-decoration: none;
        cursor: pointer;
    }

    .delete-link:hover {
        text-decoration: underline;
    }


    .sticky-containers {
            height: 100vh;
            width: 100%;
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
        }

        .sticky {
            position: relative;
            height: 280px;
            width: 220px;
            display: inline-block;
            margin: 10px;
            padding: 18px 10px 10px 10px;
            box-sizing: border-box;
            box-shadow: 6px 7px 12px -5px rgba(0, 0, 0, 0.75);
            font-size: 24px;
            background: #ffd31d;
            resize: both;
            overflow: scroll;
            animation: stickAnim .3s ease;
        }

        .sticky::-webkit-scrollbar {
            display: none;
        }

        .sticky:focus {
            outline: none;
        }

        .close {
            font-size: 26px;
            position: absolute;
            top: 0;
            right: 0;
            cursor: pointer;
            width: 18px;
        }

        .info {
            font-size: 12px;
            color: #666;
        }

        .author {
            font-weight: bold;
        }

        @keyframes stickAnim {
            0% {
                transform: scale(5);
            }

            100% {
                transform: scale(1);
            }
        }
</style>

{% endblock stylesheets %}

{% block content %}
<br>
<div class="container">
    <h1>Ops-center Notes</h1>
    <form action="/add_note" method="POST">
        <!-- <input type="text" name="note" placeholder="Add a new note" class="note-input"> -->
        <textarea name="note" placeholder="Add a New Note" class="note-input" role="textbox" aria-autocomplete="list" aria-haspopup="true"></textarea>
        <button type="submit" class="add-button">Add</button>
    </form>
</div>
<br>

<div class="sticky-containers">
    {% for note in notes %}
    <div class="sticky" role="textbox">
        <div class="info">
            <span class="author">Author: {{ note.author }}</span><br>
            Date: <span id="date">{{ note.time }}</span><br>
            Time: <span id="time">{{ note.date }}</span>
        </div>
        <div>{{ note.content }}</div>
        
        <a href="/delete_note/{{ note._id }}"><span class="close">x</span></a>
    </div>
    {% endfor %}
</div>

{% endblock content %}
{% block javascripts %}


{% endblock javascripts %}
