﻿#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;
    }

/* Loading Spinner */
.loader {
    width: 60px;
    aspect-ratio: 1;
    display: grid;
    grid: 50%/50%;
    color: #238fe8;
    --_g: no-repeat linear-gradient(currentColor 0 0);
    background: var(--_g),var(--_g),var(--_g);
    background-size: 50.1% 50.1%;
    animation: l6-0 1.5s infinite steps(1) alternate, l6-0-0 3s infinite steps(1);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

    .loader::before {
        content: "";
        background: currentColor;
        transform: perspective(150px) rotateY(0deg) rotateX(0deg);
        transform-origin: bottom right;
        animation: l6-1 1.5s infinite linear alternate;
    }

@keyframes l6-0 {
    0% {
        background-position: 0 100%,100% 100%,100% 0
    }

    33% {
        background-position: 100% 100%,100% 100%,100% 0
    }

    66% {
        background-position: 100% 0,100% 0,100% 0
    }
}

@keyframes l6-0-0 {
    0% {
        transform: scaleX(1) rotate(0deg)
    }

    50% {
        transform: scaleX(-1) rotate(-90deg)
    }
}

@keyframes l6-1 {
    16.5% {
        transform: perspective(150px) rotateX(-90deg) rotateY(0deg) rotateX(0deg);
        filter: grayscale(0.8)
    }

    33% {
        transform: perspective(150px) rotateX(-180deg) rotateY(0deg) rotateX(0deg)
    }

    66% {
        transform: perspective(150px) rotateX(-180deg) rotateY(-180deg) rotateX(0deg)
    }

    100% {
        transform: perspective(150px) rotateX(-180deg) rotateY(-180deg) rotateX(-180deg);
        filter: grayscale(0.8)
    }
}
/* Custom Navigation Styles */

.atana-nav {
    height: 100%;
    width: 100%;
    max-width: 100%;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    position: relative;
    overflow: hidden; /* Prevent content from going outside */
    box-sizing: border-box;
}

.nav-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
    flex-shrink: 0; /* Prevent header from shrinking */
    width: 100%;
    box-sizing: border-box;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-width: 0; /* Allow shrinking */
}

.nav-logo {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
    flex-shrink: 0;
}

.nav-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.nav-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden; /* Prevent horizontal scrolling */
    padding: 1rem 0;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.nav-item {
    margin: 0;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.nav-dropdown {
    position: relative;
    width: 100%;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    background: none;
    border: none;
    width: calc(100% - 1.5rem); /* Account for margins */
    max-width: calc(100% - 1.5rem);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border-radius: 0.5rem;
    margin: 0.125rem 0.75rem;
    font-size: 0.95rem;
    box-sizing: border-box;
    min-width: 0; /* Allow content to shrink */
}

.nav-link:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.nav-link.active {
    background: #3b82f6;
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.nav-icon {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-text {
    flex: 1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0; /* Allow text to shrink */
}

.nav-arrow {
    font-size: 1rem;
    transition: transform 0.2s ease-in-out;
    margin-left: auto;
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-dropdown .nav-arrow {
    transform: rotate(0deg);
}

.nav-dropdown.open .nav-arrow {
    transform: rotate(180deg);
}

.nav-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #f9fafb;
    border-radius: 0.5rem;
    margin: 0.25rem 0.75rem 0.5rem 0.75rem;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-in-out;
    width: calc(100% - 1.5rem); /* Ensure it fits within container */
    box-sizing: border-box;
    position: relative; /* Keep it in normal document flow */
}

.nav-submenu.open {
    max-height: 500px;
    padding: 0.25rem 0;
}

.nav-subitem {
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.nav-sublink {
    display: block;
    padding: 0.625rem 1rem 0.625rem 3rem;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease-in-out;
    border-radius: 0.375rem;
    margin: 0.125rem 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: calc(100% - 1rem);
    max-width: calc(100% - 1rem);
    box-sizing: border-box;
    min-width: 0;
}

.nav-sublink:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.nav-sublink.active {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 500;
}

/* Custom scrollbar */
.nav-content::-webkit-scrollbar {
    width: 4px;
}

.nav-content::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.nav-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.nav-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Material Design Icons compatibility */
.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* Navigation link states */
.atana-nav a[href] {
    text-decoration: none;
    color: inherit;
}

.atana-nav a[href]:hover {
    text-decoration: none;
}

/* Custom focus styles for accessibility */
.nav-link:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 0.5rem;
}

/* Ensure proper containment */
.nav-item * {
    box-sizing: border-box;
}

/* Prevent horizontal overflow globally */
.atana-nav * {
    max-width: 100%;
    box-sizing: border-box;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .nav-title {
        font-size: 1rem;
    }
    
    .nav-link {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
        width: calc(100% - 1rem);
        max-width: calc(100% - 1rem);
        margin: 0.125rem 0.5rem;
    }
    
    .nav-sublink {
        padding: 0.5rem 0.75rem 0.5rem 2.5rem;
        font-size: 0.8125rem;
        width: calc(100% - 0.75rem);
        max-width: calc(100% - 0.75rem);
        margin: 0.125rem 0.375rem;
    }

    .nav-submenu {
        margin: 0.25rem 0.5rem 0.5rem 0.5rem;
        width: calc(100% - 1rem);
    }

    .nav-icon {
        margin-right: 0.5rem;
    }

    .nav-text {
        font-size: 0.875rem;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .nav-header {
        padding: 0.75rem;
    }

    .nav-title {
        font-size: 0.95rem;
    }

    .nav-link {
        padding: 0.5rem 0.625rem;
        font-size: 0.8125rem;
        margin: 0.0625rem 0.375rem;
        width: calc(100% - 0.75rem);
        max-width: calc(100% - 0.75rem);
    }

    .nav-sublink {
        padding: 0.4375rem 0.625rem 0.4375rem 2rem;
        font-size: 0.75rem;
        margin: 0.0625rem 0.25rem;
        width: calc(100% - 0.5rem);
        max-width: calc(100% - 0.5rem);
    }

    .nav-submenu {
        margin: 0.25rem 0.375rem 0.5rem 0.375rem;
        width: calc(100% - 0.75rem);
    }

    .nav-icon {
        font-size: 1.125rem;
        width: 1.125rem;
        height: 1.125rem;
        margin-right: 0.375rem;
    }
}