﻿@font-face {
    font-family: 'Poppins';
    src: url('/fonts/Poppins-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'Poppins';
    src: url('/fonts/Poppins-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Poppins';
    src: url('/fonts/Poppins-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Poppins';
    src: url('/fonts/Poppins-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Inter';
    src: url('/fonts/Inter-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Inter';
    src: url('/fonts/Inter-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    /* Prevent FOUC - ensure background is set immediately */
    background-color: #F9FAFB;
}

/* Prevent content flash during initial load */
body {
    opacity: 1;
    transition: opacity 0.1s ease-in;
}

/* Hide content until Blazor is ready - prevents clumsy corner flash */
body:not(.blazor-ready) .scroll-root {
    visibility: hidden;
}

body.blazor-ready .scroll-root {
    visibility: visible;
}

/* Prevent layout shift from scrollbar */
html {
    scrollbar-gutter: stable;
}

.scroll-root {
    width: 100%;
    min-height: 100vh;
    overflow: visible;
}


/* Layout container */
.layout-root {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}


/* Header Wrapper */
.fdc-header-wrapper {
    height: 101px;
    background-color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-shrink: 0;
}

/* Main body */
.main-body {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    min-height: calc(100vh - 101px);
    gap: 1rem;
    overflow: visible;
}

/* Sidebar wrapper */
.sidebar-wrapper {
    height: calc(100vh - 101px);
    overflow: visible; /* Allow pin toggle to show outside */
    flex-shrink: 0;
    position: relative;
    position: sticky;
    top: 0;
}




/* Content */
.content {
    flex-grow: 1;
    padding: 1rem;
    margin-left: 1rem;
    background-color: #F9FAFB;
    overflow-y: scroll;
    overflow-x: hidden;
    max-height: calc(100vh - 101px);
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
}

.content::-webkit-scrollbar {
    width: 8px;
}

.content::-webkit-scrollbar-track {
    background: #F1F5F9;
    border-radius: 4px;
}

.content::-webkit-scrollbar-thumb {
    background-color: #94A3B8;
    border-radius: 4px;
}

.content::-webkit-scrollbar-thumb:hover {
    background-color: #64748B;
}


.global-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Centered spinner overlay - for AuthCallback and Home pages */
.spinner-overlay-centered {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Default spinner overlay - stays in content area */
.spinner-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.spinner {
    border: 12px solid #f3f3f3;
    border-top: 12px solid #3498db;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Global icon styles - prevent FOUC (Flash of Unstyled Content) */
.sort-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    cursor: pointer;
}

img.avatar,
img.avatarplaceholder,
img.search-icon,
img.closeicon,
img.arrowicon {
    max-width: 100%;
    height: auto;
}

/* Prevent images from being oversized before CSS loads */
img {
    max-width: 100%;
}

/* ==================== MEDIA QUERIES ==================== */

/* Extra Large screens (1920px and above) */
@media (min-width: 1920px) {
    .fdc-header-wrapper {
        height: 110px;
    }
    
    .main-body {
        height: calc(100vh - 110px);
    }
}

/* Large screens (1440px - 1919px) */
@media (min-width: 1440px) and (max-width: 1919px) {
    .fdc-header-wrapper {
        height: 101px;
    }
    
    .main-body {
        height: calc(100vh - 101px);
    }
}

/* Medium-Large screens (1200px - 1439px) */
@media (min-width: 1200px) and (max-width: 1439px) {
    .fdc-header-wrapper {
        height: 95px;
    }
    
    .main-body {
        height: calc(100vh - 95px);
    }
    
    .content {
        padding: 0.85rem;
        margin-left: 0.75rem;
    }
}

/* Medium screens (1024px - 1199px) */
@media (min-width: 1024px) and (max-width: 1199px) {
    .fdc-header-wrapper {
        height: 90px;
    }
    
    .main-body {
        height: calc(100vh - 90px);
    }
    
    .content {
        padding: 0.75rem;
        margin-left: 0.5rem;
    }
}

/* Small screens / Tablets (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .fdc-header-wrapper {
        height: 80px;
    }
    
    .main-body {
        height: calc(100vh - 80px);
        gap: 0.5rem;
    }
    
    .content {
        padding: 0.5rem;
        margin-left: 0.25rem;
    }
}

/* Mobile screens (below 768px) */
@media (max-width: 767px) {
    .fdc-header-wrapper {
        height: 70px;
    }
    
    .main-body {
        height: calc(100vh - 70px);
        gap: 0;
    }
    
    .sidebar-wrapper {
        position: fixed;
        left: 0;
        top: 70px;
        height: calc(100vh - 70px);
        z-index: 1000;
        overflow: visible; /* Ensure pin toggle is visible on mobile */
    }
    
    .content {
        padding: 0.5rem;
        margin-left: 0;
        width: 100%;
    }
}
