/* ============================================================================
   BETTERNAMER BLAZOR - MAIN STYLESHEET
   ============================================================================
   This CSS file provides styling for the BetterNamer Blazor application.
   It includes Bootstrap-MudBlazor integration, component-specific styles,
   theme handling, and utility classes.
   
   File Structure:
   1. CSS Variables & Root Styles
   2. Bootstrap Framework Overrides
   3. MudBlazor Framework Customizations
   4. Component-Specific Styles
   5. Theme-Specific Styles
   6. Animation & Transition Utilities
   7. Layout & Grid System Fixes
   8. Utility Classes
   ============================================================================ */

@import 'css/palette.css';

/* ============================================================================
   1. CSS Variables & Root Styles (incl. palette.css)
   ============================================================================ */

:root {
    /* Typography overrides - Use Arial/Helvetica instead of Roboto for buttons */
    --mud-typography-button-family: Arial, Helvetica, sans-serif !important;
}

/* Custom CSS property for rotating gradient animation */
@property --angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

/* ============================================================================
   2. BOOTSTRAP FRAMEWORK OVERRIDES
   ============================================================================ */

/* Primary button styling - matches MudBlazor color scheme */
.btn-primary {
    text-transform: none;
    --bs-btn-bg: var(--mud-palette-primary) !important;
    --bs-btn-hover-bg: var(--mud-palette-primary-darken) !important;
}

/* Navigation pills styling */
.nav-pills {
    --bs-nav-pills-link-active-bg: var(--mud-palette-primary) !important;
}

/* Navigation link colors */
.nav {
    --bs-nav-link-color: var(--mud-palette-primary) !important;
    --bs-nav-link-hover-color: var(--mud-palette-primary-darken) !important;
}

/* ============================================================================
   3. MUDBLAZOR FRAMEWORK CUSTOMIZATIONS
   ============================================================================ */

/* Button text transformation overrides */
.mud-button-label,
.mud-fab-label {
    text-transform: none !important;
}

/* Compact button icon spacing */
.compact-button .mud-button-icon-start {
    margin-right: 4px !important;
}

/* Chip close button positioning - move to start of flexbox */
.mud-chip-close-button {
    order: -1;
    margin-right: 6px !important;
    margin-left: 0px !important;
}

/* Fix MudBlazor grid overflow issues */
.mud-grid-spacing-xs-6 {
    width: 100% !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
}

.mud-grid-spacing-xs-6 > .mud-grid-item {
    padding-left: 0 !important;
    padding-top: 24px !important;
}

.mud-grid-spacing-xs-3 {
    width: 100% !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
}

.mud-grid-spacing-xs-3 > .mud-grid-item {
    padding-left: 0 !important;
    padding-top: 12px !important;
}

/* Remove padding from MudBlazor grid items globally */
.mud-item {
    /* padding: 0 !important; */
}

.mud-grid-item {
    /* padding: 0 !important; */
}

/* Specific spacing overrides for different grid sizes to ensure vertical separation */
.mud-grid-spacing-xs-1 > .mud-grid-item { padding-top: 4px !important; }
.mud-grid-spacing-xs-2 > .mud-grid-item { padding-top: 8px !important; }
.mud-grid-spacing-xs-4 > .mud-grid-item { padding-top: 16px !important; }
.mud-grid-spacing-xs-5 > .mud-grid-item { padding-top: 20px !important; }
.mud-grid-spacing-xs-7 > .mud-grid-item { padding-top: 28px !important; }
.mud-grid-spacing-xs-8 > .mud-grid-item { padding-top: 32px !important; }
.mud-grid-spacing-xs-9 > .mud-grid-item { padding-top: 36px !important; }
.mud-grid-spacing-xs-10 > .mud-grid-item { padding-top: 40px !important; }

/* ============================================================================
   4. COMPONENT-SPECIFIC STYLES
   ============================================================================ */

/* --------------------------------------------------------------------------
   Name Option Rows (Search Results)
   -------------------------------------------------------------------------- */
