/* ============================================================
   WINFLUXX — Opportunity browsing shell
   Shared sidebar/filters/stat-cards/timeline/modal/tooltip UI
   across the grant, RFP, investor, and project browsing pages.
   ============================================================ */

:root {
            --primary: #2A3ED6;
            --primary-light: #6C7CF0;
            --secondary: #17845A;
            --dark: #16213B;
            --light: #F6F4EF;
            --gray: #9AA3B8;
            --gray-light: #E4E0D6;
            --danger: #B13B3B;
            --warning: #B36A17;
            --success: #17845A;
            --surface: white;
        }
[data-bs-theme="dark"] {
            --light: #0B0F1A;
            --gray-light: #262D40;
            --surface: #151B2B;
        }
/* --dark is intentionally left unchanged across themes — it's also
   used as an always-dark tooltip background (with white text), which
   would break if inverted. Text uses of --dark get their own
   targeted dark-mode override instead, just below. */
[data-bs-theme="dark"] body,
[data-bs-theme="dark"] .tag {
            color: #E7E9F0;
        }
* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: var(--wx-font, 'Inter', sans-serif);
        }
body {
            background-color: var(--wx-paper, #F6F4EF);
            color: var(--dark);
            line-height: 1.6;
        }
.container {
            display: grid;
            grid-template-columns: 300px 1fr;
            min-height: 100vh;
        }
/* Sidebar Styles */
        .sidebar {
            background: var(--surface);
            border-right: 1px solid var(--gray-light);
            padding: 2rem 1.5rem;
            overflow-y: auto;
            position: sticky;
            top: 0;
            height: 100vh;
        }
.sidebar-header {
            margin-bottom: 2rem;
        }
.sidebar-header h2 {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--primary);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
.sidebar-header h2 i {
            color: var(--primary);
        }
.sidebar-section {
            margin-bottom: 2rem;
        }
.sidebar-section h3 {
            font-size: 0.875rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--gray);
            margin-bottom: 1rem;
        }
.filter-group {
            margin-bottom: 1.5rem;
        }
.filter-group h4 {
            font-size: 0.875rem;
            font-weight: 600;
            margin-bottom: 0.75rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
.filter-group h4 span {
            font-size: 0.75rem;
            color: var(--primary);
            cursor: pointer;
        }
.filter-options {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
.filter-option {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.875rem;
        }
.filter-option input {
            accent-color: var(--primary);
        }
.recommended-grants {
            background: var(--light);
            border-radius: 0;
            padding: 1rem;
            margin-top: 1rem;
        }
.recommended-grant {
            padding: 0.75rem 0;
            border-bottom: 1px solid var(--gray-light);
            cursor: pointer;
            transition: all 0.2s;
        }
.recommended-grant:hover {
            background: rgba(42, 62, 214, 0.05);
        }
.recommended-grant:last-child {
            border-bottom: none;
        }
.recommended-grant h5 {
            font-size: 0.875rem;
            font-weight: 600;
            margin-bottom: 0.25rem;
        }
.recommended-grant p {
            font-size: 0.75rem;
            color: var(--gray);
        }
/* Main Content Styles */
        .main-content {
            padding: 2rem;
            overflow-y: auto;
        }
.header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 1rem;
            margin-bottom: 2rem;
        }
.header h1 {
            font-size: 1.75rem;
            font-weight: 700;
        }
.header-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
            flex: 1 1 auto;
            justify-content: flex-end;
            min-width: 0;
        }
.search-bar {
            position: relative;
            flex: 1 1 260px;
            min-width: 0;
            max-width: 500px;
        }
.search-bar input {
            width: 100%;
            padding: 0.75rem 1rem 0.75rem 2.5rem;
            border: 1px solid var(--gray-light);
            border-radius: 3px;
            font-size: 0.875rem;
            background-color: var(--surface);
            transition: all 0.2s;
        }
.search-bar input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(42, 62, 214, 0.1);
        }
.search-bar i {
            position: absolute;
            left: 1rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--gray);
        }
.view-toggle {
            display: flex;
            flex-shrink: 0;
            background: var(--surface);
            border: 1px solid var(--gray-light);
            border-radius: 3px;
            overflow: hidden;
        }
.view-toggle button {
            padding: 0.5rem 1rem;
            border: none;
            background: none;
            cursor: pointer;
            color: var(--gray);
            transition: all 0.2s;
        }
