/* ============================================
   LOCATION HEADER - Reusable Component
   ============================================
   This CSS file contains styles for the LocationHeader
   component, extracted from BusinessCard.razor for
   visual cohesion across the app.
   
   Used in:
   - BusinessCard.razor (card-header section with overlay)
   - MyHints.razor (locationByIDModal)
   - HintStep0_SelectBusiness.razor (business list)
   - HintStep1_WriteHint.razor (hint creation)
   
   Features:
   - 2x2 sentiment grid with S, P, F, V letters
     (Variation 14 "Outlined Letters" from 2by.html mockup)
   
   Created: January 2026
   Updated: January 2026 - Replaced spark bars with SPFV grid
   ============================================ */

/* ============================================
   THEME VARIABLES
   ============================================ */
:root {
    --loc-bg: #f8f4ff;
    --loc-surface: #ffffff;
    --loc-border: rgba(70, 39, 117, 0.12);
    --loc-text: #1a1a2e;
    --loc-text-muted: #6b6b7b;
    --loc-accent: #462775;
}

/* ============================================
   LOCATION HEADER - Main Container
   ============================================ */
.loc-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Margin variant for standalone use (not inside biz-card) */
.loc-header--spaced {
    margin-bottom: 12px;
}

/* ============================================
   LOGO / AVATAR
   ============================================ */
.loc-header__logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f0ebf8 0%, #e8e0f0 100%);
    border: 1px solid rgba(70, 39, 117, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    font-weight: 600;
    color: #462775;
    overflow: hidden;
    flex-shrink: 0;
}

/* Avatar container with draft indicator support */
.loc-header__avatar-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure images inside avatar container are properly sized and centered */
.loc-header__avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Draft indicator pencil emoji on avatar */
.loc-header__draft-indicator {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 14px;
    background-color: #ffffff;
    border-radius: 50%;
    padding: 2px;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    z-index: 1;
}

/* ============================================
   INFO SECTION (name, address, distance)
   ============================================ */
.loc-header__info {
    flex: 1;
    min-width: 0; /* Allows text truncation to work */
}

