/* ============================================
   BRHUB PREMIUM ADVANCED SEARCH CANVAS
   Enhanced Design with Logo Color Palette

   Design Philosophy:
   - Classic elegance inspired by BRHUB branding
   - Ultra-compact, space-efficient layout
   - International medical/professional aesthetic
   - Premium light theme with trust-building colors
   ============================================ */

:root {
    /* BRHUB Brand Colors - Extracted from Logo */
    --brhub-navy: #003366;           /* Primary navy from logo */
    --brhub-navy-dark: #002855;      /* Deeper navy for depth */
    --brhub-navy-light: #004080;     /* Lighter navy for accents */
    --brhub-green: #00875A;          /* Medical cross green */
    --brhub-green-light: #00A372;    /* Lighter green accent */
    --brhub-green-dark: #006B48;     /* Darker green for depth */

    /* Professional Neutrals - Classic & Timeless */
    --neutral-50: #fafbfc;
    --neutral-100: #f5f7fa;
    --neutral-200: #edf2f7;
    --neutral-300: #e2e8f0;
    --neutral-400: #cbd5e1;
    --neutral-500: #94a3b8;
    --neutral-600: #64748b;
    --neutral-700: #475569;
    --neutral-800: #334155;
    --neutral-900: #1e293b;

    /* Semantic Colors - Medical/Professional */
    --success-color: #00875A;        /* Using BRHUB green */
    --warning-color: #d97706;
    --error-color: #dc2626;
    --info-color: #003366;           /* Using BRHUB navy */

    /* Premium Shadows - Subtle & Sophisticated */
    --shadow-xs: 0 1px 2px 0 rgba(0, 51, 102, 0.04);
    --shadow-sm: 0 1px 3px 0 rgba(0, 51, 102, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 51, 102, 0.08), 0 2px 4px -1px rgba(0, 51, 102, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 51, 102, 0.08), 0 4px 6px -2px rgba(0, 51, 102, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 51, 102, 0.08), 0 10px 10px -5px rgba(0, 51, 102, 0.04);

    /* Typography - Classic & Readable */
    --font-serif: 'Georgia', 'Times New Roman', serif;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Helvetica Neue', Arial, sans-serif;

    /* Ultra-Compact Spacing Scale */
    --space-xs: 0.25rem;   /* 4px */
    --space-sm: 0.5rem;    /* 8px */
    --space-md: 0.75rem;   /* 12px */
    --space-lg: 1rem;      /* 16px */
    --space-xl: 1.25rem;   /* 20px */
    --space-2xl: 1.5rem;   /* 24px */

    /* Refined Transitions */
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Border Radius - Classic Refinement */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 12px;
}

/* ============================================
   Canvas Container & Overlay
   ============================================ */

.advanced-search-canvas {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.advanced-search-canvas.active {
    display: flex;
    opacity: 1;
}

.canvas-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 51, 102, 0.35);
    backdrop-filter: blur(3px);
    cursor: pointer;
    animation: fadeIn 0.3s ease;
}

/* ============================================
   Canvas Content - Premium Container
   ============================================ */

.canvas-content {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 850px;
    height: 100vh;
    background: #ffffff;
    box-shadow: -6px 0 28px rgba(0, 51, 102, 0.12);
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* ============================================
   Premium Header - BRHUB Brand Colors
   ============================================ */

.canvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    background: linear-gradient(135deg, var(--brhub-navy) 0%, var(--brhub-navy-dark) 100%);
    color: #ffffff;
    border-bottom: 2px solid var(--brhub-green);
    position: relative;
    min-height: 60px;
}

.canvas-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
    transparent,
    var(--brhub-green) 30%,
    var(--brhub-green) 70%,
    transparent
    );
}

.canvas-header-content {
    flex: 1;
}

.canvas-title {
    font-family: var(--font-sans);
    font-size: 19px;
    font-weight: 700;
    margin: 0 0 3px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
    color: white;
    text-transform: uppercase;
}

