@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* Prevent AOS animations during Blazor prerender to avoid flickering */
[data-aos] {
    opacity: 0;
    transition-property: opacity, transform;
}

[data-aos].aos-animate {
    opacity: 1;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: linear-gradient(180deg, #0f1729 0%, #1a1f3a 50%, #0f1729 100%);
    color: #ffffff;
    min-height: 100vh;
}

/* Fill iPhone notch/status bar area with dark background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top, 0);
    background-color: #0f1729;
    z-index: 9999;
    pointer-events: none;
}

/* ============================================
   GLOBAL CUSTOM SCROLLBAR STYLES
   ============================================ */

/* Custom scrollbar for all scrollable elements */
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

*::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.5);
    border-radius: 4px;
    transition: background 0.3s ease;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.7);
}

/* Firefox scrollbar styling */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.5) #0a0e27;
}

/* Ensure main content area has dark background */
main {
    background: transparent;
}

.content {
    background: transparent;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #6366f1;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Fix dropdown arrows globally */
.form-select,
select.form-select,
select.filter-select,
select {
    -webkit-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba(255,255,255,0.6)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 16px 12px !important;
    padding-right: 2.5rem !important;
}

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

.landing-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page {
    display: flex;
    flex: 1;
}

.content {
    padding-top: 1.1rem;
    flex: 1;
}

.with-sidebar {
    margin-left: 250px;
}

.full-width {
    width: 100%;
}

/* Sidebar Styles - Main positioning handled in MainLayout.razor.css */

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.75);
    padding: 0.75rem 1rem;
    border-radius: 0;
    display: flex;
    align-items: center;
}

.sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.2);
}

.nav-section-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
}

/* Accessibility: unify muted text color for readability */
.text-muted {
    color: #495057 !important; /* WCAG AA compliant per style guide */
}

/* Sidebar readability on dark gradient */
.sidebar .nav-link {
    text-shadow: 0 1px 1px rgba(0,0,0,0.25);
}

.nav-section-header {
    color: #ffffff; /* Use white in sidebar header */
    text-shadow: 0 1px 1px rgba(0,0,0,0.35);
}

/* Ensure any muted text inside the sidebar remains legible */
.sidebar .text-muted {
    color: rgba(255,255,255,0.85) !important;
    text-shadow: 0 1px 1px rgba(0,0,0,0.35);
}

.nav-section-header {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0;
}

/* Mobile navigation styles moved to MainLayout.razor.css for better organization */

/* Global mobile body class for preventing scroll when nav is open */
body.mobile-nav-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Enhanced responsive navigation utilities */
.nav-mobile-hidden {
    display: none;
}

@media (min-width: 992px) {
    .nav-mobile-hidden {
        display: block;
    }

    .nav-desktop-hidden {
        display: none;
    }
}

/* Improved focus management for navigation */
.nav-focus-trap {
    outline: none;
}

.nav-focus-trap:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#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;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* Dashboard Styles */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem;
}

.header-section {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2.5rem 0;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border-radius: 12px;
}

.dashboard-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.625rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.dashboard-title i {
    margin-right: 1rem;
    color: #fbbf24;
}

.dashboard-subtitle {
    font-size: 1.125rem;
    opacity: 0.95;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.auth-section {
    margin-bottom: 2rem;
}

.dashboard-card {
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    margin-bottom: 1.25rem;
}

/* unified styles below */
/* Unified card header style across all settings cards */
.card .card-header,
.dashboard-card .card-header {
    background: rgba(255, 255, 255, 0.02) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
    padding: 1.25rem 1.5rem;
}

.card .card-header h5, .card .card-header h6,
.dashboard-card .card-header h5, .dashboard-card .card-header h6 {
    margin-bottom: 0;
    font-weight: 600;
    color: #ffffff !important;
}

.card .card-header i,
.dashboard-card .card-header i {
    color: #6366f1;
    margin-right: 0.5rem;
}




.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-avatar {
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 50%;
    border: 3px solid #6366f1;
}

.profile-details h6 {
    margin: 0;
    font-weight: 600;
    color: #ffffff;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.625rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #6c757d;
}

.status-indicator.online {
    background-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.3);
}

