/* ===== GenericApp Site Styles ===== */
/* Minimal, non-intrusive styles that work with MudBlazor defaults */

:root {
    --custom-card-header-bg: #f4f4f4;
    --custom-element-bg: #dfdfdf;
    --bs-border-radius: 0.375rem;
    --bs-border-color: #dee2e6;
}

/* ===== Font Size Scaling for Full HD Screens ===== */
@media screen and (max-width: 1920px) and (max-height: 1080px) {
    :root {
        font-size: 13px;
    }
}

/* ===== Title Styling ===== */
/* The page title. The theme's text colour, not a primary-to-secondary gradient: each company sets
   its own palette, and in dark mode Inersel's primary and secondary (#0f4b71, #111d28) sit on a
   #1a1a27 background, so the gradient title all but disappeared (Luis, 22/10/2026). */
.titulo-inter {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.03em;
    color: var(--mud-palette-text-primary);
}

/* ===== Card Header Themed ===== */
.card-header-themed {
    background-color: var(--custom-card-header-bg);
    border-bottom: 1px solid #e0e0e0;
}

.mud-card-header.card-header-themed.py-1 {
    background-color: #dae5e5;
    /* The theme's text colour, as Link2IT and AsNet: neutral, where the secondary colour put the
       company blue on every card (Luis, 23/10/2026). */
    color: var(--mud-palette-text-primary);
}

/* The strip stays light in dark mode, where the theme's text colour is a light grey: keep the text
   dark there. MainLayout sets theme-dark on the layout. */
.theme-dark .mud-card-header.card-header-themed.py-1 {
    color: #424242;
}

