﻿/**
 * Author: Joseph Connelly - the realist, the illist
 * Date: March 25, 2025
 * Project: TypeScript Meeting WebApp
 * Backend: .NET 9 Web Application
 * Frontend: TypeScript 5.8.2, Symantic HTML 5, CSS 3
 * Tools: esbuild for bundle + minification
 */

:root {
    --precise-darkblue: #003865;
    --precise-blue: #003866;
    --precise-lightblue: #73B2E6;
    --precise-darkgreen: #67812B;
    --precise-green: #97D700;
    --precise-lightgreen: #96D600;
    --precise-deepgreen: #06402B;
    --precise-mediumdarkgrey: #7D7F7C;
    --precise-white: #FFFFFF;
    --default-font-size: 14px;
}

*,
::after,
::before {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

html {
  font-size: var(--default-font-size);
}

body {
    height: 100vh;
    height: 100svh;
    padding: 2em;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--precise-darkblue);
}

/* Prevent any content from showing until button event listeners and data are ready */
body.preload {
  visibility: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
}

.meeting-page {
    height: 100%;
    font-family: "Poppins", sans-serif;
    font-weight: 400;
    font-style: normal;
    text-shadow: 1px 1px 1px black;
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    align-items: center;
    gap: 2em;
}

.meeting-info {
    color: var(--precise-white);
    background: linear-gradient(to bottom, var(--precise-lightgreen), var(--precise-darkgreen));
    box-shadow: 0 7px 30px rgba(62, 9, 11, .3);
    border-radius: 10px;
    font-size: 0.75em;
    padding: 0.75rem 1.5rem 0.75rem;
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    align-items: center;
}

.meeting-board {
    color: var(--precise-white);
    background: linear-gradient(to bottom, var(--precise-lightblue), var(--precise-blue));
    box-shadow: 0 7px 30px rgba(62, 9, 11, .3);
    border-radius: 10px;
    padding: 2em 3em 1em;
}

.meeting-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.meeting-header {
    font-size: 1.75em;
}

.meeting-date {
    font-size: 0.75em;
    white-space: nowrap;
}

.meeting-icon {
    top: 3px;
    width: 1.5em;
    height: 1.5em;
    position: relative;
    vertical-align: baseline;
}

.pin {
    fill: var(--precise-green);
    filter: url("#dropShadow");
}

.meeting-list ul {
    padding: 0.5em 0em 0.5em;
    position: relative;
}

.meeting-board ul li {
    list-style: none;
    font-size: 1.15em;
    margin: 0.1em;
}

.meeting-board ul li.meeting-participant {
    width: 100%;
    min-height: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75em;
    border-radius: 999px;
    cursor: pointer;
    transition: opacity 180ms ease, background-color 180ms ease;
    padding-right: 0.5rem;
}

body.edit-mode-enabled .meeting-board ul li.meeting-participant {
    cursor: grab;
}

body.edit-mode-enabled .meeting-board ul li.meeting-participant.is-editing {
    cursor: default;
}

body.edit-mode-enabled .meeting-board ul li.meeting-participant.is-dragging {
    opacity: 0.55;
    transform: scale(0.985);
    background: rgba(255, 255, 255, 0.14);
}

.meeting-board ul li.meeting-participant:hover {
    background: rgba(255, 255, 255, 0.08);
}

.meeting-board ul li.meeting-participant:focus-visible {
    outline: 2px solid var(--precise-white);
    outline-offset: 3px;
}

.meeting-board ul li span {
    font-size: 1em;
    font-weight: 500;
    transform: translateY(-2px);
    background: var(--precise-green);
    color: var(--precise-white);
    text-align: center;
    display: inline-block;
    border-radius: 50%;
    margin-right: 0.75em;
    width: 1.5em;
    height: 1.5em;
    line-height: 1.6em;
}

.meeting-board ul li .meeting-participant-number {
    flex: 0 0 1.5em;
    margin-right: 0.05em;
}

.meeting-board ul li .meeting-participant-number.is-crossed-out {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 1.5em;
    height: 1.5em;
    font-size: 1em;
    font-weight: 700;
    line-height: 1.6em;
    transform: translateY(-2px);
}

.meeting-board ul li .meeting-participant-name {
    position: relative;
    display: block;
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: none;
    background: none;
    color: inherit;
    margin-right: auto;
    text-align: left;
    width: 100%;
    height: auto;
    line-height: inherit;
    border-radius: 0;
}

.meeting-participant-edit {
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 999px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.18);
    color: var(--precise-white);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateX(6px);
    transition: opacity 180ms ease, transform 180ms ease, background-color 180ms ease;
}

body.edit-mode-enabled .meeting-participant:hover .meeting-participant-edit,
body.edit-mode-enabled .meeting-participant:focus-within .meeting-participant-edit,
body.edit-mode-enabled .meeting-participant.is-editing .meeting-participant-edit {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.meeting-participant-edit:hover,
.meeting-participant-edit:focus-visible {
    background: var(--precise-green);
    outline: none;
}

.meeting-participant-input {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    height: 2rem;
    font: inherit;
    line-height: 1.2;
    color: var(--precise-white);
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    padding: 0 0.75rem;
    margin: 0;
    text-shadow: inherit;
    user-select: text;
    -webkit-user-select: text;
}

.meeting-participant.is-editing .meeting-participant-name {
    display: none;
}

.meeting-board ul li .meeting-participant-name::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transform: translateY(-50%);
    transition: width 220ms ease;
}

.meeting-board ul li.meeting-participant.is-selected .meeting-participant-number {
    background: var(--precise-deepgreen);
    color: var(--precise-mediumdarkgrey);
}

.meeting-board ul li.meeting-participant.is-selected .meeting-participant-name {
    color: var(--precise-mediumdarkgrey);
}

.meeting-board ul li.meeting-participant.is-selected .meeting-participant-name::after {
    width: 100%;
}

.meeting-button {
    font-family: "Poppins", sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 14px;
    color: black;
    text-shadow: 1px 1px 1px lightgrey;
    text-align: center;
    text-decoration: none;

    background-color: lightgray;
    border: none;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin: 10px;
    padding: 10px 14px;
    cursor: pointer;
    white-space: nowrap;
}

.meeting-button-toggle {
    background-color: var(--precise-mediumdarkgrey);
    color: var(--precise-white);
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
    width: 6.5rem;
    flex: 0 0 6.5rem;
    padding: 0.65rem 0.9rem;
}

.meeting-button-toggle:hover {
    background-color: #5f625f;
}

.meeting-button-toggle:focus,
.meeting-button-toggle:active {
    background-color: var(--precise-mediumdarkgrey);
    color: var(--precise-white);
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

.meeting-button-toggle.is-active,
.meeting-button-toggle.is-active:hover,
.meeting-button-toggle.is-active:focus,
.meeting-button-toggle.is-active:active {
    background-color: var(--precise-green);
    color: var(--precise-white);
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.35);
}

.meeting-button:hover {
    background-color: gray;
    text-shadow: none;
}

.meeting-button:not(.meeting-button-toggle):active {
    background-color: var(--precise-green);
}

.meeting-button:not(.meeting-button-toggle):focus {
    background-color: var(--precise-green);
}

.share-info {
    margin-left: 0;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}