.quick-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
}

.action-btn:hover {
    transform: translateY(-1px);
}

.welcome-card {
    border: none;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    min-width: 7.5rem;
}

.feature-item i {
    font-size: 2rem;
    color: #6366f1;
}

.feature-item span {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

/* Server Dashboard Styles */
.server-header {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.server-header-icon {
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
}

.server-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.server-subtitle {
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.8;
}

.owner-badge {
    background: #ffd700;
    color: #333;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.stat-card {
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    margin-bottom: 1.25rem;
}

.stat-card h4 {
    font-weight: 600;
    margin: 0.625rem 0 0.3125rem 0;
    color: #ffffff;
}

/* Breadcrumb Styles */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: rgba(255, 255, 255, 0.5);
}

.breadcrumb-item a {
    color: #6366f1;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: #8b5cf6;
    text-decoration: underline;
}

/* Stats Section */
.stat-item {
    padding: 1rem;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 600;
    color: #6366f1;
    margin: 0;
}

.stat-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    margin: 0.3125rem 0 0 0;
    font-weight: 500;
}

/* Optimized mobile styles for better space utilization */
@media (max-width: 768px) {
    .dashboard-title {
        font-size: 1.75rem;
        line-height: 1.2;
    }

    .quick-actions {
        justify-content: center;
        gap: 0.5rem;
    }

    .features {
        gap: 0.75rem;
    }

    .user-profile {
        flex-direction: column;
        text-align: center;
    }

    .server-title {
        font-size: 1.75rem;
        line-height: 1.2;
        flex-direction: column;
        align-items: flex-start;
    }

    .server-header-icon {
        width: 52px;
        height: 52px;
    }

    .owner-badge {
        margin-top: 0.5rem;
    }

    /* Server List Component Responsive - Optimized */
    .server-card {
        padding: 0.875rem;
    }

    .guild-icon {
        width: 44px;
        height: 44px;
    }

    .server-icon {
        margin-right: 0.875rem;
    }

    .server-meta {
        flex-direction: column;
        gap: 0.375rem;
    }
}

/* Threshold Slider Component Styles */
.threshold-slider-container {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.threshold-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.threshold-title {
    margin: 0;
    color: #212529;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.threshold-title i {
    color: #7289da;
}

.threshold-value-display {
    background: linear-gradient(135deg, #7289da 0%, #5b6eae 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 2px 4px rgba(114, 137, 218, 0.3);
}

.threshold-description p {
    font-size: 0.95rem;
    line-height: 1.5;
}

.threshold-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #6c757d;
}

.threshold-slider-wrapper {
    margin: 20px 0;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

.label-left, .label-right {
    display: flex;
    align-items: center;
    gap: 5px;
}

.slider-container {
    position: relative;
    margin: 20px 0;
}

.threshold-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.threshold-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #7289da;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.threshold-slider::-webkit-slider-thumb:hover {
    background: #5b6eae;
    transform: scale(1.1);
}

.threshold-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #7289da;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.threshold-slider::-moz-range-thumb:hover {
    background: #5b6eae;
    transform: scale(1.1);
}