/* ===== Expanded Row Themed Background ===== */
.custom-element-themed {
    background-color: var(--custom-element-bg, #dfdfdf) !important;
}

/* ===== Custom Shadow for Cards/Tables ===== */
.custom-shadow {
    box-shadow: 4px 4px 6px rgba(0, 0, 0, 0.15), -2px -2px 6px rgba(0, 0, 0, 0.1), 4px 4px 6px rgba(var(--mud-palette-primary-rgb), 0.4), 2px 2px 6px rgba(var(--mud-palette-primary-rgb), 0.25), 0 0 20px rgba(0, 0, 0, 0.08) !important;
    border-radius: 4px;
}

/* ===== Tab Slider uses Secondary Color (user-customizable) ===== */
.mud-tab-slider {
    position: absolute;
    background: var(--mud-palette-secondary);
}

/* ===== Left-aligned Tabs ===== */
.tabs-left-align .mud-tab {
    justify-content: flex-start !important;
    text-align: left !important;
}

    /* Active tab text uses secondary color */
    .tabs-left-align .mud-tab.mud-tab-active {
        color: var(--mud-palette-secondary) !important;
    }

/* Secondary color for interactive text (links, buttons) */
.text-secondary {
    color: var(--mud-palette-secondary) !important;
}


/* ===== Mobile Visibility ===== */
@media (max-width: 500px) {
    .hide-on-mobile {
        display: none !important;
    }

    .show-on-mobile {
        display: block !important;
    }
}

@media (min-width: 501px) {
    .hide-on-mobile {
        display: block !important;
    }

    .show-on-mobile {
        display: none !important;
    }
}

/* ===== MudBreadcrumbs Theme Styling ===== */
/* Auto-adapts to light/dark mode using MudBlazor CSS variables */
.mud-breadcrumbs-themed {
    padding: 0 !important;
}

    .mud-breadcrumbs-themed .mud-breadcrumb-item,
    .mud-breadcrumbs-themed .mud-breadcrumb-separator,
    .mud-breadcrumbs-themed a {
        color: var(--mud-palette-text-primary) !important;
        text-decoration: none;
    }

        .mud-breadcrumbs-themed a:hover {
            text-decoration: underline;
        }

    .mud-breadcrumbs-themed .mud-breadcrumb-separator {
        padding: 0px 4px;
    }

/* ===== Opt-in Border Classes ===== */
/* Use these when you specifically want themed borders */

.border-themed {
    border: 1px solid var(--mud-palette-secondary) !important;
    border-radius: 6px !important;
}

.border-primary {
    border: 1px solid var(--mud-palette-primary) !important;
}

.border-divider {
    border: 1px solid var(--mud-palette-lines-default) !important;
}

/* ===== Vertical Tabs Container (opt-in) ===== */
.vertical-tabs-container {
    display: flex;
}

    .vertical-tabs-container .mud-tabs-tabbar.mud-tabs-vertical .mud-tabs-tabbar-inner {
        flex-direction: column;
        border-radius: var(--mud-default-borderradius);
        border: 1px solid var(--mud-palette-secondary) !important;
    }

    .vertical-tabs-container .mud-tab {
        text-align: left;
        justify-content: flex-start;
        color: var(--mud-palette-secondary) !important;
        background-color: transparent !important;
    }

    .vertical-tabs-container .mud-tab-active {
        background-color: var(--mud-palette-secondary) !important;
        color: white !important;
    }

        .vertical-tabs-container .mud-tab-active .mud-icon-root {
            color: white !important;
        }

/* ===== Inner Tab Content (opt-in) ===== */
.inner-tab-content {
    padding: 24px;
    background-color: var(--mud-palette-surface);
    min-height: 400px;
    border: 1px solid var(--mud-palette-secondary);
    border-radius: 6px;
    margin-left: 56px;
    flex: 1;
    max-width: 1500px;
    min-width: 1500px;
}

/* ===== Info Row Styling ===== */
.info-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

    .info-row:last-child {
        border-bottom: none;
    }

    .info-row .info-label {
        flex: 0 0 200px;
        font-weight: 600;
        color: var(--mud-palette-text-secondary);
    }

    .info-row .info-value {
        flex: 1;
        color: var(--mud-palette-text-primary);
    }

.info-label {
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.info-value {
    color: var(--mud-palette-text-primary);
}

/* ===== Outer Tabs Container (opt-in) ===== */
.outer-tabs-container {
    border: 1px solid var(--mud-palette-secondary);
    border-radius: 6px;
    box-shadow: var(--mud-elevation-2);
}

/* Inersel's dark secondary (#111d28) all but vanishes on the dark background: in dark mode the
   frame and the active tab's line take the tertiary colour, as the tab labels do (DarkColor3). */
.theme-dark .outer-tabs-container {
    border-color: var(--mud-palette-tertiary);
}

.theme-dark .mud-tab-slider {
    background: var(--mud-palette-tertiary);
}

/* ===== Highlight Border (static accent border) ===== */
.border-highlight {
    border: 1.5px solid var(--mud-palette-secondary) !important;
    border-radius: 12px !important;
}

.border-highlight-primary {
    border: 1.5px solid var(--mud-palette-primary) !important;
    border-radius: 12px !important;
}

/* ===== Interactive Card (hover border color shift + elevation) ===== */
.card-interactive {
    border: 1.5px solid transparent !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease !important;
}

.card-interactive:hover {
    border-color: var(--mud-palette-primary) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 0 0 1px rgba(var(--mud-palette-primary-rgb), 0.15) !important;
    transform: translateY(-2px);
}

.card-interactive-secondary {
    border: 1.5px solid transparent !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease !important;
}

.card-interactive-secondary:hover {
    border-color: var(--mud-palette-secondary) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 0 0 1px rgba(var(--mud-palette-secondary-rgb), 0.15) !important;
    transform: translateY(-2px);
}

/* ===== Text Color Classes ===== */
.text-primary-themed {
    color: var(--mud-palette-primary) !important;
}

.text-secondary-themed {
    color: var(--mud-palette-secondary) !important;
}

/* ===== Focus Removal ===== */
h1:focus-visible {
    outline: none !important;
}

.btn-check:focus + .btn,
.btn:focus {
    box-shadow: none !important;
}

/* ===== Validation Styling ===== */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

/* ===== Blazor Error UI ===== */
#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;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9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gMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* ===== Content Padding ===== */
.content {
    padding-top: 1.1rem;
}

/* ===== Mobile Visibility ===== */
@media (max-width: 767px) {
    .hide-on-mobile {
        display: none !important;
    }
}

/* ===== Agile switch =====
   <label class="agile-switch"><input type="checkbox" /><span class="agile-switch-slider round"></span></label>
   Grey when off, green when on. */
.agile-switch {
    position: relative;
    display: inline-block;
    width: 45px;
    height: 22px;
    margin-right: 10px;
}

    .agile-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.agile-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

    .agile-switch-slider:before {
        position: absolute;
        content: "";
        height: 16px;
        width: 16px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: .4s;
    }

.agile-switch input:checked + .agile-switch-slider {
    background-color: var(--mud-palette-success);
}

/* ===== Every MudSwitch that is on is green (Link2IT c0a25470) =====
   Here, not in each switch's Color=, so new switches get it too. MudBlazor marks "on" with
   .mud-checked and paints the thumb with currentColor; the track has its own background. The
   !important beats MudBlazor's colour classes, which use it as well. Off stays grey. */
.mud-switch-base.mud-checked,
.mud-switch-base.mud-checked .mud-switch-button {
    color: var(--mud-palette-success) !important;
}

.mud-switch-base.mud-checked + .mud-switch-track {
    background-color: var(--mud-palette-success) !important;
}

    .agile-switch input:checked + .agile-switch-slider:before {
        transform: translateX(23px);
    }

    /* A switch the viewer may not change (e.g. Administrador): dimmed, as in Link2IT. */
    .agile-switch input:disabled + .agile-switch-slider {
        opacity: 0.5;
        cursor: not-allowed;
    }

.agile-switch-slider.round {
    border-radius: 22px;
}

    .agile-switch-slider.round:before {
        border-radius: 50%;
    }

/* ============ Role badges (Utilizadores; Link2IT site.css) ============ */
.role-developer {
    background-color: #BCFFB8;
    color: #0B7D00;
}

.role-superadmin {
    background-color: #f3e5f5;
    color: #6a1b9a;
}

.role-admin {
    background-color: #e3f2fd;
    color: #1565c0;
}

.role-manager {
    background-color: #fff3e0;
    color: #e65100;
}

.role-regular {
    background-color: #f5f5f5;
    color: #616161;
}

/* Aviso de falta de rede/servidor inacessível (ver js/blazor-reconnect.js) */
#blazor-connection-banner {
    display: none;
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 10000;
    align-items: center;
    gap: 10px;
    max-width: calc(100% - 32px);
    padding: 8px 16px;
    border-radius: 20px;
    background-color: #323232;
    color: #fff;
    font-size: 0.875rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

    #blazor-connection-banner.show {
        display: flex;
    }

    #blazor-connection-banner .blazor-connection-dot {
        flex-shrink: 0;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background-color: #DC3545;
        animation: blazor-connection-pulse 1.2s ease-in-out infinite;
    }

@keyframes blazor-connection-pulse {
    50% {
        opacity: 0.3;
    }
}
