:root {
    --sidebar-width: 280px;
    --header-height: 56px;
}

/* Theme-aware logo switching */
.logo-light {
    display: none;
}

.logo-dark {
    display: inline-block;
}

[data-bs-theme="dark"] .logo-light {
    display: inline-block;
}

[data-bs-theme="dark"] .logo-dark {
    display: none;
}

body {
    min-height: 100vh;
}

/* App Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 1030;
}

.hamburger-menu {
    border: none;
    text-decoration: none;
}

.hamburger-menu:hover {
    text-decoration: none;
    opacity: 0.7;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    z-index: 1020;
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1010;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* Main Content */
.main-content {
    margin-top: var(--header-height);
    margin-left: var(--sidebar-width);
}

.nav-link.active {
    font-weight: 600;
}

/* Category navigation links */
.category-link {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
    color: var(--bs-body-color);
    transition: background-color 0.15s ease-in-out;
}

.category-link:hover {
    background-color: var(--bs-tertiary-bg);
}

.category-link.active {
    background-color: var(--bs-primary);
    color: #fff;
}

.category-link.active:hover {
    background-color: var(--bs-primary);
}

#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;
}

/* Mobile Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }

    .main-content {
        margin-left: 0;
    }
}

/* Desktop - Hide overlay always */
@media (min-width: 992px) {
    .app-header {
        left: var(--sidebar-width);
    }

    .sidebar {
        top: 0;
    }
}

.toast-enter {
    animation: toast-slide-in 0.3s ease-out;
}

.toast-exit {
    animation: toast-slide-out 0.3s ease-in forwards;
}

@keyframes toast-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toast-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.news-card::after {
    content: "\2197";
    position: absolute;
    right: 1rem;
    top: 1rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.news-card:hover::after {
    opacity: 1;
}

/* Tool link hover effect */
.hover-primary:hover {
    color: var(--bs-primary) !important;
}