/* Business/Location Name */
.loc-header__name {
    font-size: 19px;
    font-weight: 600;
    color: var(--loc-text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Address line */
.loc-header__address {
    font-size: 13px;
    color: var(--loc-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

/* Distance indicator - simple text style */
/* Supports inline status badge via flex layout */
.loc-header__distance {
    font-size: 13px;
    color: var(--loc-text-muted);
    display: flex;
    align-items: center;
}

/* Distance indicator - pill style (for standalone/modal use) */
.loc-header__distance-pill {
    background-color: #ffffff;
    border: 2px solid #8366ac;
    color: #462775;
    margin: 8px 0 0 0;
    width: fit-content;
    padding: 2px 8px;
    display: inline-block;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

/* Photo count indicator - matches distance styling */
.loc-header__photo-count {
    font-size: 13px;
    color: var(--loc-text-muted);
    display: flex;
    align-items: center;
}

/* ============================================
   ENTITY TYPE PILL (Government entities)
   ============================================ */
.loc-header__entity-pill {
    display: inline-block;
    width: fit-content;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: bold;
    color: #0c48c6;
    background-color: #ffffff;
    border-radius: 20px;
}

/* Government entity background highlight */
.loc-header--government {
    background-color: #dde8ff;
    padding: 15px;
    border-radius: 12px;
}

/* ============================================
   CHECK-IN CONTROLS
   ============================================ */

/* Split pill container with gradient border */
.loc-header__checkin-combo {
    display: inline-flex;
    align-items: stretch;
    overflow: hidden;
    margin: 8px 8px 0px 0px;
    border-radius: 20px;
    border: 2px solid transparent;
    background-image: linear-gradient(white, white), 
                    linear-gradient(90deg, #8366ac, #4caf50);
    background-origin: border-box;
    background-clip: content-box, border-box;
}

/* Distance portion of split pill */
.loc-header__checkin-distance {
    color: #462775;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: bold;
    background-color: #ffffff;
    display: flex;
    align-items: center;
}

/* Check-in button */
.loc-header__checkin-btn {
    background-color: #e0f2d7;
    color: #187a1c;
    padding: 0px 12px;
    border: none;
    border-left: 1px solid #e0e0e0;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Checked-in state */
.loc-header__checkin-btn--checked {
    background-color: #4CAF50;
    color: white;
}

/* Draft state - gold/amber for saved drafts */
.loc-header__checkin-btn--draft {
    background-color: #DAA520;
    color: white;
}

/* Toggle icon visibility */
.loc-header__checkin-btn .icon-check {
    display: none;
}

.loc-header__checkin-btn .icon-default {
    display: inline;
}

.loc-header__checkin-btn--checked .icon-check,
.loc-header__checkin-btn--draft .icon-check {
    display: inline;
}

.loc-header__checkin-btn--checked .icon-default,
.loc-header__checkin-btn--draft .icon-default {
    display: none;
}

/* Check-in pulse animation */
@keyframes locHeaderCheckPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.loc-header__checkin-btn--checked {
    animation: locHeaderCheckPulse 0.3s ease-out;
}

/* ============================================
   SENTIMENT GRID (2x2 Letter Grid)
   Outlined squares with S, P, F, V letters
   Variation 14 style from 2by.html mockup
   ============================================ */
.loc-header__sentiment-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    width: 38px;
    height: 38px;
    cursor: pointer;
}

.loc-header__sentiment-cell {
    border-radius: 3px;
    border: 2px solid;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    transition: all 0.2s ease;
}

/* Sentiment colors for grid cells - border + subtle background fill */
/* No data - gray */
.loc-header__sentiment-cell.loc-header__sentiment--none {
    border-color: #ccc;
    background: transparent;
    color: #999;
}

/* All positive - darker green (unified with overlay) */
.loc-header__sentiment-cell.loc-header__sentiment--perfect {
    border-color: #16a34a;
    background: rgba(22, 163, 74, 0.15);
    color: #16a34a;
}

/* Mostly positive - deeper green (unified with overlay) */
.loc-header__sentiment-cell.loc-header__sentiment--positive {
    border-color: #15803d;
    background: rgba(21, 128, 61, 0.15);
    color: #15803d;
}

/* Mixed feelings - yellow/orange */
.loc-header__sentiment-cell.loc-header__sentiment--mixed {
    border-color: #FFC107;
    background: rgba(255, 193, 7, 0.15);
    color: #b38600;
}

/* Negative - darker red (unified with overlay) */
.loc-header__sentiment-cell.loc-header__sentiment--negative {
    border-color: #dc2626;
    background: rgba(220, 38, 38, 0.15);
    color: #dc2626;
}

/* ============================================
   SENTIMENT GRID → CLOSE BUTTON TRANSFORMATION
   When overlay is active, grid becomes "X" button
   ============================================ */
.loc-header__sentiment-grid--close {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: rgba(70, 39, 117, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Hide the grid cells when in close mode */
.loc-header__sentiment-grid--close .loc-header__sentiment-cell {
    display: none;
}

/* Show X icon using ::before pseudo-element */
.loc-header__sentiment-grid--close::before {
    content: '✕';
    font-size: 16px;
    font-weight: 900;
    color: var(--loc-text-muted);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Hover state for close button */
.loc-header__sentiment-grid--close:hover {
    background: rgba(70, 39, 117, 0.15);
}

.loc-header__sentiment-grid--close:hover::before {
    color: var(--loc-text);
}

/* ============================================
   CLOSE BUTTON (Shared style for action bubbles)
   Reusable close button that can be used anywhere
   ============================================ */
.loc-header__close-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(70, 39, 117, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
}

/* Show X icon using ::before pseudo-element */
.loc-header__close-btn::before {
    content: '✕';
    font-size: 16px;
    font-weight: 900;
    color: var(--loc-text-muted);
}

/* Hover state for close button */
.loc-header__close-btn:hover {
    background: rgba(70, 39, 117, 0.15);
}

.loc-header__close-btn:hover::before {
    color: var(--loc-text);
}

/* ============================================
   SENTIMENT OVERLAY
   Expandable panel showing detailed feedback
   ============================================ */
.loc-header__overlay {
    /* Hidden by default */
    display: none;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    padding: 0;
    margin-bottom: 12px;
}

.loc-header__overlay--active {
    /* Show overlay when active */
    display: flex;
    /* Simple fade-in animation */
    animation: locHeaderOverlayFadeIn 0.15s ease-out;
}

/* Smooth fade-in animation for overlay */
@keyframes locHeaderOverlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Overlay header section */
.loc-header__overlay-header {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(70, 39, 117, 0.08);
}

.loc-header__overlay-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}

/* ============================================
   OVERLAY GRID (2x2 Category Cards)
   Displays S, P, F, V categories in grid layout
   ============================================ */
.loc-header__overlay-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 10px;
}

/* Individual category card in the grid */
.loc-header__overlay-card {
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    border: 2px solid;
    background: transparent;
    transition: all 0.2s ease;
}

/* Card header with letter indicator and name */
.loc-header__overlay-card-header {
    display: flex;
    align-items: center;
    gap: 1.5px;
    padding: 10px;
}

/* Letter indicator (S, P, F, V) - matches sentiment grid style */
.loc-header__overlay-card-letter {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Category name */
.loc-header__overlay-card-name {
    font-weight: 600;
    font-size: 13px;
    color: #1a1a2e;
}

/* Sentiment badge in card */
.loc-header__overlay-card-badge {
    padding: 3px 8px;
    border-radius: 0px 0px 8px 8px;
    font-size: 11px;
    font-weight: 600;
    width: 100%;
    box-sizing: border-box;
    align-content: center;
    margin-top: 5px;
}

/* Up/down counts row - positioned at right side of header row */
.loc-header__overlay-card-counts {
    display: flex;
    gap: 6px;
    font-size: 11px;
    color: #6b6b7b;
    margin-left: auto; /* Push to right side of header flex row */
}

.loc-header__overlay-card-count {
    display: flex;
    align-items: center;
    gap: 2px;
}

.loc-header__overlay-card-count--up {
    color: #10b981;
}

.loc-header__overlay-card-count--down {
    color: #ef4444;
}

/* ============================================
   OVERLAY CARD SENTIMENT COLORS
   Border and letter colors based on sentiment
   ============================================ */

/* No data - gray */
.loc-header__overlay-card.loc-header__sentiment--none {
    border-color: #d1d5db;
    opacity: .4;
}
.loc-header__overlay-card.loc-header__sentiment--none .loc-header__overlay-card-letter {
    border-color: #ccc;
    color: #999;
}
.loc-header__overlay-card.loc-header__sentiment--none .loc-header__overlay-card-badge {
    background: #f3f4f6;
    color: #6b7280;
}

/* All positive - darker green (unified with spark grid) */
.loc-header__overlay-card.loc-header__sentiment--perfect {
    border-color: #16a34a;
}
.loc-header__overlay-card.loc-header__sentiment--perfect .loc-header__overlay-card-letter {
    border-color: #16a34a;
    background: rgba(22, 163, 74, 0.15);
    color: #16a34a;
}
.loc-header__overlay-card.loc-header__sentiment--perfect .loc-header__overlay-card-badge {
    background: #dcf1e4;
    color: #15803d;
}

/* Mostly positive - deeper green (unified with spark grid) */
.loc-header__overlay-card.loc-header__sentiment--positive {
    border-color: #15803d;
}
.loc-header__overlay-card.loc-header__sentiment--positive .loc-header__overlay-card-letter {
    border-color: #15803d;
    background: rgba(21, 128, 61, 0.15);
    color: #15803d;
}
.loc-header__overlay-card.loc-header__sentiment--positive .loc-header__overlay-card-badge {
    background: #ccfbf1;
    color: #0f766e;
}

/* Mixed feelings - yellow/orange */
.loc-header__overlay-card.loc-header__sentiment--mixed {
    border-color: #FFC107;
}
.loc-header__overlay-card.loc-header__sentiment--mixed .loc-header__overlay-card-letter {
    border-color: #FFC107;
    background: rgba(255, 193, 7, 0.15);
    color: #b38600;
}
.loc-header__overlay-card.loc-header__sentiment--mixed .loc-header__overlay-card-badge {
    background: #fef3c7;
    color: #b45309;
}

/* Negative - darker red (unified with spark grid) */
.loc-header__overlay-card.loc-header__sentiment--negative {
    border-color: #dc2626;
}
.loc-header__overlay-card.loc-header__sentiment--negative .loc-header__overlay-card-letter {
    border-color: #dc2626;
    background: rgba(220, 38, 38, 0.15);
    color: #dc2626;
}
.loc-header__overlay-card.loc-header__sentiment--negative .loc-header__overlay-card-badge {
    background: #fee2e2;
    color: #dc2626;
}

/* ============================================
   LEGACY FEEDBACK STYLES (for backward compatibility)
   These can be removed once all usages are migrated
   ============================================ */

/* Gradient fills for feedback meters (legacy) */
.loc-header__feedback-fill.loc-header__sentiment--positive {
    background: linear-gradient(90deg, #5eead4, #0d9488);
}

.loc-header__feedback-fill.loc-header__sentiment--mixed {
    background: linear-gradient(90deg, #fcd34d, #f59e0b);
}

.loc-header__feedback-fill.loc-header__sentiment--negative {
    background: linear-gradient(90deg, #fca5a5, #ef4444);
}

/* Up/Down counts section - pushed to right side of header row */
.loc-header__feedback-counts {
    display: flex;
    gap: 8px;
    font-size: 14px;
    color: #6b6b7b;
    margin-left: auto; /* Push to right side of flex row */
}

.loc-header__feedback-count {
    display: flex;
    align-items: center;
    gap: 1px;
}

.loc-header__feedback-count-icon {
    font-size: 18px;
}

/* Up arrow is green */
.loc-header__feedback-count--up .loc-header__feedback-count-icon {
    color: #10b981;
}

/* Down arrow is red */
.loc-header__feedback-count--down .loc-header__feedback-count-icon {
    color: #ef4444;
}

/* ============================================
   STICKY HEADER VARIANT
   Used in modals where header should stay fixed
   ============================================ */
.loc-header--sticky {
    position: sticky;
    top: 0;
    z-index: 99;
    background: var(--loc-bg);
    padding: 15px;
    box-shadow: 0 2px 17px 7px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border-radius: 0 0 12px 12px;
}

/* ============================================
   CARD VARIANT
   Standalone card style (outside biz-card context)
   ============================================ */
.loc-header--card {
    background: var(--loc-surface);
    border-radius: 16px;
    padding: 14px;
    border: 2px solid #7e62a8;
    box-shadow: 0 2px 8px rgba(70, 39, 117, 0.06);
}

/* ============================================
   LIST ITEM VARIANT
   For use in scrolling business lists
   ============================================ */
.loc-header--list-item {
    padding: 15px;
    border-top: 2px dotted #bb9ee3;
    cursor: pointer;
    transition: background 0.2s ease;
}

.loc-header--list-item:first-child {
    border-top: none;
}

.loc-header--list-item:hover {
    background: rgba(70, 39, 117, 0.03);
}

/* Fade-in animation for list items */
.loc-header--animate {
    opacity: 0;
    transform: translateY(10px);
    animation: locHeaderFadeInUp 0.5s forwards;
}

@keyframes locHeaderFadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   INLINE STATUS BADGES
   Shows checked-in or draft status inline with distance
   Used within .loc-header__distance via margin-left: auto
   ============================================ */

/* Inline status badge (floats right in distance row) */
.loc-header__status-inline {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: auto;
}

/* Checked-in status badge - green solid */
.loc-header__status-inline--checkedin {
    background: #4CAF50;
    color: #ffffff;
}

/* Draft status badge - orange with border */
.loc-header__status-inline--draft {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffb74d;
}

/* ============================================
   FLOATING ACTION BUBBLES
   Appears on list item tap with Write Hint/Check In options
   ============================================ */

/* List item becomes overlay container when active */
.loc-header--list-item.loc-header--bubbles-active {
    background-color: #f1e8ff;
    position: relative;
}

/* Fade the header content when bubbles overlay is active */
.loc-header--list-item.loc-header--bubbles-active > .loc-header__logo,
.loc-header--list-item.loc-header--bubbles-active > .loc-header__info,
.loc-header--list-item.loc-header--bubbles-active > .loc-header__spark-bars {
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

/* Floating bubbles container - positioned to the right */
.loc-header__bubbles {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    gap: 10px;
    z-index: 10;
}

/* Show bubbles when overlay is active */
.loc-header--list-item.loc-header--bubbles-active .loc-header__bubbles {
    display: flex;
}

/* Individual action bubble with label */
.loc-header__bubble {
    min-width: 52px;
    height: auto;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 10px 6px;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: locHeaderBubbleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
    transition: transform 0.15s ease;
}

/* Staggered animation delays for bubbles */
.loc-header__bubble:nth-child(1) { animation-delay: 0s; }
.loc-header__bubble:nth-child(2) { animation-delay: 0.1s; }
.loc-header__bubble:nth-child(3) { animation-delay: 0.15s; }

/* Bubble pop-in animation */
@keyframes locHeaderBubbleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* Bubble label text */
.loc-header__bubble-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-top: 3px;
    white-space: nowrap;
}

/* Hover state - slight scale up */
.loc-header__bubble:hover {
    transform: scale(1.05);
}

/* Write Hint bubble - white with purple text */
.loc-header__bubble--hint {
    background: var(--loc-surface);
    color: var(--loc-accent);
}

/* Check-in bubble - light green with dark green text */
.loc-header__bubble--checkin {
    background: #e0f2d7;
    color: #187a1c;
}

/* Disabled state for already checked-in users */
.loc-header__bubble--checkin:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.loc-header__bubble--checkin:disabled:hover {
    transform: scale(1);
}

/* Close button - use .loc-header__spark-bars--close for close functionality */
/* (bubble--close removed - unified with spark-bars--close) */
