/* Theme Variables */
:root {
    --body-font: "Bai Jamjuree", "Segoe UI Variable", "Segoe UI", sans-serif;
    --neutral-foreground-rest: #242424;
    --neutral-layer-1: #ffffff;
    --neutral-layer-2: #f5f5f5;
    --neutral-layer-3: #f0f0f0;
    --neutral-layer-4: #e6e6e6;
    --accent-fill-rest: #0078d4;
    --type-ramp-base-font-size: 0.875rem;
    --type-ramp-base-line-height: 20px;
    /* Light Theme Colors */
    --body-background-light: #FAFAFA;
    --navmenu-background-light: #FFFFFF;
    --navmenu-border-light: #E5E7EB;
    /* Dark Theme Colors */
    --body-background-dark: #374151;
    --navmenu-background-dark: #758599;
}

/* Theme-specific Body Background */
body {
    font-family: var(--body-font);
    font-size: var(--type-ramp-base-font-size);
    line-height: var(--type-ramp-base-line-height);
    margin: 0;
    background-color: var(--body-background-light);
    height: 100%;
    overflow: hidden;
}

/* FluentNavMenu Theme Styles */
.fluent-nav-menu {
    background-color: var(--navmenu-background-light) !important;
    border-right-color: var(--navmenu-border-light) !important;
    border-right-style: solid !important;
    border-right-width: 1px !important;
    height: -webkit-fill-available;
    overflow-y: auto;
    overflow-x: hidden;
}

body.dark-theme .fluent-nav-menu,
html.dark .fluent-nav-menu {
    background-color: var(--navmenu-background-dark) !important;
    border-right: none !important;
    height: -webkit-fill-available;
}

.fluent-nav-link.notactive .positioning-region,
.fluent-nav-link.active .positioning-region,
.fluent-nav-link .positioning-region,
.fluent-nav-item.expander .positioning-region {
    background-color: unset !important;
}

    .fluent-nav-link .positioning-region:hover,
    .fluent-nav-link.notactive .positioning-region:hover {
        color: #00AEEF;
    }

.fluent-nav-link.active .positioning-region {
    color: #1F3B91;
}

/* SideMenu Font Size */
.fluent-nav-link .content-region,
.fluent-nav-group .content-region,
.fluent-nav-link.active .content-region,
.fluent-nav-group.active .content-region,
.fluent-nav-link.notactive .content-region,
.fluent-nav-group.notactive .content-region {
    font-size: 1rem !important;
}


/* Global Font Override - Bai Jamjuree */
* {
    font-family: "Bai Jamjuree", "Segoe UI Variable", "Segoe UI", sans-serif !important;
}

body.dark-theme,
html.dark body {
    background-color: var(--body-background-dark);
}

html {
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
    font-family: "Bai Jamjuree", "Segoe UI Variable", "Segoe UI", sans-serif !important;
    height: 100%;
    overflow: hidden;
}

#app {
    height: 100%;
    display: flex;
    flex-direction: column;
}

