/* ============================================
   BUSINESS CARD - NEW DESIGN
   ============================================
   This CSS file contains styles for the redesigned
   business card component (BusinessCard.razor).
   
   Based on mockup: hint-app-layouts-v2.html
   Created: January 2026
   ============================================ */

/* ============================================
   THEME VARIABLES
   ============================================ */
:root {
    --biz-bg: #f8f4ff;
    --biz-surface: #ffffff;
    --biz-surface-hover: #f0ebf8;
    --biz-border: rgba(70, 39, 117, 0.12);
    --biz-text: #1a1a2e;
    --biz-text-muted: #6b6b7b;
    --biz-accent: #462775;
}

/* ============================================
   CARD LIST CONTAINER
   ============================================ */
.biz-card-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px;
    position: relative;
    z-index: 1;
}

/* ============================================
   BUSINESS CARD
   ============================================ */

.biz-card {
    background: var(--biz-surface);
    border-radius: 16px;
    padding: 14px;
    margin: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(70, 39, 117, 0.06);
    /* Flexbox for proper element ordering */
    display: flex;
    flex-direction: column;
    position: relative;
    border: 2px solid #7e62a8;
}

.biz-cards-list .biz-card:first-of-type {
  margin-top: 20px;
}

/* Ensure card-header always appears first via order */
.biz-card .card-header {
    order: 1;
}

/* Overlay appears after header (order: 2) */
.biz-card .sentiment-overlay {
    order: 2;
}

/* Other content follows */
.biz-card .hint-block { order: 3; }
.biz-card .photo-carousel { order: 4; }
.biz-card .reaction-strip { order: 5; }

/* ============================================
   CARD HEADER
   ============================================ */
.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

/* Business logo/avatar */
.biz-logo {
    width: 50px;
    height: 50px;
    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;
}

.biz-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Business info container */
.biz-info {
    flex: 1;
    min-width: 0; /* Allows text truncation */
}