.view-toggle button.active {
            background: var(--primary);
            color: white;
        }
.view-toggle button:not(.active):hover {
            background: var(--gray-light);
        }
.sort-options {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
        }
.sort-options select {
            padding: 0.5rem 1rem;
            border: 1px solid var(--gray-light);
            border-radius: 3px;
            font-size: 0.875rem;
            background-color: var(--surface);
            cursor: pointer;
        }
.stats {
            display: flex;
            gap: 1rem;
            margin-bottom: 1.5rem;
        }
.stat-card {
            background: var(--surface);
            border-radius: 0;
            padding: 1rem;
            flex: 1;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
            transition: all 0.2s;
        }
.stat-card:hover {
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
.stat-card h3 {
            font-size: 0.875rem;
            color: var(--gray);
            margin-bottom: 0.5rem;
        }
.stat-card p {
            font-size: 1.5rem;
            font-weight: 700;
        }
.stat-card p span {
            font-size: 0.875rem;
            font-weight: normal;
            color: var(--gray);
        }
.alignment-label {
            display: flex;
            justify-content: space-between;
            font-size: 0.75rem;
            margin-bottom: 0.25rem;
        }
.alignment-bar {
            height: 8px;
            background: var(--gray-light);
            border-radius: 2px;
            overflow: hidden;
        }
.alignment-progress {
            height: 100%;
            background: linear-gradient(to right, var(--primary), var(--secondary));
            border-radius: 2px;
            transition: width 0.5s ease-in-out;
        }
.meta-item {
            display: flex;
            align-items: center;
            gap: 0.25rem;
            font-size: 0.75rem;
            color: var(--gray);
        }
.meta-item i {
            font-size: 0.875rem;
        }
.action-btn {
            width: 32px;
            height: 32px;
            border-radius: 3px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: none;
            border: 1px solid var(--gray-light);
            color: var(--gray);
            cursor: pointer;
            transition: all 0.2s;
        }
.action-btn:hover {
            background: var(--gray-light);
        }
.primary-btn {
            background: var(--primary);
            color: white;
            border: none;
            padding: 0.5rem 1rem;
            border-radius: 3px;
            font-size: 0.875rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
.primary-btn:hover {
            background: var(--primary-light);
        }
.tag {
            display: inline-block;
            padding: 0.25rem 0.5rem;
            background: var(--gray-light);
            border-radius: 2px;
            font-size: 0.75rem;
            color: var(--dark);
            margin-right: 0.5rem;
            margin-bottom: 0.5rem;
        }
.tag.primary {
            background: var(--primary);
            color: white;
        }
.tag.secondary {
            background: var(--secondary);
            color: white;
        }
.tag.warning {
            background: var(--warning);
            color: white;
        }
/* AI Recommendation Badge */
        .ai-badge {
            position: absolute;
            top: 1rem;
            right: 1rem;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            color: white;
            padding: 0.25rem 0.5rem;
            border-radius: 2px;
            font-size: 0.75rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 0.25rem;
            z-index: 2;
        }
/* Priority Indicator */
        .priority-indicator {
            position: absolute;
            top: -1px;
            left: -1px;
            width: 8px;
            height: calc(100% + 2px);
            background: var(--warning);
            border-radius: 0;
            z-index: 1;
        }
/* Saved Indicator */
        .saved-indicator {
            position: absolute;
            top: 1rem;
            left: 1rem;
            color: var(--warning);
            z-index: 2;
        }
/* Match Percentage Animation -- a badge that pulses forever reads as
   distracting/unfinished on a page meant to feel calm and confident.
   Plays three times on load to draw the eye once, then settles. */
        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.05); }
            100% { transform: scale(1); }
        }
.high-match {
            animation: pulse 1.6s ease-in-out 3;
        }
.table-alignment {
            width: 100px;
        }
.table-actions {
            display: flex;
            gap: 0.5rem;
        }
/* Timeline View */
        .timeline-view {
            position: relative;
            padding-left: 2rem;
            margin-top: 2rem;
        }
.timeline-line {
            position: absolute;
            left: 1rem;
            top: 0;
            bottom: 0;
            width: 2px;
            background: var(--gray-light);
        }
.timeline-item {
            position: relative;
            padding-bottom: 2rem;
            padding-left: 2rem;
        }