fluent-design-system-provider,
fluent-layout {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.navmenu-icon {
    display: none;
}

.main {
    flex: 1;
    min-height: 0;
    color: var(--neutral-foreground-rest);
    align-items: stretch !important;
    overflow: hidden;
}

.body-content {
    align-self: stretch;
    height: 100% !important;
    display: flex;
    overflow: auto;
    flex: 1;
    min-width: 0;
}

.content {
    padding: 0.5rem 1.5rem 0.5rem 1.5rem;
    align-self: stretch !important;
    /*width: 100%;*/
    height: 100%;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

/* User profile cards styling */
fluent-card {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
}

    fluent-card h2 {
        margin-top: 0;
        margin-bottom: 1rem;
        color: var(--accent-fill-rest);
    }

    fluent-card h3 {
        margin-top: 0;
        margin-bottom: 1rem;
        color: var(--accent-fill-rest);
    }

fluent-data-grid {
    margin-top: 1rem;
}

footer {
    background: var(--neutral-layer-4);
    color: var(--neutral-foreground-rest);
    align-items: center;
    padding: 10px 10px;
}

    footer a {
        color: var(--neutral-foreground-rest);
        text-decoration: none;
    }

        footer a:focus {
            outline: 1px dashed;
            outline-offset: 3px;
        }

        footer a:hover {
            text-decoration: underline;
        }

.alert {
    border: 1px dashed var(--accent-fill-rest);
    padding: 5px;
}

/* FluentUI Dialog z-index fix - ensure dialogs appear above panels */
fluent-dialog::part(overlay) {
    /*z-index: 2000 !important;*/
}

fluent-dialog,
.fluent-dialog,
fluent-dialog::part(dialog),
fluent-dialog::part(positioning-region) {
    z-index: 2500 !important;
}


#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;
    margin: 20px 0;
}

    #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+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA9NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDg2IDY2LjAxODMgMjYzLjU4NiA2Ni4wMTgzIFptMjYzLjU3NiA4Ni4wNTQ3QzI2MS4wNDkgODYuA=='Z2U3IDI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121; padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

/* Splash Screen Styles */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: url('../images/backgrounds/login-background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 3rem 4rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    min-width: 350px
}

.splash-logo {
    height: 80px;
    margin-bottom: 1.5rem;
    animation: fadeInScale 0.6s ease-out;
}

.splash-title {
    font-size: 28px;
    font-weight: 600;
    color: #1F3B91;
    margin: 0 0 2rem 0;
    text-align: center;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading-progress {
    position: relative;
    display: block;
    width: 6rem;
    height: 6rem;
    margin: 0 auto 0.75rem auto;
    animation: fadeIn 0.6s ease-out 0.4s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

    .loading-progress circle:last-child {
        stroke: #1b6ec2;
        stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
        transition: stroke-dasharray 0.05s ease-in-out;
    }

.loading-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-50% - 0.5rem));
    text-align: center;
    font-weight: 500;
    font-size: 0.875rem;
    color: #1F3B91;
    pointer-events: none;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Betöltés...");
    }

code {
    color: #c02d76;
}

@media (max-width: 600px) {
    .header-gutters {
        margin: 0.5rem 3rem 0.5rem 1.5rem !important;
    }

    [dir="rtl"] .header-gutters {
        margin: 0.5rem 1.5rem 0.5rem 3rem !important;
    }

    .main {
        flex-direction: column !important;
        row-gap: 0 !important;
    }

    nav.sitenav {
        width: 100%;
        height: 100%;
    }

    #main-menu {
        width: 100% !important;
    }

        #main-menu > div:first-child:is(.expander) {
            display: none;
        }

    .navmenu {
        width: 100%;
    }

    #navmenu-toggle {
        appearance: none;
    }

        #navmenu-toggle ~ nav {
            display: none;
        }

        #navmenu-toggle:checked ~ nav {
            display: block;
        }

    .navmenu-icon {
        cursor: pointer;
        z-index: 10;
        display: block;
        position: absolute;
        top: 15px;
        left: unset;
        right: 20px;
        width: 20px;
        height: 20px;
        border: none;
    }

    [dir="rtl"] .navmenu-icon {
        left: 20px;
        right: unset;
    }
}