/* Utility helpers used by SearchView components */
.flex { display: flex !important; }
.align-center { align-items: center !important; }
.justify-start { justify-content: flex-start !important; }
.justify-center { justify-content: center !important; }
.justify-end { justify-content: flex-end !important; }
.position-relative { position: relative !important; }
.m-0 { margin: 0 !important; }
.mt-4 { margin-top: 4px !important; }
.mb-4 { margin-bottom: 4px !important; }
.ml-10 { margin-left: 10px !important; }
.mr-10 { margin-right: 10px !important; }
.ml-15 { margin-left: 15px !important; }
.mr-15 { margin-right: 15px !important; }
.ml-20 { margin-left: 20px !important; }
.mr-20 { margin-right: 20px !important; }
.mt-25 { margin-top: 25px !important; }
.mb-5 { margin-bottom: 5px !important; }
.py-5 { padding-top: 5px !important; padding-bottom: 5px !important; }
.p-5 { padding: 5px !important; }
.pt-2 { padding-top: 2px !important; }
.pb-2 { padding-bottom: 2px !important; }
.no-border { border-width: 0 !important; }
.pill-button { border-radius: 50px !important; }
.align-content-center { align-content: center !important; }
.w-100 { width: 100% !important; }

/* --------------------------------------------------------------------------
   Pricing section
   -------------------------------------------------------------------------- */
.pricing-cta-wrap {
    margin-top: 8px;
    margin-bottom: 20px;
}

/* Make CTAs fully rounded and slightly smaller */
.mud-button.pricing-cta {
    border-radius: 9999px !important;
    padding: 8px 14px !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    min-height: 36px;
}

@media (min-width: 600px) {
    .mud-button.pricing-cta { min-height: 40px; }
}

/* NameOptionList specific */
.name-option-list-container { 
    width: 100%; 
}
.name-option-list-top-controls { padding: 4px 16px 12px 16px; }

