<template>
    <section v-if="!addBool" :class="['information', darkMode ? 'section-darkmode' : 'section-lightmode']">
        <h2 v-if="!editable" :class="['production-orders-instance-name', darkMode ? 'h2-darkmode' : 'h2-lightmode']">{{
        poi.name }}</h2>
        <input v-if="editable" v-model="poi.name" @change="updatePOI()"
            :class="['data', 'poi-name-input', darkMode ? 'h2-darkmode' : 'h2-lightmode', darkMode ? 'h2-input-darkmode' : 'h2-input-lightmode', 'input']">
        <div class="production-orders-instance-data">
            <div class="instanceInfo">
                <div class="data-field" id="info">
                    <div class="templateId-customer" id="templateID">
                        <pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Template ID:</pre>
                        <pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ poi.templateID }}</pre>
                    </div>
                    <div class="templateId-customer" id="customer">
                        <pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Customer:</pre>
                        <pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']"> {{ poi.customer }}</pre>
                    </div>
                </div>
            </div>
        </div>
        <div class="production-orders-instance-data">
            <div class="additional">
                <div class="templateDescription">
                    <h3 :class="['area-title', darkMode ? 'h3-darkmode' : 'h3-lightmode']">Template description:</h3>
                    <input v-model="poi.templateDescription" :readonly="!editable" @change="updatePOI()"
                        :class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']"
                        id="templateDescription">
                </div>
            </div>
            <div class="additional">
                <div class="templateNotes">
                    <h3 :class="['area-title', darkMode ? 'h3-darkmode' : 'h3-lightmode']">Template notes:</h3>
                    <input v-model="poi.templateNotes" :readonly="!editable" @change="updatePOI()"
                        :class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']" id="templateNotes">
                </div>
            </div>
        </div>
        <div class="production-orders-instance-data">
            <div class="instanceInfo">
                <div class="data-field-four" id="infoFour">
                    <div class="ticketNo-asset-state-user" id="ticketNo">
                        <pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Ticket No.:</pre>
                        <pre
                            :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ poi.ticketNumber }}</pre>
                    </div>
                    <div class="ticketNo-asset-state-user" id="asset">
                        <pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Asset:</pre>
                        <pre v-if="!editable"
                            :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']"> {{ poi.asset }}</pre>
                        <select v-if="editable" id="assetsDropDownChosenCI" v-model="poi.asset" @change="updatePOI()"
                            :class="[darkMode ? 'select-darkmode' : 'select-lightmode']">
                            <option v-for="asset in assets" :key="asset.primaryID">
                                {{ asset.assetName }}
                            </option>
                        </select>
                    </div>
                    <div class="ticketNo-asset-state-user" id="state">
                        <pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">State:</pre>
                        <pre v-if="!editable"
                            :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ poi.state }}</pre>
                        <input v-if="editable" v-model="poi.state" @change="updatePOI()"
                            :class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
                    </div>
                    <div class="ticketNo-asset-state-user" id="user">
                        <pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">User:</pre>
                        <pre v-if="!editable"
                            :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ poi.user }}</pre>
                        <select v-if="editable" id="assetsDropDownChosenCI" v-model="poi.user" @change="updatePOI()"
                            :class="[darkMode ? 'select-darkmode' : 'select-lightmode']">
                            <option v-for="user in userList" :key="user.id">
                                {{ user.username }}
                            </option>
                        </select>
                    </div>
                </div>
                <div class="data-field" id="info">
                    <div class="creationDate-completionDate-timeSpent" id="creationDate">
                        <pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Creation date:</pre>
                        <pre
                            :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ poi.creationDate }}</pre>
                    </div>
                    <div class="creationDate-completionDate-timeSpent" id="completionDate">
                        <pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Completion date:</pre>
                        <pre v-if="!editable"
                            :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ poi.completionDate }}</pre>
                        <input v-if="editable" v-model="poi.completionDate" @change="updatePOI()"
                            :class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
                    </div>
                    <div class="creationDate-completionDate-timeSpent" id="timeSpent">
                        <pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Time spent:</pre>
                        <pre v-if="!editable"
                            :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ poi.timeSpent }}</pre>
                        <input v-if="editable" v-model="poi.timeSpent" @change="updatePOI()"
                            :class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
                    </div>
                </div>
            </div>
        </div>
        <div class="production-orders-instance-data">
            <div class="additional">
                <div class="notes">
                    <h3 :class="['area-title', darkMode ? 'h3-darkmode' : 'h3-lightmode']">Notes:</h3>
                    <input v-model="poi.notes" :readonly="!editable" @change="updatePOI()"
                        :class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']" id="notes">
                </div>
            </div>
        </div>
    </section>
    <section v-if="addBool" :class="['information', darkMode ? 'section-darkmode' : 'section-lightmode']">
        <input v-model="newName" @change="updateProductionOrderInstance()"
            :class="['data', 'poi-name-input', darkMode ? 'h2-darkmode' : 'h2-lightmode', darkMode ? 'h2-input-darkmode' : 'h2-input-lightmode', 'input']">
        <div class="production-orders-instance-data">
            <div class="instanceInfo">
                <div class="data-field" id="info">
                    <div class="templateId-customer" id="templateID">
                        <pre v-if="potSelected"
                            :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Template ID:</pre>
                        <pre v-if="!potSelected"
                            :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Template name:</pre>
                        <pre v-if="potSelected"
                            :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ chosenPOTId }}</pre>
                        <select v-if="!potSelected" id="assetsDropDownChosenCI" v-model="chosenTemplate"
                            @change="updateProductionOrderInstance(chosenTemplate)"
                            :class="[darkMode ? 'select-darkmode' : 'select-lightmode']">
                            <option v-for="template in productionOrderTemplates" :key="template.templateID">
                                {{ template.name }}
                            </option>
                        </select>
                    </div>
                    <div class="templateId-customer" id="customer">
                        <pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Customer:</pre>
                        <pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']"> {{ poi.customer }}</pre>
                    </div>
                </div>
            </div>
        </div>
        <div class="production-orders-instance-data">
            <div class="additional">
                <div class="templateDescription">
                    <h3 :class="['area-title', darkMode ? 'h3-darkmode' : 'h3-lightmode']">Template description:</h3>
                    <input v-model="newTemplateDescription" @change="updateProductionOrderInstance()"
                        :class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']"
                        id="templateDescription">
                </div>
            </div>
            <div class="additional">
                <div class="templateNotes">
                    <h3 :class="['area-title', darkMode ? 'h3-darkmode' : 'h3-lightmode']">Template notes:</h3>
                    <input v-model="newTemplateNotes" @change="updateProductionOrderInstance()"
                        :class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']" id="templateNotes">
                </div>
            </div>
        </div>
        <div class="production-orders-instance-data">
            <div class="instanceInfo">
                <div class="data-field-four" id="infoFour">
                    <div class="ticketNo-asset-state-user" id="ticketNo">
                        <pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Ticket No.:</pre>
                        <pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
                    </div>
                    <div class="ticketNo-asset-state-user" id="asset">
                        <pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Asset:</pre>
                        <select id="assetsDropDownChosenCI" v-model="newAsset" @change="updateProductionOrderInstance()"
                            :class="[darkMode ? 'select-darkmode' : 'select-lightmode']">
                            <option v-for="asset in assets" :key="asset.primaryID">
                                {{ asset.assetName }}
                            </option>
                        </select>
                    </div>
                    <div class="ticketNo-asset-state-user" id="state">
                        <pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">State:</pre>
                        <input v-model="newState" @change="updateProductionOrderInstance()"
                            :class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
                    </div>
                    <div class="ticketNo-asset-state-user" id="user">
                        <pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">User:</pre>
                        <select id="assetsDropDownChosenCI" v-model="newUser" @change="updateProductionOrderInstance()"
                            :class="[darkMode ? 'select-darkmode' : 'select-lightmode']">
                            <option v-for="user in userList" :key="user.id">
                                {{ user.username }}
                            </option>
                        </select>
                    </div>
                </div>
                <div class="data-field" id="info">
                    <div class="creationDate-completionDate-timeSpent" id="creationDate">
                        <pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Creation date:</pre>
                        <pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
                    </div>
                    <div class="creationDate-completionDate-timeSpent" id="completionDate">
                        <pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Completion date:</pre>
                        <pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
                    </div>
                    <div class="creationDate-completionDate-timeSpent" id="timeSpent">
                        <pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Time spent:</pre>
                        <pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
                    </div>
                </div>
            </div>
        </div>
        <div class="production-orders-instance-data">
            <div class="additional">
                <div class="notes">
                    <h3 :class="['area-title', darkMode ? 'h3-darkmode' : 'h3-lightmode']">Notes:</h3>
                    <input v-model="newNotes" @change="updateProductionOrderInstance()"
                        :class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']" id="notes">
                </div>
            </div>
        </div>
    </section>