/* Business name */
.biz-card .biz-name {
    font-size: 19px;
    font-weight: 600;
    color: var(--biz-text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Distance indicator */
.biz-card .biz-distance {
    font-size: 13px;
    color: var(--biz-text-muted);
}

/* ============================================
   VERTICAL STACKED SPARK BARS
   Compact mini sentiment indicator for card header
   ============================================ */
.spark-bars-6b {
    display: flex;
    gap: 5px;
    flex-direction: column;
    cursor: pointer;
}


.spark-bars-6b .spark-row {
    display: flex;
    align-items: center;
    gap: 3px;
}

.spark-bars-6b .spark-track {
    width: 45px;
    height: 5px;
    background: #f0e8ff;
    border-radius: 1px;
    overflow: hidden;
}

.spark-bars-6b .spark-fill {
    height: 100%;
    border-radius: 1px;
    transition: width 0.3s ease;
}

/* Sentiment colors for spark bars */
.spark-bars-6b .spark-fill.positive { background: #10b981; }
.spark-bars-6b .spark-fill.mixed { background: #f59e0b; }
.spark-bars-6b .spark-fill.negative { background: #ef4444; }

/* ============================================
   SENTIMENT OVERLAY
   Expanded view when clicking spark bars
   ============================================ */
.sentiment-overlay {
    /* Hidden by default */
    display: none;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    padding: 0;
    order: 2;
    margin-bottom: 12px;
}

.sentiment-overlay.active {
    /* Show overlay below card-header using normal flow */
    display: flex;
    /* Simple fade-in animation */
    animation: overlayFadeIn 0.15s ease-out;
}

/* Smooth fade-in animation for overlay */
@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Hide other card content when overlay is active, but keep card-header visible */
.biz-card.overlay-active > *:not(.sentiment-overlay):not(.card-header) {
    display: none;
}

/* Transform spark-bars into a close X button when overlay is active */
.biz-card.overlay-active .spark-bars-6b {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: rgba(70, 39, 117, 0.08);
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Hide the spark rows when overlay is active */
.biz-card.overlay-active .spark-bars-6b .spark-row {
    display: none;
}

/* Show X icon using ::before pseudo-element */
.biz-card.overlay-active .spark-bars-6b::before {
    content: '✕';
    font-size: 16px;
    font-weight: 900;
    color: var(--biz-text-muted);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.biz-card.overlay-active .spark-bars-6b:hover {
    background: rgba(70, 39, 117, 0.15);
}

.biz-card.overlay-active .spark-bars-6b:hover::before {
    color: var(--biz-text);
}

/* ============================================
   REFINED HORIZONTAL METERS OVERLAY
   Human-centered feedback card style
   ============================================ */
.refined-card {
    padding: 0;
}

.refined-header {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(70, 39, 117, 0.08);
}

.refined-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}

.refined-body {
    padding: 6px;
}

/* Feedback row for each sentiment category */
.feedback-row {
    padding: 10px;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.feedback-row:hover {
    background: rgba(70, 39, 117, 0.03);
}

.feedback-row + .feedback-row {
    border-top: 1px solid rgba(70, 39, 117, 0.06);
}

.feedback-row__header {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 6px;
    gap: 10px;
    flex-direction: row;
    align-items: center;
}

.feedback-row__category {
    display: flex;
    align-items: center;
    gap: 8px;
}

.feedback-row__icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: rgba(70, 39, 117, 0.06);
}

.feedback-row__name {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a2e;
}

.feedback-row__badge {
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}

.feedback-row__badge.positive {
    background: #ccfbf1;
    color: #0f766e;
}

.feedback-row__badge.mixed {
    background: #fef3c7;
    color: #b45309;
}

.feedback-row__badge.negative {
    background: #fee2e2;
    color: #dc2626;
}

/* Meter/progress bar for sentiment */
.feedback-row__meter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.feedback-row__track {
    flex: 1;
    height: 10px;
    background: rgba(70, 39, 117, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.feedback-row__fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.feedback-row__fill.positive {
    background: linear-gradient(90deg, #5eead4, #0d9488);
}

.feedback-row__fill.mixed {
    background: linear-gradient(90deg, #fcd34d, #f59e0b);
}

.feedback-row__fill.negative {
    background: linear-gradient(90deg, #fca5a5, #ef4444);
}

/* Counts (up/down arrows) */
.feedback-row__counts {
    display: flex;
    gap: 8px;
    font-size: 14px;
    color: #6b6b7b;
    min-width: 48px;
    justify-content: flex-end;
}

.feedback-row__count {
    display: flex;
    align-items: center;
    gap: 1px;
}

.feedback-row__count-icon {
    font-size: 18px;
}

/* Up arrow (first count) is green */
.feedback-row__count:first-child .feedback-row__count-icon {
    color: #10b981;
}

/* Down arrow (second count) is red */
.feedback-row__count:last-child .feedback-row__count-icon {
    color: #ef4444;
}

/* ============================================
   HINT BLOCK
   Preview of most recent hint
   ============================================ */
.hint-block {
    background: rgba(70, 39, 117, 0.04);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
}

.hint-preview {
    font-size: 19px;
    color: var(--biz-text);
    line-height: 1.4;
    margin-bottom: 6px;
    /* Limit to 2 lines with ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hint-date {
    font-size: 13px;
    color: var(--biz-text-muted);
}

.view-hints {
    display: block;
    margin-top: 8px;
    font-size: 15px;
    color: var(--biz-accent);
    font-weight: 500;
    text-align: right;
    cursor: pointer;
    transition: color 0.2s ease;
}

.view-hints:hover {
    color: #6c41ad;
}

/* ============================================
   PHOTO CAROUSEL
   Horizontal scrolling image thumbnails
   ============================================ */
.photo-carousel {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
    margin-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.photo-carousel::-webkit-scrollbar {
    display: none;
}

.carousel-item {
    flex-shrink: 0;
    height: 50px;
    width: auto;
    border-radius: 8px;
    object-fit: cover;
    background: #e8e0f0;
}

/* Ensure images display properly */
.carousel-item img {
    height: 50px;
    width: auto;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

/* ============================================
   REACTION STRIP
   Aggregated emoji reactions and reply count
   ============================================ */
.reaction-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(70, 39, 117, 0.1);
}

/* Aggregated reactions with stacked emojis */
.reaction-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(70, 39, 117, 0.06);
    border-radius: 20px;
}

.emoji-stack {
    display: flex;
    align-items: center;
    gap: 3px;
}

.emoji-stack .emoji {
    font-size: 19px;
}

.reaction-group .total {
    color: var(--biz-text-muted);
    font-weight: 500;
    font-size: 14px;
    margin-left: 4px;
}

/* Replies item stays separate, pushed to right */
.reaction-replies {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: rgba(70, 39, 117, 0.06);
    border-radius: 20px;
    font-size: 14px;
    margin-left: auto;
}

.reaction-replies .emoji { font-size: 19px; }
.reaction-replies .count { color: var(--biz-text-muted); font-weight: 500; }

/* ============================================
   CARD HOVER & INTERACTION STATES
   ============================================ */
.biz-card:hover {
    box-shadow: 0 4px 12px rgba(70, 39, 117, 0.1);
}

.biz-card:active {
    transform: scale(0.99);
}