.canvas-title i {
    font-size: 18px;
    color: var(--brhub-green);
}

.canvas-subtitle {
    margin: 0;
    font-size: 12px;
    opacity: 0.8;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.9);
}

.canvas-close {
    width: 32px;
    height: 32px;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
    font-size: 16px;
}

.canvas-close:hover {
    background: var(--brhub-green);
    border-color: var(--brhub-green);
    transform: scale(1.05);
}

/* ============================================
   Canvas Body - Compact Scrollable Area
   ============================================ */

.canvas-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    background: var(--neutral-100);
}

.canvas-body::-webkit-scrollbar {
    width: 5px;
}

.canvas-body::-webkit-scrollbar-track {
    background: var(--neutral-200);
}

.canvas-body::-webkit-scrollbar-thumb {
    background: var(--neutral-400);
    border-radius: 3px;
}

.canvas-body::-webkit-scrollbar-thumb:hover {
    background: var(--brhub-navy);
}

/* ============================================
   Section Styling - Professional & Compact
   ============================================ */

.section-title {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 700;
    color: var(--brhub-navy);
    margin: 0 0 var(--space-md) 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--brhub-green);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.section-title i {
    color: var(--brhub-green);
    font-size: 14px;
}

/* ============================================
   Search Type Selector - BRHUB Branded Design
   ============================================ */

.search-type-selector {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--neutral-300);
}

.type-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: var(--space-sm);
}

.type-btn {
    padding: var(--space-md) var(--space-sm);
    border: 1.5px solid var(--neutral-300);
    background: #ffffff;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--neutral-700);
    position: relative;
    overflow: hidden;
    min-height: 70px;
}

.type-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brhub-green), var(--brhub-navy));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.type-btn i {
    font-size: 22px;
    color: var(--brhub-navy);
    transition: var(--transition-base);
}

.type-btn:hover {
    border-color: var(--brhub-navy);
    background: var(--neutral-50);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.type-btn.active {
    border-color: var(--brhub-green);
    background: linear-gradient(135deg,
    var(--brhub-navy) 0%,
    var(--brhub-navy-light) 100%
    );
    color: #ffffff;
    box-shadow: var(--shadow-lg);
}

.type-btn.active::before {
    transform: scaleX(1);
}

.type-btn.active i {
    color: var(--brhub-green);
}

/* ============================================
   Filter Sections - Refined & Compact
   ============================================ */

.common-filters-section,
.type-specific-filters {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--neutral-300);
    animation: fadeInUp 0.3s ease;
}

/* ============================================
   Filters Grid - Ultra-Compact Layout
   ============================================ */

.filters-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group.full-width {
    grid-column: 1 / -1;
}

.filter-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--brhub-navy);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.filter-label i {
    color: var(--brhub-green);
    font-size: 12px;
}

/* ============================================
   Premium Form Inputs - BRHUB Accent
   ============================================ */

.filter-input,
.filter-select {
    padding: 8px 11px;
    border: 1.5px solid var(--neutral-300);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--neutral-800);
    background: #ffffff;
    transition: var(--transition-base);
    font-family: var(--font-sans);
    line-height: 1.4;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--brhub-green);
    box-shadow: 0 0 0 3px rgba(0, 135, 90, 0.1);
    background: var(--neutral-50);
}

.filter-input::placeholder {
    color: var(--neutral-500);
    font-size: 12px;
}

/* Select Arrow Styling - BRHUB Navy */
.filter-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23003366' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

/* ============================================
   Premium Checkbox Design - BRHUB Green
   ============================================ */

.checkbox-wrapper {
    display: flex;
    align-items: center;
    padding: var(--space-md);
    background: var(--neutral-50);
    border-radius: var(--radius-md);
    border: 1.5px solid var(--neutral-300);
    transition: var(--transition-base);
    cursor: pointer;
}

.checkbox-wrapper:hover {
    border-color: var(--brhub-green);
    background: var(--neutral-100);
}