</template>


<script setup>
import { ref, onMounted, watch } from 'vue';
import { useStore } from 'vuex';
import { computed } from 'vue';
import Axios from '../axios.config.js';
import clientsideConfig from '../../clientsideConfig.js';

const store = useStore();
const modeChanged = computed(() => store.state.updateDarkMode);

const editable = computed(() => store.state.editable);
const chosenPOIId = computed(() => store.state.chosenPOIId);
const chosenPOTId = computed(() => store.state.chosenPOTId);
const deleteBool = computed(() => store.state.deleteBool);
const addBool = computed(() => store.state.new);

const darkMode = ref('');
const potSelected = ref('');

const poi = ref({});
const pot = ref({});
const customers = ref([]);
const assets = ref([]);

const newName = ref('');
const newTemplateID = ref('');
const chosenTemplate = ref('');
const newCustomerID = ref('');
const newCustomer = ref('');
const newUser = ref('');
const newState = ref('');
const newNotes = ref('');
const newTemplateDescription = ref('');
const newTemplateNotes = ref('');
const newAsset = ref('');
const newCreationDate = ref('');
const newCompletionDate = ref('');
const newTimeSpent = ref('');
const productionOrderInstances = ref([]);
const productionOrderTemplates = ref([]);
const userList = ref([]);