.timeline-dot {
            position: absolute;
            left: 0.5rem;
            top: 0;
            width: 1.5rem;
            height: 1.5rem;
            border-radius: 2px;
            background: var(--primary);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 0.75rem;
        }
.timeline-content {
            background: var(--surface);
            border-radius: 0;
            padding: 1.5rem;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        }
/* Modal Styles */
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            opacity: 0;
            pointer-events: none;
            transition: all 0.3s;
        }
/* Bootstrap's own CSS (also loaded on every page these modals appear
   on) defines a global .modal-content { pointer-events: auto } rule,
   using the exact same class name as this custom modal. That rule
   wins over plain inheritance from .modal's pointer-events: none
   above, re-enabling clicks on everything inside .modal-content --
   including .modal-header, which is position: sticky and spans the
   full width of the viewport at the top -- even while the modal is
   fully transparent and supposedly inert. In practice this silently
   blocked most of the page's real controls (view toggles, filters,
   sort) underneath it. Scoped to :not(.active) so the real, visible
   modal content still works normally once actually opened. */
.modal:not(.active) .modal-content {
            pointer-events: none;
        }
.modal.active {
            opacity: 1;
            pointer-events: all;
        }
.modal-content {
            background: var(--surface);
            border-radius: 0;
            width: 90%;
            max-width: 1200px;
            max-height: 90vh;
            overflow-y: auto;
            transform: translateY(20px);
            transition: all 0.3s;
        }
.modal.active .modal-content {
            transform: translateY(0);
        }
.modal-header {
            padding: 1.5rem;
            border-bottom: 1px solid var(--gray-light);
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: sticky;
            top: 0;
            background: var(--surface);
            z-index: 10;
        }
.modal-header h2 {
            font-size: 1.5rem;
            font-weight: 700;
        }
.modal-close {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: var(--gray);
        }
.modal-body {
            padding: 1.5rem;
        }
.modal-section {
            margin-bottom: 2rem;
        }
.modal-section h3 {
            font-size: 1.125rem;
            font-weight: 600;
            margin-bottom: 1rem;
            color: var(--primary);
        }
.modal-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1.5rem;
        }
.modal-footer {
            padding: 1.5rem;
            border-top: 1px solid var(--gray-light);
            display: flex;
            justify-content: flex-end;
            gap: 1rem;
        }
/* Tooltip Styles */
        .tooltip {
            position: relative;
            display: inline-block;
        }
.tooltip .tooltip-text {
            visibility: hidden;
            width: 300px;
            background-color: var(--dark);
            color: white;
            text-align: left;
            border-radius: 2px;
            padding: 1rem;
            position: absolute;
            z-index: 1;
            bottom: 125%;
            left: 50%;
            transform: translateX(-50%);
            opacity: 0;
            transition: opacity 0.3s;
            font-size: 0.875rem;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
.tooltip .tooltip-text::after {
            content: "";
            position: absolute;
            top: 100%;
            left: 50%;
            margin-left: -5px;
            border-width: 5px;
            border-style: solid;
            border-color: var(--dark) transparent transparent transparent;
        }
.tooltip:hover .tooltip-text {
            visibility: visible;
            opacity: 1;
        }
/* Mobile menu toggle */
        .mobile-menu-toggle {
            display: none;
            position: fixed;
            bottom: 18px;
            left: 50%;
            transform: translateX(-50%);
            height: 46px;
            padding: 0 20px;
            gap: 9px;
            border-radius: 3px;
            background: var(--primary);
            color: white;
            border: none;
            font: inherit;
            font-size: 14.5px;
            font-weight: 600;
            box-shadow: 0 10px 24px -8px rgba(33, 47, 176, 0.55), 0 2px 6px rgba(16, 24, 40, 0.18);
            z-index: 90;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }
@media (max-width: 1024px) {
            .mobile-menu-toggle {
                display: flex;
            }
        }
/* Empty State */
        .empty-state {
            text-align: center;
            padding: 3rem;
            background: var(--surface);
            border-radius: 0;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        }
.empty-state i {
            font-size: 3rem;
            color: var(--gray-light);
            margin-bottom: 1rem;
        }
/* Filter-section "Reset" links -- used on grant_page.html, rfp_page.html,
   and investor_page.html with no rule anywhere, so they rendered as plain
   text with no indication they were clickable. */
.reset-filters {
    cursor: pointer;
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--primary, #2A3ED6);
    float: right;
}
.reset-filters:hover { text-decoration: underline; }