/* AuthenticationLayout globális stílusok */
.auth-layout {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .auth-layout.light-theme {
        background-image: url('/images/backgrounds/login-background.jpg');
    }

    .auth-layout.dark-theme {
        background-image: url('/images/backgrounds/login-background-dark.jpg');
    }

/* Auth content box stílusok */
.auth-content-box {
    text-align: center;
    padding: 3rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    backdrop-filter: blur(10px);
    z-index: 9999;
}

    .auth-content-box h3 {
        margin: 0 0 1rem 0;
        color: var(--accent-fill-rest);
    }

    .auth-content-box p {
        color: var(--neutral-foreground-rest);
        margin: 0 0 1.5rem 0;
    }

    .auth-content-box fluent-progress-ring {
        margin: 1rem auto;
        display: block;
    }

/* Dark theme support */
body.dark-theme .auth-content-box,
html.dark .auth-content-box,
.auth-layout.dark-theme .auth-content-box {
    background: rgba(55, 65, 81, 0.95);
}

    body.dark-theme .auth-content-box h3,
    html.dark .auth-content-box h3,
    .auth-layout.dark-theme .auth-content-box h3 {
        color: #00AEEF;
    }

    body.dark-theme .auth-content-box p,
    html.dark .auth-content-box p,
    .auth-layout.dark-theme .auth-content-box p {
        color: #E5E7EB;
    }

/* Virtualized Data Grid Styles */

.virtualized-grid-container {
    width: 100%;
}

/* Grid Header */
.grid-header {
    background: var(--neutral-layer-2);
    border-bottom: 2px solid var(--accent-fill-rest);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.grid-header-cell {
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
    user-select: none;
}

    .grid-header-cell[style*="cursor: pointer"]:hover {
        background: var(--neutral-layer-3);
    }

/* Grid Scroll Container - Enhanced Scrollbar */
.grid-scroll-container {
    position: relative;
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-fill-rest) var(--neutral-layer-1);
}

    /* Webkit (Chrome, Safari, Edge) Scrollbar Styling */
    .grid-scroll-container::-webkit-scrollbar {
        width: 14px;
        height: 14px;
    }

    .grid-scroll-container::-webkit-scrollbar-track {
        background: var(--neutral-layer-1);
        border-radius: 0 4px 4px 0;
    }

    .grid-scroll-container::-webkit-scrollbar-thumb {
        background: var(--neutral-fill-stealth-rest);
        border-radius: 7px;
        border: 3px solid var(--neutral-layer-1);
    }

        .grid-scroll-container::-webkit-scrollbar-thumb:hover {
            background: var(--neutral-fill-stealth-hover);
        }

        .grid-scroll-container::-webkit-scrollbar-thumb:active {
            background: var(--accent-fill-rest);
        }

    .grid-scroll-container::-webkit-scrollbar-corner {
        background: var(--neutral-layer-1);
    }

/* Grid Rows */
.grid-row {
    border-bottom: 1px solid var(--neutral-stroke-rest);
    transition: background-color 0.2s ease;
}

    .grid-row:hover {
        background-color: var(--neutral-layer-2);
    }

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

/* Grid Cell */
.grid-cell {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Scroll to Top Button */
.scroll-to-top-button {
    position: absolute;
    bottom: 20px;
    right: 60px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 100;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scroll-to-top-button:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
    transition: all 0.2s ease;
}

/* Sort Icons */
.grid-header-cell fluent-icon {
    flex-shrink: 0;
}

/* Loading Placeholder */
.grid-placeholder {
    padding: 10px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .grid-header-cell {
        font-size: 0.9em;
    }

    .grid-cell {
        font-size: 0.9em;
    }

    .scroll-to-top-button {
        width: 40px;
        height: 40px;
        bottom: 15px;
        right: 50px;
    }

    .grid-scroll-container::-webkit-scrollbar {
        width: 10px;
    }
}

/* Print Styles */
@media print {
    .scroll-to-top-button {
        display: none;
    }

    .grid-scroll-container {
        height: auto !important;
        overflow: visible !important;
        border: none;
    }

        .grid-scroll-container::-webkit-scrollbar {
            display: none;
        }
}

/* Fluent Tab globális kinézetének felülírása */
fluent-tab,
fluent-tab::part(tab),
fluent-tab .tab,
.fluent-tab {
    user-select: none;
    font-weight: 400;
    font-size: 1.05em;
    border-top: 1px solid var(--neutral-stroke-rest);
    border-radius: 6px 6px 0px 0px;
    border-right: 1px solid var(--neutral-stroke-rest);
    border-left: 1px solid var(--neutral-stroke-rest);
}