//get all customers
const getCustomers = async () => {
    try {
        const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getAllCustomers`
        );
        customers.value = response.data;
    } catch (err) {
        console.log(err.response.statusText);
    }
}

//get all productionOrder templates
const getProductionOrderTemplates = async () => {
    try {
        const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getAllProductionOrderTemplates`);
        productionOrderTemplates.value = response.data;
    } catch (err) {
        console.log(err.response.statusText);
    }
}

// get production order template from id
const getPOTById = async () => {
    if (chosenPOTId.value == '-1') {
        potSelected.value = false;
        await getProductionOrderTemplates();
    } else {
        potSelected.value = true;
        try {
            const response = await Axios.get(
                `https://${clientsideConfig.url}:${clientsideConfig.port}/api/getProductionOrderTemplate/${chosenPOTId.value}`
            );
            pot.value = response.data;
            poi.value.customer = pot.value.customer;
            poi.value.customerID = pot.value.customerID;
            newCustomer.value = pot.value.customer;
            newCustomerID.value = pot.value.customerID;
            await getConfigItemsFromCustomer();
        } catch (err) {
            console.log(err.response.statusText);
        }
    }
    await getProductionOrderInstances();
}

// get production order template from id
const getChosenPOTById = async (newPotId) => {
    try {
        const response = await Axios.get(
            `https://${clientsideConfig.url}:${clientsideConfig.port}/api/getProductionOrderTemplate/${newPotId}`
        );
        pot.value = response.data;
        poi.value.customer = pot.value.customer;
        poi.value.customerID = pot.value.customerID;
        newCustomer.value = pot.value.customer;
        newCustomerID.value = pot.value.customerID;
        await getConfigItemsFromCustomer();
    } catch (err) {
        console.log(err.response.statusText);
    }
}

const confirmDeletePOI = async () => {
    if (deleteBool.value === true) {
        if (confirm("Do you really want to delete this production order instance? It cannot be undone!")) {
            try {
                await Axios.delete(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/deleteProductionOrderInstance/${chosenPOIId.value}`);
            } catch (err) {
                console.log(err.response.statusText);
            }
            try {
                await Axios.delete(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/deleteTodosPOI/${chosenPOIId.value}`);
            } catch (err) {
                console.log(err.response.statusText);
            }
            store.commit('undoDelete');
            store.commit('resetStore');
            store.commit('changeToInstancelist');
            store.commit('seeAllIcon');
        } else {
            store.commit('undoDelete');
        }
    }
}

