/* ===== Page Layout ===== */
.page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ===== Header ===== */
fluent-header {
    --header-height: 48px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dotnet-logo {
    flex-shrink: 0;
    border-radius: 4px;
}

.brand-title {
    white-space: nowrap;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-separator {
    color: var(--neutral-foreground-hint);
    user-select: none;
}

.nav-link-anchor::part(control) {
    font-weight: 500;
}

/* ===== User Menu / Avatar ===== */
.user-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.avatar-btn {
    padding: 0 !important;
    min-width: auto !important;
}

.user-dropdown {
    position: fixed;
    top: 52px;
    right: 0.5rem;
    min-width: 240px;
    z-index: 9999;
    padding: 0.5rem 0;
    background: var(--neutral-layer-floating);
    border: 1px solid var(--neutral-stroke-divider-rest);
    border-radius: calc(var(--control-corner-radius) * 2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
    animation: dropdown-fade-in 0.15s ease;
}

@keyframes dropdown-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.dropdown-email {
    opacity: 0.6;
    font-size: 0.8rem;
    word-break: break-all;
}

.dropdown-item {
    width: 100%;
    justify-content: flex-start;
}

.dropdown-item::part(control) {
    justify-content: flex-start;
    padding: 0.5rem 1rem;
}

/* ===== Content ===== */
.content-with-chat {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

.content {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 1.5rem 2rem;
    overflow-y: auto;
}

.main-content {
    width: 100%;
}

/* ===== Hero ===== */
.hero {
    text-align: center;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.hero-title {
    background: linear-gradient(135deg, var(--accent-fill-rest), var(--accent-fill-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    opacity: 0.7;
}

.hero-welcome {
    color: var(--accent-fill-rest);
    font-weight: 500;
}

/* ===== WIP Badge ===== */
.wip-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.wip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #eab308;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ===== Description ===== */
.hero-description {
    opacity: 0.5;
    max-width: 560px;
}

/* ===== About Page ===== */
.about-page {
    text-align: center;
}

.about-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.version-info {
    opacity: 0.5;
    font-size: 0.85rem;
}

/* ===== Footer ===== */
fluent-footer {
    text-align: center;
}

.footer-content {
    opacity: 0.5;
    font-size: 0.8rem;
}

.footer-separator {
    margin: 0 0.4rem;
    opacity: 0.5;
}

.footer-link {
    color: inherit;
    text-decoration: none;
}

.footer-link:hover {
    text-decoration: underline;
}

/* ===== Loading Screen (WASM initial load) ===== */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 0.5rem;
    opacity: 0.6;
}

/* ===== Blazor Error UI ===== */
#blazor-error-ui {
    background: #ef4444;
    color: white;
    padding: 0.5rem 1.5rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 1000;
    display: none;
    text-align: center;
}

#blazor-error-ui .reload,
#blazor-error-ui .dismiss {
    color: white;
    margin-left: 0.75rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .content-with-chat {
        flex-direction: column;
    }
    
    .chat-panel.expanded {
        width: 100%;
        min-width: 100%;
        border-left: none;
        border-top: 1px solid var(--neutral-stroke-rest);
        max-height: 50vh;
    }
    
    .chat-panel.collapsed {
        width: 100%;
        min-width: 100%;
        height: 48px;
        border-left: none;
        border-top: 1px solid var(--neutral-stroke-rest);
    }
    
    .chat-sidebar-collapsed {
        flex-direction: row;
        width: 100%;
        height: 48px;
        padding: 0 1rem;
        justify-content: center;
    }
    
    .sidebar-text {
        writing-mode: horizontal-tb;
        text-orientation: mixed;
    }
}

@media (max-width: 640px) {
    .header-right {
        gap: 0.4rem;
    }
    .content {
        padding: 1rem;
    }
}