.slider-track-fill {
    position: absolute;
    top: 50%;
    left: 0;
    height: 8px;
    background: linear-gradient(90deg, #28a745 0%, #ffc107 50%, #dc3545 100%);
    border-radius: 4px;
    transform: translateY(-50%);
    z-index: 1;
    transition: width 0.2s ease;
}

.slider-ticks {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    transform: translateY(-50%);
    z-index: 3;
}

.tick {
    position: absolute;
    width: 2px;
    height: 12px;
    background: #6c757d;
    transform: translateX(-50%) translateY(-5px);
    opacity: 0.6;
}

.threshold-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.threshold-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.threshold-actions .btn {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .threshold-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .threshold-value-display {
        align-self: flex-end;
    }

    .slider-labels {
        font-size: 0.8rem;
    }

    .threshold-actions {
        justify-content: center;
    }
}

/* Threshold Mode Component Styles */
.threshold-mode-container {
    padding: 0;
}

.threshold-modes {
    margin: 20px 0;
}

.mode-card {
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mode-card:not(.active):hover {
    border-color: #7289da;
    box-shadow: 0 4px 8px rgba(114, 137, 218, 0.2);
    transform: translateY(-2px);
}

.mode-card.active {
    border-color: #7289da;
    background: linear-gradient(135deg, rgba(114, 137, 218, 0.05) 0%, rgba(91, 110, 174, 0.05) 100%);
    box-shadow: 0 4px 12px rgba(114, 137, 218, 0.3);
}

.mode-icon {
    font-size: 2rem;
    color: #7289da;
    text-align: center;
    margin-bottom: 5px;
}

.mode-card.active .mode-icon {
    color: #5b6eae;
}

.mode-content {
    flex: 1;
}

.mode-name {
    font-weight: 600;
    color: #212529;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.mode-description {
    color: #495057;
    font-size: 0.9rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.mode-value {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
}

.mode-checkmark {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    color: #28a745;
}

.advanced-mode-wrapper {
    margin-top: 20px;
}

/* Responsive adjustments for mode cards */
@media (max-width: 768px) {
    .mode-card {
        margin-bottom: 15px;
    }
}

/* Image Test Status Cards */
.status-card {
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
}

.status-card.status-active {
    border-color: #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.05) 0%, rgba(40, 167, 69, 0.02) 100%);
}

.status-card.status-inactive {
    border-color: #e9ecef;
    opacity: 0.7;
}

.status-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.status-card.status-active .status-icon {
    color: #28a745;
}

.status-card.status-inactive .status-icon {
    color: #6c757d;
}

.status-content h6 {
    font-weight: 600;
    color: #212529;
    margin-bottom: 5px;
}

.status-content p {
    color: #495057;
    font-size: 0.9rem;
}

/* Mobile Input Field Fixes */
@media (max-width: 992px) {
    /* Fix input groups on mobile */
    .input-group {
        flex-wrap: nowrap !important;
    }

    .input-group .form-control {
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .input-group-text {
        flex-shrink: 0 !important;
    }

    /* Ensure search inputs don't overflow */
    .multi-select-search .input-group,
    .server-toolbar .input-group {
        width: 100%;
    }

    .multi-select-search .form-control,
    .server-toolbar .form-control {
        width: 100%;
        max-width: 100%;
    }

    /* Consistent search input styling */
    .multi-select-search .input-group-text {
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-right: none;
        color: rgba(255, 255, 255, 0.7);
    }

    .multi-select-search .form-control {
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-left: none;
        color: #ffffff;
    }

    .multi-select-search .form-control::placeholder {
        color: rgba(255, 255, 255, 0.4);
    }
}

@media (max-width: 576px) {
    /* Extra small devices - ensure inputs are properly sized */
    .input-group .form-control {
        font-size: 0.875rem;
    }

    .input-group-text {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* ============================================
   Blazor Reconnection Modal
   ============================================ */

/* Base modal - hidden by default */
#components-reconnect-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in-out;
}

/* Show modal when Blazor applies these classes */
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex !important;
}

/* Hide modal when connection is restored */
#components-reconnect-modal.components-reconnect-hide {
    display: none !important;
}

/* Modal content container */
.reconnect-modal-content {
    background: linear-gradient(135deg, rgba(15, 23, 41, 0.98), rgba(26, 31, 58, 0.98));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(99, 102, 241, 0.2);
    animation: slideUp 0.4s ease-out;
}

/* Icon container */
.reconnect-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #ffffff;
    line-height: 1; /* Keep the glyph centered without extra baseline space */
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

/* Icon element - ensure centering for all states */
.reconnect-icon i {
    display: inline-block; /* Size to glyph, not the container */
    line-height: 1;       /* Remove vertical baseline offset from FA */
    width: auto;
    height: auto;
}

/* Failed state icon */
#components-reconnect-modal.components-reconnect-failed .reconnect-icon,
#components-reconnect-modal.components-reconnect-rejected .reconnect-icon {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
    animation: shake 0.5s ease-in-out;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-icon i,
#components-reconnect-modal.components-reconnect-rejected .reconnect-icon i {
    content: '\f071';
}

/* Title */
.reconnect-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
}

/* Message container */
.reconnect-message {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Message states - hide all by default */
.reconnect-attempting,
.reconnect-failed,
.reconnect-rejected {
    display: none;
}

/* Show appropriate message based on state */
#components-reconnect-modal.components-reconnect-show .reconnect-attempting {
    display: block;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-failed {
    display: block;
}

#components-reconnect-modal.components-reconnect-rejected .reconnect-rejected {
    display: block;
}

/* Progress bar container */
.reconnect-progress {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1rem;
}

/* Hide progress bar when failed or rejected */
#components-reconnect-modal.components-reconnect-failed .reconnect-progress,
#components-reconnect-modal.components-reconnect-rejected .reconnect-progress {
    display: none;
}