//get all users
const getUsers = async () => {
    try {
        const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getAllEmployees`);
        userList.value = response.data;
    } catch (err) {
        console.log(err.response.statusText);
    }
}

//update data
const updatePOI = async () => {
    if (poi.value.name.trim() === "") {
        alert("Please add a production order instance name!");
        return;
    } else {
        var counter = 0;
        // check if production order instance name already exists
        productionOrderInstances.value.forEach(p => {
            if (p.name === poi.value.name) {
                counter += 1;
            }
        });
        if (counter == 2) {
            alert("This production order instance name already exists. Please choose an unique production order instance name or modify respectively delete the old one!");
            poi.value.name = '';
            return;
        }
        try {
            await Axios.put(
                `https://${clientsideConfig.url}:${clientsideConfig.port}/api/updateProductionOrderInstance`,
                {
                    ticketNumber: poi.value.ticketNumber,
                    name: poi.value.name,
                    templateID: poi.value.templateID,
                    customerID: poi.value.customerID,
                    customer: poi.value.customer,
                    asset: poi.value.asset,
                    state: poi.value.state,
                    creationDate: poi.value.creationDate,
                    completionDate: poi.value.completionDate,
                    user: poi.value.user,
                    templateDescription: poi.value.templateDescription,
                    templateNotes: poi.value.templateNotes,
                    timeSpent: poi.value.timeSpent,
                    notes: poi.value.notes,
                }
            )
            await getPOIById();
        } catch (err) {
            console.log(err.response.statusText);
        }
    }
}

//get all productionOrder instances
const getProductionOrderInstances = async () => {
    try {
        const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getAllProductionOrderInstances`);
        productionOrderInstances.value = response.data;
    } catch (err) {
        console.log(err.response.statusText);
    }
}

// update production order instance fields in the store
const updateProductionOrderInstance = async (newPotId = -1) => {
    let productionOrderInstance = {};
    if (potSelected.value) {
        productionOrderInstance = {
            name: newName.value,
            templateID: chosenPOTId.value,
            customerID: newCustomerID.value,
            customer: newCustomer.value,
            asset: newAsset.value,
            state: newState.value,
            creationDate: newCreationDate.value,
            completionDate: newCompletionDate.value,
            user: newUser.value,
            templateDescription: newTemplateDescription.value,
            templateNotes: newTemplateNotes.value,
            timeSpent: newTimeSpent.value,
            notes: newNotes.value,
        };
    } else {
        if (!(newPotId == '-1')) {
            // Find the object with the selected Name
            const selectedObject = productionOrderTemplates.value.find(obj => obj.name === newPotId);
            // Get the templateID
            newTemplateID.value = selectedObject ? selectedObject.templateID : null;
            await getChosenPOTById(newTemplateID.value);
        }
        productionOrderInstance = {
            name: newName.value,
            templateID: newTemplateID.value,
            customerID: newCustomerID.value,
            customer: newCustomer.value,
            asset: newAsset.value,
            state: newState.value,
            creationDate: newCreationDate.value,
            completionDate: newCompletionDate.value,
            user: newUser.value,
            templateDescription: newTemplateDescription.value,
            templateNotes: newTemplateNotes.value,
            timeSpent: newTimeSpent.value,
            notes: newNotes.value,
        };
    }
    store.commit('updateProductionOrderInstanceComponent', productionOrderInstance);
}

// get production order instance from id
const getPOIById = async () => {
    if (!addBool.value) {
        try {
            const response = await Axios.get(
                `https://${clientsideConfig.url}:${clientsideConfig.port}/api/getProductionOrderInstance/${chosenPOIId.value}`
            );
            poi.value = response.data;
        } catch (err) {
            console.log(err.response.statusText);
        }
    }
}

// include delay to avoid 503 error
const triggerBackendCallsWithDelay = async (fetchDataFunc) => {
    setTimeout(() => {
        fetchDataFunc();
    }, 1500);
}

const getSession = async () => {
    const loggedInUserDarkModeBool = getItem('logged-in-user-darkMode');
    if (loggedInUserDarkModeBool == 1) {
        darkMode.value = true;
    } else {
        darkMode.value = false;
    }
}

//get all config items from the selected customer
const getConfigItemsFromCustomer = async () => {
    if (!addBool.value) {
        try {
            const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCIFromCustomer/${poi.value.customerID}`);
            assets.value = response.data;
        } catch (err) {
            console.log(err.response.statusText);
        }
    } else if (!(newCustomerID.value == '')) {
        try {
            const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCIFromCustomer/${newCustomerID.value}`);
            assets.value = response.data;
        } catch (err) {
            console.log(err.response.statusText);
        }
    }
}

function getItem(item) {
    if (process.client) {
        return localStorage.getItem(item)
    } else {
        return undefined
    }
}

watch(modeChanged, getSession);
watch(deleteBool, confirmDeletePOI);
watch(editable, getConfigItemsFromCustomer);

