﻿﻿.absolute-center {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.link-unstyled, .link-unstyled:link, .link-unstyled:hover {
    color: inherit;
    text-decoration: inherit;
}

html, body {
    font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

/* Mobile-first: hide desktop nav, show mobile nav */
.desktop-nav {
    display: none;
}

.mobile-nav {
    display: block;
}

/* Desktop (≥768px): show desktop nav, hide mobile nav and menu panel */
@media (min-width: 768px) {
    .desktop-nav {
        display: flex !important;
    }

    .mobile-nav,
    .mobile-menu-panel {
        display: none !important;
    }
}

/* Authenticated layout: mobile-first — bottom nav visible, sidebar hidden */
.app-sidebar {
    display: none;
}

.app-main {
    /*padding-left: 1rem;*/
    /*padding-bottom: 72px;*/
}

.app-bottom-nav-shell {
    position: relative;
    z-index: 50;
    flex-shrink: 0;
    border-top: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.08);
    padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
}

.app-bottom-nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.25rem;
    max-width: 40rem;
    margin: 0 auto;
}

.app-bottom-nav__item {
    display: inline-flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    min-width: 0;
    height: 3rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: background-color 150ms, box-shadow 150ms, color 150ms;
    -webkit-tap-highlight-color: transparent;
}

.app-bottom-nav__item:hover {
    background: #f9fafb;
    color: #374151;
}

.app-bottom-nav__item--active {
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.app-bottom-nav__label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-bottom-nav__more {
    display: none;
}

.app-bottom-nav__overflow {
    position: absolute;
    right: 0.75rem;
    bottom: calc(100% + 0.5rem);
    left: 0.75rem;
    z-index: 60;
    display: none;
    gap: 0.25rem;
    max-width: 24rem;
    margin: 0 auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
    padding: 0.35rem;
}

.app-bottom-nav__overflow-item {
    display: none;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.5rem;
    border-radius: 0.45rem;
    color: #374151;
    font-size: 0.8125rem;
    font-weight: 650;
    padding: 0.45rem 0.6rem;
    text-decoration: none;
}

.app-bottom-nav__overflow-item:hover,
.app-bottom-nav__overflow-item--active {
    background: #eff6ff;
    color: #1d4ed8;
}

@media (max-width: 430px) {
    .app-bottom-nav__more {
        display: inline-flex;
    }

    .app-bottom-nav__settings {
        display: none;
    }

    .app-bottom-nav__overflow {
        display: grid;
    }

    .app-bottom-nav__overflow-settings {
        display: flex;
    }

    .app-bottom-nav__item[data-overflow-rank="1"] {
        display: none;
    }

    .app-bottom-nav__overflow-item[data-overflow-rank="1"] {
        display: flex;
    }
}

@media (max-width: 360px) {
    .app-bottom-nav__item[data-overflow-rank="2"] {
        display: none;
    }

    .app-bottom-nav__overflow-item[data-overflow-rank="2"] {
        display: flex;
    }

    .app-bottom-nav__label {
        display: none;
    }

    .app-bottom-nav__item {
        height: 2.75rem;
    }
}

@media (max-width: 320px) {
    .app-bottom-nav__item[data-overflow-rank="3"] {
        display: none;
    }

    .app-bottom-nav__overflow-item[data-overflow-rank="3"] {
        display: flex;
    }
}

/* Desktop (≥768px): sidebar visible, bottom nav hidden */
@media (min-width: 768px) {
    .app-sidebar {
        display: block !important;
    }

    .app-bottom-nav-shell {
        display: none !important;
    }

    .app-main {
        margin-left: 56px;
        /*padding-bottom: 1rem;*/
    }
}

/* Hide native browser password reveal buttons (Edge, Chrome) */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* Reconnect modal — classes toggled by blazor.web.js */
#components-reconnect-modal {
    display: none;
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

#components-reconnect-modal .reconnect-show,
#components-reconnect-modal .reconnect-failed,
#components-reconnect-modal .reconnect-rejected {
    display: none;
}

#components-reconnect-modal.components-reconnect-show .reconnect-show,
#components-reconnect-modal.components-reconnect-failed .reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected .reconnect-rejected {
    display: flex;
}

.reconnect-card {
    background: white;
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 20rem;
    text-align: center;
    font-size: 0.875rem;
    color: #374151;
}

.reconnect-btn {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 0.375rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.reconnect-btn:hover {
    background: #1d4ed8;
}

.reconnect-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: reconnect-spin 0.8s linear infinite;
}

@keyframes reconnect-spin {
    to { transform: rotate(360deg); }
}