/* Animated progress bar */
.reconnect-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #6366f1);
    background-size: 200% 100%;
    border-radius: 3px;
    animation: progressSlide 1.5s ease-in-out infinite;
}

/* Attempt counter */
.reconnect-attempts {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1.5rem;
}

/* Hide attempts counter when failed or rejected */
#components-reconnect-modal.components-reconnect-failed .reconnect-attempts,
#components-reconnect-modal.components-reconnect-rejected .reconnect-attempts {
    display: none;
}

/* Action buttons container */
.reconnect-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Hide retry button when attempting, show when failed */
#components-reconnect-modal.components-reconnect-show .btn-reconnect-retry {
    display: none;
}

#components-reconnect-modal.components-reconnect-failed .btn-reconnect-retry,
#components-reconnect-modal.components-reconnect-rejected .btn-reconnect-retry {
    display: inline-flex;
}

/* Retry button */
.btn-reconnect-retry {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-reconnect-retry:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.btn-reconnect-retry:active {
    transform: translateY(0);
}

/* Reload button */
.btn-reconnect-reload {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-reconnect-reload:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

.btn-reconnect-reload:active {
    transform: scale(0.98);
}

/* ============================================
   Animations
   ============================================ */

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

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 30px rgba(99, 102, 241, 0.6);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

@keyframes progressSlide {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 767px) {
    .reconnect-modal-content {
        padding: 2rem 1.5rem;
        max-width: 95%;
    }

    .reconnect-icon {
        width: 64px;
        height: 64px;
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .reconnect-title {
        font-size: 1.5rem;
    }

    .reconnect-message {
        font-size: 0.875rem;
    }

    .reconnect-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn-reconnect-retry,
    .btn-reconnect-reload {
        width: 100%;
        padding: 0.875rem 1.25rem;
    }
}

@media (max-width: 576px) {
    .reconnect-modal-content {
        padding: 1.5rem 1.25rem;
    }

    .reconnect-icon {
        width: 56px;
        height: 56px;
        font-size: 1.25rem;
        margin-bottom: 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .reconnect-title {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    .reconnect-message {
        font-size: 0.8125rem;
        margin-bottom: 1.25rem;
    }

    .reconnect-attempts {
        font-size: 0.8125rem;
        margin-bottom: 1.25rem;
    }
}

/* ============================================
   Accessibility
   ============================================ */

/* Ensure focus states are visible */
.btn-reconnect-retry:focus,
.btn-reconnect-reload:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    #components-reconnect-modal,
    .reconnect-modal-content,
    .reconnect-icon,
    .reconnect-progress-bar {
        animation: none;
    }

    .btn-reconnect-retry:hover,
    .btn-reconnect-reload:hover {
        transform: none;
    }
}