.checkbox-wrapper:has(input:checked) {
    background: rgba(0, 135, 90, 0.04);
    border-color: var(--brhub-green);
    box-shadow: 0 0 0 3px rgba(0, 135, 90, 0.05);
}

.checkbox-wrapper input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--brhub-green);
}

.checkbox-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--neutral-800);
    cursor: pointer;
    user-select: none;
    margin: 0;
}

/* ============================================
   Premium Footer - Refined Action Bar
   ============================================ */

.canvas-footer {
    padding: var(--space-md) var(--space-xl);
    background: #ffffff;
    border-top: 2px solid var(--neutral-300);
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
    box-shadow: 0 -4px 6px -1px rgba(0, 51, 102, 0.03);
    min-height: 56px;
    align-items: center;
}

.btn-primary,
.btn-secondary {
    padding: 9px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.btn-primary {
    background: linear-gradient(135deg,
    var(--brhub-green) 0%,
    var(--brhub-green-dark) 100%
    );
    color: #ffffff;
    box-shadow: var(--shadow-md);
    border: 1.5px solid var(--brhub-green-dark);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg,
    var(--brhub-green-light) 0%,
    var(--brhub-green) 100%
    );
}

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

.btn-secondary {
    background: #ffffff;
    color: var(--brhub-navy);
    border: 1.5px solid var(--neutral-400);
}

.btn-secondary:hover {
    background: var(--neutral-100);
    border-color: var(--brhub-navy);
}

/* ============================================
   Premium Loading State - BRHUB Branded
   ============================================ */

.search-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner i {
    font-size: 38px;
    color: var(--brhub-green);
    margin-bottom: 10px;
    animation: spin 1s linear infinite;
}

.loading-spinner p {
    font-size: 14px;
    font-weight: 600;
    color: var(--brhub-navy);
    margin: 0;
    letter-spacing: 0.02em;
}

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

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

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   Responsive Design - Maintained Elegance
   ============================================ */

@media (max-width: 768px) {
    .canvas-content {
        max-width: 100%;
    }

    .canvas-header {
        padding: var(--space-md) var(--space-lg);
        min-height: 56px;
    }

    .canvas-title {
        font-size: 16px;
    }

    .canvas-subtitle {
        font-size: 11px;
    }

    .canvas-body {
        padding: var(--space-md);
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .type-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .canvas-footer {
        padding: var(--space-md) var(--space-lg);
        flex-direction: column;
        min-height: auto;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .canvas-title {
        font-size: 15px;
    }

    .type-buttons {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 12px;
    }

    .type-btn {
        min-height: 65px;
    }
}

/* ============================================
   Premium Details & Polish
   ============================================ */

/* Focus visible for accessibility - BRHUB Green */
.type-btn:focus-visible,
.filter-input:focus-visible,
.filter-select:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible {
    outline: 2px solid var(--brhub-green);
    outline-offset: 2px;
}

/* Smooth transitions for all interactive elements */
button, input, select {
    transition: var(--transition-base);
}

/* Premium text selection - BRHUB Branded */
::selection {
    background: var(--brhub-green);
    color: #ffffff;
}

/* Refined scrollbar for all containers */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--brhub-navy) var(--neutral-200);
}

/* ============================================
   Additional Premium Enhancements
   ============================================ */

/* Subtle gradient background for sections */
.common-filters-section::before,
.type-specific-filters::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
    var(--brhub-green),
    var(--brhub-navy),
    var(--brhub-green)
    );
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.common-filters-section,
.type-specific-filters {
    position: relative;
}

.common-filters-section:hover::before,
.type-specific-filters:hover::before {
    opacity: 0.15;
}

/* Professional disabled state */
.filter-input:disabled,
.filter-select:disabled {
    background: var(--neutral-200);
    color: var(--neutral-500);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Enhanced button states */
.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Refined focus states for better accessibility */
.canvas-close:focus-visible {
    outline: 2px solid var(--brhub-green);
    outline-offset: 2px;
}
