/* ==========================================================================
   BNI Texas Chapter Finder — Styles
   Migrated from inline <style> + polish pass
   ========================================================================== */

/* --- Material Symbols configuration --- */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* --- Page background --- */
body {
    background-image: radial-gradient(circle at top right, #1e1b4b, #0f172a 40%);
    background-attachment: fixed;
}

/* --- Screen reader only --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* --- Glass panel --- */
.glass-panel {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- Card hover effect --- */
.card-hover {
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.25s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    border-color: rgba(99, 102, 241, 0.3);
}

/* ==========================================================================
   Combobox — Dropdown
   ========================================================================== */

.combobox-list {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.5rem);
    z-index: 1000;
    max-height: 18rem;
    overflow-y: auto;
    border-radius: 1rem;
    border: 1px solid rgba(100, 116, 139, 0.5);
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 20px 40px rgba(2, 6, 23, 0.65);
    padding: 0.5rem;
    /* Transition for smooth open/close */
    opacity: 0;
    transform: translateY(-4px);
}

.combobox-list--open {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: combobox-enter 0.15s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes combobox-enter {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Combobox option --- */

.combobox-option {
    border: 1px solid transparent;
    border-radius: 0.75rem;
    color: #cbd5e1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    font-size: 0.875rem;
    transition: background-color 0.1s ease-out, border-color 0.1s ease-out;
}

.combobox-option-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.combobox-option:hover,
.combobox-option--active {
    background: rgba(51, 65, 85, 0.75);
    border-color: rgba(79, 70, 229, 0.25);
    color: #f8fafc;
}

.combobox-option--selected {
    background: rgba(79, 70, 229, 0.12);
    border-color: rgba(129, 140, 248, 0.35);
    color: #e0e7ff;
}

.combobox-option--include {
    border-color: rgba(16, 185, 129, 0.35);
}

.combobox-option--exclude {
    border-color: rgba(244, 63, 94, 0.35);
}

/* --- Combobox option action buttons --- */

.combobox-option-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
}

.combobox-option-action {
    border-radius: 9999px;
    border: 1px solid rgba(100, 116, 139, 0.5);
    background: rgba(15, 23, 42, 0.6);
    color: #94a3b8;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.35rem 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background-color 0.15s ease-out,
                border-color 0.15s ease-out,
                color 0.15s ease-out;
}

.combobox-option-action:focus-visible {
    outline: 2px solid rgba(129, 140, 248, 0.7);
    outline-offset: 1px;
}

.combobox-option-action--include:hover,
.combobox-option-action--include.combobox-option-action--active {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(6, 95, 70, 0.45);
    color: #a7f3d0;
}

.combobox-option-action--exclude:hover,
.combobox-option-action--exclude.combobox-option-action--active {
    border-color: rgba(244, 63, 94, 0.5);
    background: rgba(136, 19, 55, 0.45);
    color: #fecdd3;
}

.combobox-option-subtitle {
    color: #64748b;
    font-size: 0.75rem;
}

.combobox-option-check {
    color: #a5b4fc;
    font-weight: 700;
    margin-left: auto;
}

/* ==========================================================================
   Combobox — Pills (selected items)
   ========================================================================== */

.combobox-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    transition: opacity 0.15s ease-out;
}

.combobox-pill--include {
    border: 1px solid rgba(16, 185, 129, 0.35);
    background: rgba(6, 95, 70, 0.35);
    color: #a7f3d0;
}

.combobox-pill--exclude {
    border: 1px solid rgba(244, 63, 94, 0.3);
    background: rgba(136, 19, 55, 0.3);
    color: #fecdd3;
}

.combobox-pill-badge {
    border-radius: 9999px;
    padding: 0.1rem 0.35rem;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.combobox-pill--include .combobox-pill-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.combobox-pill--exclude .combobox-pill-badge {
    background: rgba(244, 63, 94, 0.2);
    color: #fda4af;
}

.combobox-pill-remove {
    padding: 0.125rem;
    border: none;
    background: transparent;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fda4af;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease-out, color 0.15s ease-out;
}

.combobox-pill--include .combobox-pill-remove {
    color: #6ee7b7;
}

.combobox-pill-remove:hover {
    background: rgba(244, 63, 94, 0.2);
    color: #ffe4e6;
}

.combobox-pill--include .combobox-pill-remove:hover {
    background: rgba(16, 185, 129, 0.2);
    color: #d1fae5;
}

.combobox-pill-remove:focus-visible {
    outline: 2px solid rgba(129, 140, 248, 0.7);
    outline-offset: 1px;
}

/* ==========================================================================
   Pill toggle buttons (Day / Type filters)
   ========================================================================== */

.pill-toggle:focus-visible {
    outline: 2px solid rgba(129, 140, 248, 0.7);
    outline-offset: 1px;
}

.pill-toggle:active {
    transform: scale(0.95);
    transition-duration: 0.05s;
}

/* ==========================================================================
   Selected industries container — hide border when empty
   ========================================================================== */

#selected-industries:empty {
    display: none;
}

/* ==========================================================================
   Staggered card entrance — choreographed reveal on page load
   ========================================================================== */

.card-enter {
    opacity: 0;
    transform: translateY(8px);
    animation: card-appear 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: calc(var(--i, 0) * 40ms);
}

@keyframes card-appear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Combobox chevron rotation on open
   ========================================================================== */

.combobox-chevron {
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.combobox-chevron--open {
    transform: rotate(180deg);
}

/* ==========================================================================
   Sort link — active underline indicator
   ========================================================================== */

.sort-link {
    position: relative;
    padding-bottom: 2px;
}

.sort-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.sort-link:hover::after {
    transform: scaleX(1);
}

.sort-link--active::after {
    transform: scaleX(1);
    background: #818cf8;
}

/* ==========================================================================
   Visit button — satisfying active press
   ========================================================================== */

.btn-visit:active {
    transform: translateY(1px) scale(0.97);
    box-shadow: none;
    transition-duration: 0.05s;
}

/* ==========================================================================
   Empty state icon — subtle breathing
   ========================================================================== */

.empty-icon {
    animation: icon-breathe 3s ease-in-out infinite;
}

@keyframes icon-breathe {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.65; }
}

/* ==========================================================================
   Keyboard shortcut hint
   ========================================================================== */

.kbd-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.25rem;
    border: 1px solid rgba(100, 116, 139, 0.4);
    background: rgba(15, 23, 42, 0.5);
    color: rgba(148, 163, 184, 0.6);
    font-size: 0.625rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
    pointer-events: none;
    transition: opacity 0.15s ease-out;
}

.kbd-hint--hidden {
    opacity: 0;
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .card-hover:hover {
        transform: none;
    }

    .combobox-list--open {
        animation: none;
    }

    .card-enter {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .empty-icon {
        animation: none;
        opacity: 0.5;
    }

    .pill-toggle:active {
        transform: none;
    }

    .btn-visit:active {
        transform: none;
    }
}
