﻿:root
{
    --app-header-height: 60px;
    --app-footer-height: 72px;

    --card-background: #ffffff;
    --card-background-light: #f8fafc;
    --card-border: #d9e2ec;

    --primary-text: #1f2937;
    --secondary-text: #5D6369;

    --green: #16a34a;
    --green-bright: #22c55e;

    --blue: #2563eb;
    --blue-light: #60a5fa;

    --red: #dc2626;
}

*
{
    box-sizing: border-box;
}

html {
    margin: 0;
    min-height: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100dvh;
    overflow-x: hidden;
    background: linear-gradient( to bottom right, rgba(11, 61, 145, 0.15), rgba(21, 153, 87, 0.1) );
    color: var(--primary-text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ASP.NET Web Forms main form */
form {
    min-height: 100dvh;
}

/* Main page area */
.app-content {
    width: 100%;
    max-width: 1200px;
    min-height: calc( 100vh - var(--app-header-height) - var(--app-footer-height) );
    margin: 0 auto;
    padding: calc(var(--app-header-height) + 20px) 16px calc(var(--app-footer-height) + 24px);
}

/* For site login */
.login-content {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Top page header */
.app-header {
    position: fixed;
    right: 0;
    top: 0;
    left: 0;
    z-index: 1000;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: var(--app-header-height);
    padding: 0 16px;
    background:
    /* solid gradient line on bottom */
    linear-gradient( to right, rgba(11, 61, 145, 1), rgba(21, 153, 87, 1) ) bottom / 100% 2px no-repeat,
    /* Very light gradient background */
    linear-gradient( to right, rgba(11, 61, 145, 0.075), rgba(21, 153, 87, 0.045) ), rgba(255, 255, 255, 1);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.22);
}


    .app-header h1 {
        margin: 0px 0px 8px 0px;
        padding: 0;
        color: var(--primary-text);
        font-size: 18px;
        font-weight: 500;
        text-align: center;
        user-select: none;
    }

.header-spacer {
    justify-self: start;
}


.header-status {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    align-items: center;
    padding: 0px;
    margin: 0px;
}

.header-branding {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    padding-bottom: 0px;
    margin-bottom: 0px;
    gap: 4px;
    user-select: none;
}

    .header-branding p {
        font-size: 16px;
        font-weight: 800;
        margin-bottom: 0px;
        padding-bottom: 0px;
        user-select: none;
    }

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}


.logout-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background-color: rgba(220, 53, 69, 0.16);
    color: #dc3545;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

    .logout-button svg {
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .logout-button:hover {
        background-color: rgba(220, 53, 69, 0.25);
        color: #bb2d3b;
    }

    .logout-button:active {
        transform: scale(0.95);
    }

    .logout-button:focus-visible {
        outline: 2px solid #dc3545;
        outline-offset: 2px;
    }

/* Connection status */
.connection-status {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.3rem;
    padding: 6px 12px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.07em;
    user-select: none;
}

.connection-dot
{
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.connection-status.live
{
    color: #31d158;
    background-color: rgba(49, 209, 88, 1.0);
    border-color: rgba(32, 220, 118, 0.35);
}

    .connection-status.live .connection-dot {
        background-color: #31d158;
    }

.connection-status.simulation {
    color: #592904;
    background-color: #ffdf87;
    border-color: rgba(245, 158, 11, 0.35);
}

    .connection-status.simulation .connection-dot {
        background-color: #592904;
    }

.bottom-navigation {
    position: fixed;
    right: 0;
    bottom: -2px;
    left: 0;
    z-index: 1000;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: var(--app-footer-height);
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));

    background:
    /* 3px solid gradient line */
    linear-gradient( to right, rgba(11, 61, 145, 1), rgba(21, 153, 87, 1) ) top / 100% 3px no-repeat,
    /* Very light gradient background */
    linear-gradient( to right, rgba(11, 61, 145, 0.075), rgba(21, 153, 87, 0.045) ),
    /* Base card color */
    rgba(255, 255, 255, 1);

    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.28);
    overflow: hidden;
}

    /* Admin users have an additional navigation item. */
    .bottom-navigation.bottom-navigation-admin {
        grid-template-columns: repeat(5, 1fr);
    }


.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    padding: 4px;
    color: var(--secondary-text);
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    border-radius: 10px;
    transition: color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

    .bottom-nav-item:hover {
        color: var(--blue-light);
        text-decoration: none;
        background: rgba(67, 160, 255, 0.08);
    }

    .bottom-nav-item:active {
        transform: scale(0.97);
    }

    .bottom-nav-item.active {
        color: var(--blue-light);
        background: rgba(67, 160, 255, 0.1);
    }

.bottom-nav-icon {
    display: flex;
    width: 24px;
    height: 24px;
}

    .bottom-nav-icon svg {
        width: 100%;
        height: 100%;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

/* Desktop layout */
@media (min-width: 900px) {
    .bottom-navigation {
        right: auto;
        left: 50%;
        bottom: -2px;
        width: 75%; /* was min(900px, 100%) */
        transform: translateX(-50%);
        border-right: 1px solid var(--card-border);
        border-left: 1px solid var(--card-border);
    }
}