/* NameOptionRow specific */
.tm-badge { 
    font-weight: bold; 
    font-size: 16px; 
    display: flex; 
    align-items: center; 
    min-width: 24px; 
    justify-content: center; 
    margin-right: 4px;
}
.score-indicator {
    border-radius: 50px;
    color: dodgerblue;
    font-family: Helvetica, serif;
    font-weight: bold;
    font-size: 1.5em;
    font-stretch: extra-condensed;
    margin-left: 5px;
    margin-right: 15px;
    padding: 0px;
    min-width: 32px;
    /*height: 36px;*/
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.name-option-detail-name {
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.name-option-row {
    position: relative;
    transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, border-color 160ms ease;
    border: none;
    margin-top: 6px;
    margin-bottom: 6px;
    padding-inline: 15px;
    padding-bottom: 4px;
    border-radius: 10px;
    background-color: color-mix(in srgb, var(--mud-palette-surface) 60%, transparent);
    max-width: 100%;
    overflow-x: hidden;
}

.name-option-row-selected {
    /*background-color: color-mix(in srgb, var(--mud-palette-primary) 15%, var(--mud-palette-surface)) !important;
    border-color: var(--mud-palette-primary) !important;
    border-color: var(--mud-palette-primary-darken) !important;*/
    border: none !important;
    box-shadow: 0 0 0 1px red inset !important;
}

.name-option-row-header.name-option-row-selected {
    border: none !important;
    box-shadow: none !important;
}


.name-option-row-expanded {
    border-color: var(--mud-palette-primary) !important;
}

.name-option-row-hidden {
    opacity: 0.65;
}

/* Update dot for new or updated name options */
.name-option-update-dot {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background-color: #ff9800; /* Orange color */
    border-radius: 50%;
    pointer-events: none;
    z-index: 10;
    transition: opacity 100ms ease;
}

/* Hide dot immediately when the row is hovered */
.name-option-row:hover .name-option-update-dot {
    opacity: 0;
}

/* Name option divider styling */
.name-option-divider {
    border-color: color-mix(in srgb, var(--mud-palette-lines-default), transparent 70%) !important;
    max-width: calc(100% - 40px);
    margin-left: 20px !important;
    margin-right: 20px !important;
}

/* Name text size animation for expanded state (use transform scale for smooth, sharp rendering) */
.name-option-name-normal,
.name-option-name-expanded {
    display: inline-block;
    transform-origin: left center;
    transition: transform 120ms ease-in-out;
    will-change: transform;
    -webkit-font-smoothing: antialiased;
    backface-visibility: hidden;
}

.name-option-name-normal {
    transform: scale(1);
    color: rgba(255, 255, 255, 0.8) !important;
}

.name-option-name-expanded {
    transform: scale(1.2);
    color: rgba(255, 255, 255, 1) !important;
}

/* --------------------------------------------------------------------------
   Domain Chips
   -------------------------------------------------------------------------- */
.domain-chip {
    border: 1px solid var(--mud-palette-lines-default, rgba(0,0,0,0.2));
    border-radius: 16px;
    padding-inline: 6px;
    padding-block: 0px;
    margin-inline: 2px;
    margin-block: 2px;
    height: 24px !important;
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.domain-chip.available {
    color: var(--mud-palette-info, #0288D1);
    border-color: var(--mud-palette-info, #0288D1);
}

.domain-chip.unavailable {
    color: var(--mud-palette-text-secondary, rgba(0,0,0,0.54));
    border-color: var(--mud-palette-lines-default, rgba(0,0,0,0.2));
}

.domain-chip.preferred:not(.selected).available {
    border-color: var(--mud-palette-primary, #1976d2);
}

.domain-chip.selected {
    background-color: var(--mud-palette-primary, #1976d2) !important;
    color: var(--mud-palette-primary-text, #fff) !important;
    border-color: var(--mud-palette-primary-darken, #115293) !important;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

/* Domain favorite gold styling */
.domain-chip.favorited .mud-chip-close .mud-icon-root,
.domain-chip.favorited .mud-chip-close-button .mud-icon-root,
.domain-chip.selected.favorited .mud-chip-close .mud-icon-root,
.domain-chip.selected.favorited .mud-chip-close-button .mud-icon-root {
    color: #FFD700 !important;
}

.domain-fav-btn.favorited .mud-icon-root {
    color: #FFD700 !important;
}

/* --------------------------------------------------------------------------
   Back Button (SearchView)
   -------------------------------------------------------------------------- */
/* Back button styling matching public hero secondary button */
.back-button {
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    color: white !important;
    border-radius: 50px !important;
    text-transform: none !important;
    font-weight: 600 !important;
    transition: border-color 160ms ease, background-color 160ms ease;
}

.back-button:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: white !important;
}

/* Menu activator buttons that don't need a border */
.menu-activator-button {
    border: none !important;
    color: white !important;
    border-radius: 50px !important;
    text-transform: none !important;
    font-weight: 400 !important;
    transition: background-color 160ms ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5), 
                 0 2px 4px rgba(0,0,0,0.4);
}

.menu-activator-button:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* --------------------------------------------------------------------------
   Search Header Textbox
   -------------------------------------------------------------------------- */

/* Transparent paper background for non-editing state */
.search-header-labelpaper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: row !important;
    gap: 8px !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 20px !important;
    position: relative; /* raise above overlay */
    z-index: 1101;      /* overlay is 1000 */
}

/* Paper background with styling for editing state */
.search-header-labelpaper-editing {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: row !important;
    padding: 16px !important;
    gap: 8px !important;
    background: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: var(--mud-elevation-4) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 20px !important;
    position: relative; /* raise above overlay when editing */
    z-index: 1101;      /* overlay is 1000 */
    color: white !important;
}

/* Search header buttons with fade-in animation */
.search-header-labelpaper-editing {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Custom button class with 20px border radius and increased font size */
.search-header-titlebutton {
    border-radius: 20px !important;
    font-size: 2em !important;
    padding: 12px 20px !important;
    color: white !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3), 
                 0 2px 4px rgba(0,0,0,0.2);
}

.centered-textfield input {
    text-align: center !important;
    color: white !important;
}

/* --------------------------------------------------------------------------
   Subsearch Components
   -------------------------------------------------------------------------- */
.subsearch-card {
    transition: background-color 140ms ease, box-shadow 140ms ease, border-color 140ms ease, transform 140ms ease;
    border-radius: 10px;
    /* Prevent initial vertical scrollbar flash on expand */
    overflow: hidden;
    /* Keep layout stable if scrollbars would appear */
    scrollbar-gutter: stable both-edges;
}

.subsearch-card:hover {
    background-color: rgba(0, 0, 0, 0.03);
    box-shadow: none !important;
}

/* Subsearch dialog styling */
.subsearch-dialog {
    border-radius: 10px !important;
    border: 1px solid var(--mud-palette-lines-default, rgba(0,0,0,0.2)) !important;
    overflow: hidden;
    aspect-ratio: 5 / 3;
    max-height: 80vh;
}

.subsearch-dialog .mud-dialog-content {
    max-height: calc(80vh - 32px);
    overflow: auto;
}

/* --------------------------------------------------------------------------
   Navigation Bar
   -------------------------------------------------------------------------- */
.mud-theme-default .mudstrap-navbar,
.mudstrap-navbar {
    position: sticky !important;
    top: 0;
    inset-inline: 0;
    z-index: 1100;
    height: 58px;
    display: flex;
    align-items: center;
    transition: height 400ms cubic-bezier(0.4, 0, 0.2, 1), backdrop-filter 400ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-backdrop-filter 400ms cubic-bezier(0.4, 0, 0.2, 1), border-color 400ms cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: saturate(140%) blur(20px) !important;
    -webkit-backdrop-filter: saturate(140%) blur(20px) !important;
    box-shadow: none !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    /* Improve transition rendering */
    will-change: height, backdrop-filter;
}

/* Navbar shrink state */
.mud-theme-default .mudstrap-navbar.mudstrap-navbar--shrink,
.mudstrap-navbar.mudstrap-navbar--shrink {
    height: 46px;
    backdrop-filter: saturate(140%) blur(26px) !important;
    -webkit-backdrop-filter: saturate(140%) blur(26px) !important;
    box-shadow: none !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}


/* Navbar toolbar layout */
.mud-appbar .navtoolbar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.mudstrap-navbar.mud-appbar {
    padding-left: 16px;
    padding-right: 16px;
}

/* Common Effects */
.primary-gradient {
    background: linear-gradient(to bottom, rgb(222, 75, 74) 0%, rgb(183, 35, 34) 100%) !important;
}

.primary-gradient-border {
    position: relative;
    border: none !important;
}

.primary-gradient-border::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(to bottom, rgb(222, 75, 74) 0%, rgb(183, 35, 34) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 0;
}

.primary-gradient-border > .mud-card-header,
.primary-gradient-border > .mud-card-content,
.primary-gradient-border > .mud-card-actions,
.primary-gradient-border > .absolute {
    position: relative;
    z-index: 1;
}

/* Navbar Highlight Button */
.nav-btn-highlight {
    color: white !important;
    border-radius: 50px !important;
    text-transform: none !important;
    font-weight: 500 !important;
    padding: 6px 20px !important;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out !important;
}

.nav-btn-highlight:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(222, 75, 74, 0.3);
    opacity: 0.9;
}

.nav-signin-link {
    text-transform: none !important;
    font-weight: 500 !important;
    color: var(--mud-palette-text-primary) !important;
}

/* --------------------------------------------------------------------------
   Back to Top FAB
   -------------------------------------------------------------------------- */
.back-to-top {
    position: fixed;
    right: 40px;
    bottom: 30px;
    z-index: 1200;
    transition: opacity 180ms ease-in-out;
    background-color: rgba(255,255,255,0.14) !important;
    color: rgba(255,255,255,0.92) !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25) !important;
    opacity: 0;
    pointer-events: none;
}

.back-to-top.back-to-top--visible {
    opacity: 1;
    pointer-events: auto;
}

/* ============================================================================
   5. THEME-SPECIFIC STYLES
   ============================================================================ */

/* --------------------------------------------------------------------------
   Dark Theme Overrides
   -------------------------------------------------------------------------- */

.mud-theme-dark .subsearch-card:hover {
    background-color: rgba(255, 255, 255, 0.06);
    box-shadow: none !important;
}

.mud-theme-dark .mudstrap-navbar {
    border-bottom-color: rgba(255, 255, 255, 0.10);
    backdrop-filter: saturate(140%) blur(20px) !important;
    -webkit-backdrop-filter: saturate(140%) blur(20px) !important;
    transition: height 400ms cubic-bezier(0.4, 0, 0.2, 1), backdrop-filter 400ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-backdrop-filter 400ms cubic-bezier(0.4, 0, 0.2, 1), border-color 400ms cubic-bezier(0.4, 0, 0.2, 1);
    will-change: height, backdrop-filter;
}

.mud-theme-dark .mudstrap-navbar.mudstrap-navbar--shrink {
    border-bottom-color: rgba(255, 255, 255, 0.20);
    backdrop-filter: saturate(140%) blur(26px) !important;
    -webkit-backdrop-filter: saturate(140%) blur(26px) !important;
}

.mud-theme-dark .back-to-top {
    background-color: rgba(0,0,0,0.4) !important;
    color: rgba(255,255,255,0.92) !important;
}

/* --------------------------------------------------------------------------
   Light Theme Hover Effects
   -------------------------------------------------------------------------- */
/* Generic hover fallback */
.name-option-row:hover,
.mud-paper.name-option-row:hover {
    background-color: rgba(100, 100, 255, 0.2) !important;
    box-shadow: none !important;
}

/* Explicit light theme hover */
.mud-theme-default .name-option-row:hover,
.mud-theme-light .name-option-row:hover,
.mud-theme-default .mud-paper.name-option-row:hover,
.mud-theme-light .mud-paper.name-option-row:hover {
    background-color: rgba(0, 0, 0, 0.04) !important;
    box-shadow: none !important;
}

/* --------------------------------------------------------------------------
   Dark Theme Hover Effects
   -------------------------------------------------------------------------- */
.mud-theme-dark .name-option-row:hover,
.mud-theme-dark .mud-paper.name-option-row:hover {
    background-color: rgba(255, 255, 255, 0.06) !important;
    box-shadow: none !important;
}

/* Ensure selected rows keep their border on hover (overrides generic hover rules) */
.name-option-row-selected:hover,
.mud-paper.name-option-row-selected:hover {
    /* Re-apply the selected border via inset shadow */
    box-shadow: 0 0 0 1px red inset !important;
}

.name-option-row-header.name-option-row-selected:hover {
    border: none !important;
    box-shadow: none !important;
}

/* --------------------------------------------------------------------------
   SearchView Background Gradients
   -------------------------------------------------------------------------- */
/* Default/Light theme gradient background */
.mud-layout {
    background-color: #0A0C18 !important; /* Base dark color */
    background-image:
            radial-gradient(1000px circle at 50% 0%, rgba(221, 51, 3, 0.4), transparent 0%),
            radial-gradient(2000px circle at 50% 20%, rgba(39, 62, 136, 0.3), transparent 60%),
            radial-gradient(750px circle at 28% 88%, rgba(8, 14, 28, 0.05), transparent 0%),
            linear-gradient(100deg, #0A0C18 0%, #0A0C18 50%, #0A0C18 100%) !important;
    background-blend-mode: screen, screen, screen, normal;
    background-attachment: fixed;
}

.searchview-hero {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* The masked gradient is rendered in a pseudo-element so children are unaffected */
    padding-top: 16px;
    padding-bottom: 16px;
    overflow: visible;
    z-index: 0;
}

/* Render the masked gradient behind the content so it doesn't affect opacity of children */
.searchview-hero::before {
    content: "";
    position: absolute;
    left: -400px;
    right: -400px;
    top: -50px;
    bottom: -250px;
    background: linear-gradient(65deg, #1D203C 0%, #273E88 30%, #DE4B4A 50%, #2787D3 90%);
    -webkit-mask-image: url('/background-mask.png');
    mask-image: url('/background-mask.png');
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-position: center;
    mask-position: center;
    z-index: -1;
    pointer-events: none;
}

.colorful-bg {
    position: static;
    inset: 0;
    z-index: -1;
    display: block !important;
    background: linear-gradient(65deg, #1D203C 0%, #273E88 30%, #2787D3 50%, #DE4B4A 90%);
    background-attachment: scroll;
}

/* Specific elements that should show the colorful background */
.mudstrap-navbar,
.public-hero,
footer,
.footer-container,
.mud-paper:not(.mud-popover):not(.mud-dialog):not(.mud-menu-list):not(.search-header-labelpaper):not(.search-header-labelpaper-editing):not(.favorites-list-paper):not(.others-list-paper),
.feature-tile,
.feature-card,
.usage-stats-section,
.mud-tab-panel,
.mud-tabs-panels {
    position: relative;
    /* The colorful background is revealed behind the mask or via background */
    background: linear-gradient(65deg, #1D203C 0%, #273E88 30%, #2787D3 50%, #DE4B4A 90%) scroll;
}

/* Darkened coloring and blur for navbar and panels */
.mudstrap-navbar {
    /* Standard bg-color with translucency works well on top of the fixed background */
    /* We use multiple backgrounds: the top layer is the darkened tint, the bottom layer is the fixed colorful gradient */
    background:
            linear-gradient(rgba(28, 31, 61, 0.24), rgba(28, 31, 61, 0.3)),
            linear-gradient(65deg, rgba(29, 32, 60, 0.45) 0%, rgba(39, 62, 136, 0.45) 30%, rgba(39, 135, 211, 0.45) 50%, rgba(222, 75, 74, 0.45) 90%) fixed !important;
    
    backdrop-filter: saturate(140%) blur(20px) !important;
    -webkit-backdrop-filter: saturate(140%) blur(20px) !important;
    /*border-bottom: 1px solid rgba(58, 75, 108, 0.5) !important;*/

    box-shadow: inset 0 -1px rgba(0, 0, 0, 0.25);
}

.mudstrap-navbar--shrink-bg {
    background: 
        linear-gradient(rgba(28, 31, 61, 0.24), rgba(28, 31, 61, 0.3)),
        linear-gradient(65deg, rgba(29, 32, 60, 0.45) 0%, rgba(39, 62, 136, 0.45) 30%, rgba(39, 135, 211, 0.45) 50%, rgba(222, 75, 74, 0.45) 90%) fixed !important;

    box-shadow: inset 0 -1px rgba(0, 0, 0, 0.25);
}

.mudstrap-navbar.mudstrap-navbar--shrink {
    backdrop-filter: saturate(140%) blur(26px) !important;
    -webkit-backdrop-filter: saturate(140%) blur(26px) !important;
}

.mud-popover .mud-paper,
.mud-popover.mud-paper,
.mud-menu .mud-paper {
    background: #1D203C !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}
.mud-paper:not(.mud-popover):not(.mud-dialog):not(.mud-menu-list):not(.search-header-labelpaper):not(.search-header-labelpaper-editing):not(.favorites-list-paper):not(.others-list-paper),
footer,
.footer-container,
.feature-tile,
.feature-card,
.usage-stats-section {
    /* Standard bg-color with translucency works well on top of the fixed background */
    /* We use multiple backgrounds: the top layer is the darkened tint, the bottom layer is the fixed colorful gradient */
    background:
            linear-gradient(rgba(25, 40, 87, 0.8), rgba(25, 40, 87, 0.8)),
            linear-gradient(65deg, #1D203C 0%, #273E88 30%, #2787D3 50%, #DE4B4A 90%) fixed !important;

    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}

/* Specific styling for feature-related items */
.feature-tile,
.feature-card {
    /* Normal dark shadow */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid rgb(58, 75, 108) !important;
    margin: 12px !important;
}

/* ============================================================================
   6. ANIMATION & TRANSITION UTILITIES
   ============================================================================ */

/* --------------------------------------------------------------------------
   Fade Animations
   -------------------------------------------------------------------------- */
.fade-in {
    opacity: 1;
    transition: opacity 0.15s ease-in-out !important;
}

.fade-out {
    opacity: 0;
    transition: opacity 0.15s ease-in-out !important;
}

/* --------------------------------------------------------------------------
   Sideways Collapse Animation
   -------------------------------------------------------------------------- */
.sideways-collapse {
    display: inline-block;
    vertical-align: top;
}

.sideways-collapse-wrapper {
    overflow: hidden;
    width: 0;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: width;
}

.sideways-collapse-wrapper.expanded {
    width: auto;
}

.sideways-collapse-content {
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-10px);
    transition:
            opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1) 0.1s,
            transform 0.2s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
    will-change: opacity, transform;
}

.sideways-collapse-wrapper.expanded .sideways-collapse-content {
    opacity: 1;
    transform: translateX(0);
    transition:
            opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1) 0.2s,
            transform 0.2s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}

/* Left direction variant */
.sideways-collapse.sideways-collapse-direction-left .sideways-collapse-content {
    transform: translateX(10px);
}

/* Disabled animation */
.sideways-collapse.sideways-collapse-no-animation .sideways-collapse-wrapper,
.sideways-collapse.sideways-collapse-no-animation .sideways-collapse-content {
    transition: none !important;
}

/* --------------------------------------------------------------------------
   Keyframe Animations
   -------------------------------------------------------------------------- */

/* ============================================================================
   7. LAYOUT & RESPONSIVE DESIGN
   ============================================================================ */

/* Main content scroll compensation for sticky navbar */
body .mud-main-content, .mud-layout .mud-main-content {
    scroll-margin-top: 72px;
}

/* Responsive navbar behavior */
@media (max-width: 599.98px) {
    .mud-appbar .navtoolbar { 
        display: none; 
    }
}

/* ============================================================================
   8. FOOTER STYLES
   ============================================================================ */

/* Footer container styling */
.footer-container {
    margin-top: 2rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--mud-palette-lines-default, rgba(255, 255, 255, 0.1));
    position: relative;
    z-index: 1;
}

/* Footer text styling */
.footer-text {
    color: var(--mud-palette-text-secondary, rgba(0,0,0,0.6));
    font-size: 0.875rem;
}


/* Social media icon styling */
.social-media-icon {
    transition: color 0.2s ease, transform 0.2s ease;
    color: var(--mud-palette-text-secondary);
}

.social-media-icon-x {
    transform: scale(0.8);
}

.social-media-icon:hover {
    transform: scale(1.1);
    color: var(--mud-palette-primary) !important;
}

.social-media-icon-x:hover {
    transform: scale(0.88); /* 1.1 * 0.8 */
}

/* Responsive design for footer social media section */
@media (max-width: 599.98px) {
    .footer-container .d-flex.justify-center.align-center {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-container .me-4 {
        margin-right: 0 !important;
        margin-bottom: 0.5rem;
    }
}

/* ============================================================================
   9. UTILITY CLASSES
   ============================================================================ */

/* Additional utility classes can be added here as needed */

/* End of stylesheet */


/* ============================================================================
   9. Blazor Reconnecting & Error UI — MudBlazor Themed
   ============================================================================ */
/* Notes:
   - Styles the built-in Blazor Server reconnect modal and Blazor error banner to
     visually match MudBlazor theming.
   - Uses MudBlazor CSS variables so it adapts to light/dark themes automatically.
*/

/* Base overlay for reconnect modal */
#components-reconnect-modal {
    position: fixed;
    inset: 0;
    display: none; /* Shown via state classes below */
    align-items: center;
    justify-content: center;
    background: transparent !important;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 10000; /* Above app bar, drawers, dialogs */
    padding: 16px;
    /* Delay visibility slightly to avoid flicker on brief interruptions */
    opacity: 0;
    visibility: hidden;
    transition: visibility 0s linear 0.5s, opacity 0.5s linear;
}

/* Show/Hide states controlled by Blazor */
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
    /* Become visible after a short delay; fade in smoothly */
    visibility: visible;
    opacity: 1;
    transition: opacity 0.2s ease-in;
}

/* Reconnect content container styled like a MudBlazor dialog */
#components-reconnect-modal > .reconnect-content,
#components-reconnect-modal > .components-reconnect-show,
#components-reconnect-modal > .components-reconnect-failed,
#components-reconnect-modal > .components-reconnect-rejected {
    font-family: var(--mud-typography-button-family, inherit);
    color: var(--mud-palette-primary-text, #fff);
    background-color: #1e1e1e !important; /* Force dark dialog background in all themes */
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.35);
    padding: 18px 20px;
    max-width: 520px;
    width: min(520px, 92vw);
    text-align: center;
}

/* State-specific accent bar (top border) */
#components-reconnect-modal > .components-reconnect-show {
    border-top: 4px solid var(--mud-palette-primary, #1976d2);
}
#components-reconnect-modal > .components-reconnect-failed {
    border-top: 4px solid var(--mud-palette-warning, #FFA000);
}
#components-reconnect-modal > .components-reconnect-rejected {
    border-top: 4px solid var(--mud-palette-error, #F44336);
}

/* Text nuances */
#components-reconnect-modal .title {
    font-weight: 600;
    margin-bottom: 4px;
}
#components-reconnect-modal .message {
    opacity: 0.9;
}

/* Provide a subtle pulse while attempting to reconnect */
#components-reconnect-modal.components-reconnect-show > .components-reconnect-show {
    animation: bn-reconnect-pulse 1.2s ease-in-out infinite;
}
@keyframes bn-reconnect-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}