onMounted(async () => {
    getSession();
    await getPOIById();
    await getPOTById();
    triggerBackendCallsWithDelay(getCustomers);
    triggerBackendCallsWithDelay(getUsers);
});
</script>

<script>
export default {
    name: "ProductionOrdersInstance",
};
</script>


<style scoped>
.information {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    padding: 1.25rem 1.875rem;
    border-radius: 0.625rem;
    box-shadow: 0.25rem 0.25rem 0.25rem 0rem rgba(0, 0, 0, 0.25);
}

.data {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 0 0.625rem;
    border-radius: 0.3125rem;
    box-shadow: 0.0625rem 0.0625rem 0.25rem 0rem rgba(0, 0, 0, 0.25) inset;
    letter-spacing: 5%;
    font: 400 0.75rem/250% Overpass, sans-serif;
}

.section-darkmode {
    background-color: #2c2c2c;
}

.section-lightmode {
    background-color: #fff;
}

.h2-input-darkmode {
    background-color: #212121;
}

.h2-input-lightmode {
    background-color: #EBEBEB;
}

.production-orders-instance-name {
    align-self: stretch;
    padding: 1rem 0;
    letter-spacing: 5%;
    text-decoration-line: underline;
    font: italic 400 1rem/187.5% Overpass, -apple-system, Roboto, Helvetica,
        sans-serif;
}

.h2-darkmode {
    color: #fff;
}

.h2-lightmode {
    color: #000;
}

.data-darkmode {
    background-color: #212121;
    color: #fff;
}

.data-lightmode {
    background-color: #EBEBEB;
    color: #000;
}

.data-field {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: 95%;
    padding: 0.8rem 1.875rem;
    gap: 1.25rem;
    border-radius: 0.625rem;
}

.data-field-four {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: 98.5%;
    gap: 1.25rem;
    border-radius: 0.625rem;
}

.ticketNo-asset-state-user {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding-left: 1.875rem;
    padding-right: 1.875rem;
    gap: 1.25rem;
    border-radius: 0.625rem;
}

.creationDate-completionDate-timeSpent,
.templateId-customer {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 0 0rem;
    gap: 1.25rem;
    border-radius: 0.625rem;
}

.label {
    letter-spacing: 5%;
    font: 400 0.875rem/1.875rem Overpass, sans-serif;
}

.pre-darkmode {
    color: #fff;
}

.pre-lightmode {
    color: #000;
}

.data-darkmode {
    background-color: #212121;
    color: #fff;
}

.data-lightmode {
    background-color: #EBEBEB;
    color: #000;
}

.production-orders-instance-data {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    align-self: stretch;
}

.instanceInfo,
.info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    line-height: normal;
    width: 100%;
    padding: 0 0;
    border-radius: 0.3125rem;
}

.infoFour {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    line-height: normal;
    width: 98.5%;
    padding: 0 0;
    border-radius: 0.3125rem;
}

.h2-darkmode {
    color: #fff;
}

.h2-lightmode {
    color: #000;
}

.input {
    border: none;
}

.poi-name-input {
    /* padding: 1rem 0; */
    margin: 1rem;
    font-size: initial;
    letter-spacing: 5%;
    text-decoration-line: underline;
    font: italic 400 1rem/187.5% Overpass, -apple-system, Roboto, Helvetica,
        sans-serif;
}

.additional {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    line-height: normal;
    width: 100%;
    padding: 0rem 0.625rem;
    border-radius: 0.3125rem;
}

div#customer {
    padding-left: 4.4em;
}

.area-title {
    letter-spacing: 5%;
    font: 400 0.875rem/1.875rem Overpass, sans-serif;
}

.h3-darkmode {
    color: #fff;
}

.h3-lightmode {
    color: #000;
}

.data#templateDescription,

.data#templateNotes,
.data#notes {
    align-self: stretch;
}

.templateDescription,
.templateNotes,
.notes {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    align-self: stretch;
    padding: 0.625rem 1.875rem 0.625rem 1.25rem;
    padding-top: 0rem;
}

.select-lightmode {
    border: none;
    color: black;
    background: #EBEBEB;
    padding: 0.4rem;
    border-radius: 0.3125rem;
}

.select-darkmode {
    border: none;
    color: white;
    background: #212121;
    padding: 0.4rem;
    border-radius: 0.3125rem;
}
</style>