/* ============================================
   CARD BADGES
   View count, favorites, feature badges,
   feature emojis - all badge-related styles
   ============================================ */

/* ---- View Count Badge ---- */
.view-count-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.9) 0%, rgba(50, 50, 50, 0.85) 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px 4px 8px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    pointer-events: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.1);
}

.view-count-badge svg {
    width: 11px;
    height: 11px;
    fill: #fff;
    margin-right: 2px;
    flex-shrink: 0;
}

.view-count-badge span {
    min-width: 0;
    text-align: center;
    color: inherit;
    font-weight: 600;
    font-size: 11px;
    line-height: 1;
    letter-spacing: 0.1px;
    max-width: 52px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
}

.plate-number-container.has-sponsored .view-count-badge {
    top: auto;
}

/* ---- Feature Badge ---- */
.feature-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: var(--card-secondary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.feature-badge.multiple-features {
    cursor: help;
    padding-right: 18px;
}

.feature-badge.multiple-features::after {
    content: "+";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
}

/* Feature badge colors */
.feature-badge[title*="Birthday"] { background-color: #2ecc71; }
.feature-badge[title*="Palindrome"] { background-color: #9b59b6; }
.feature-badge[title*="Sequential"] { background-color: #3498db; }
.feature-badge[title*="Repeated"] { background-color: #e74c3c; }
.feature-badge[title*="Mirror"] { background-color: #f39c12; }

/* Feature badge tooltip */
.feature-badge::before {
    display: none;
    content: attr(data-features);
    position: absolute;
    bottom: 100%;
    right: 0;
    background-color: var(--card-secondary);
    color: white;
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 4px;
    margin-bottom: 5px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.2s, transform 0.2s;
}

.feature-badge.multiple-features:hover::before {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ---- Feature Emojis ---- */
.plate-feature-emojis {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    z-index: 2;
}

.feature-emoji {
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    transition: transform 0.2s ease;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.feature-emoji:hover {
    transform: scale(1.15);
}

/* ---- Badge Info Tooltip (tap to reveal) ---- */
.badge-info-tip {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(20, 20, 20, 0.95);
    color: #fff;
    font-size: 11.5px;
    font-weight: 500;
    padding: 7px 12px;
    border-radius: 10px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transform: translateY(-4px) scale(0.96);
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-family: 'Lexend', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: 0.1px;
    line-height: 1.3;
}

.badge-info-tip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 12px;
    border: 5px solid transparent;
    border-bottom-color: rgba(20, 20, 20, 0.95);
}

.badge-info-tip.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Sponsored label tooltip arrow should come from left side */
.sponsored-label .badge-info-tip::before {
    right: auto;
    left: 12px;
}

.sponsored-label .badge-info-tip {
    right: auto;
    left: 0;
}

/* RTL adjustments */
body.rtl .badge-info-tip {
    right: auto;
    left: 0;
}

body.rtl .badge-info-tip::before {
    right: auto;
    left: 12px;
}

body.rtl .sponsored-label .badge-info-tip {
    left: auto;
    right: 0;
}

body.rtl .sponsored-label .badge-info-tip::before {
    left: auto;
    right: 12px;
}

/* RTL: Feature emojis positioning */
body.rtl .plate-feature-emojis {
    display: flex;
    direction: ltr;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin: 0 0 6px 0;
    position: absolute;
    top: 8px;
    left: 8px;
    right: auto;
}

body.rtl .plate-feature-emojis .feature-emoji {
    margin: 0;
}

/* ---- Favorite Count Badge (on card) ---- */
.favorite-count-badge {
    background: rgba(139, 0, 0, 0.08);
    border: 1.5px solid rgba(139, 0, 0, 0.2);
    color: #8B0000;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.favorite-count-badge:focus,
.favorite-count-badge:focus-visible {
    outline: none;
}

.favorite-count-badge:hover {
    background: rgba(139, 0, 0, 0.12);
    border-color: rgba(139, 0, 0, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.favorite-count-badge:active {
    transform: translateY(0);
    background: rgba(139, 0, 0, 0.15);
}

.favorite-count-badge svg {
    width: 16px;
    height: 16px;
    fill: #ff4458;
    stroke: none;
    transition: transform 0.2s ease;
}

.favorite-count-badge:hover svg {
    transform: scale(1.1);
}

.favorite-count-badge span {
    color: #8B0000;
    font-weight: 600;
    min-width: 16px;
    text-align: center;
}

/* Favorite badge in plate-number-container (absolute positioned) */
.plate-number-container .favorite-count-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(139, 0, 0, 0.9);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.plate-number-container .favorite-count-badge svg {
    width: 12px;
    height: 12px;
    fill: white;
}

.plate-number-container:has(.feature-badge) .favorite-count-badge {
    bottom: 35px;
}

/* ---- Favorite Badge in Plate Details ---- */
.plate-details .favorite-count-badge {
    position: static;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.08) 0%, rgba(139, 0, 0, 0.12) 100%);
    color: var(--card-primary);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
    width: fit-content;
    cursor: pointer;
    border: 1px solid rgba(139, 0, 0, 0.1);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    margin-left: auto;
    fill: #d4af37;
}

.plate-details .favorite-count-badge:hover {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.12) 0%, rgba(139, 0, 0, 0.18) 100%);
    transform: scale(1.05);
}

.plate-details .favorite-count-badge:active {
    transform: scale(0.95);
}

.plate-details .favorite-count-badge.active {
    background-color: var(--card-primary);
    color: white;
}

.plate-details .favorite-count-badge.active svg {
    fill: white;
}

.plate-details .favorite-count-badge svg {
    width: 14px;
    height: 14px;
    fill: var(--card-primary);
    transition: fill 0.2s ease;
}

.plate-details .favorite-count-badge span {
    min-width: 16px;
    text-align: center;
    color: inherit;
}

/* ---- Sponsored Plate Favorite Badges ---- */
.sponsored-plate .favorite-count-badge {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.3);
    color: #8B0000;
}

.sponsored-plate .favorite-count-badge:hover {
    background: rgba(212, 175, 55, 0.25);
    border-color: rgba(212, 175, 55, 0.4);
}

.sponsored-plate .favorite-count-badge svg {
    fill: #d4af37;
}

.sponsored-plate .plate-number-container .favorite-count-badge {
    background: linear-gradient(135deg, #d4af37, #b88d10);
    color: #2a1500;
    border: 1px solid rgba(110, 70, 0, 0.25);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.sponsored-plate .plate-number-container .favorite-count-badge svg {
    fill: #2a1500;
}

.sponsored-plate .plate-details .favorite-count-badge {
    background: rgba(212, 175, 55, 0.2);
    color: #d4af37;
}

.sponsored-plate .plate-details .favorite-count-badge:hover {
    background: rgba(212, 175, 55, 0.3);
}

.sponsored-plate .plate-details .favorite-count-badge.active {
    background: linear-gradient(135deg, #d4af37, #b88d10);
    color: #2a1500;
}

.sponsored-plate .plate-details .favorite-count-badge svg {
    fill: #d4af37;
}

.sponsored-plate .plate-details .favorite-count-badge.active svg {
    fill: #2a1500;
}

.sponsored-plate .plate-details .favorite-count-badge span {
    color: #d4af37;
}

/* ---- Champagne Plate Favorite Badges ---- */
.champagne-plate .favorite-count-badge {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border: 1px solid #8b6914;
    color: #000000 !important;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(139, 105, 20, 0.25);
}

.champagne-plate .favorite-count-badge svg {
    fill: #000000 !important;
    stroke: #000000 !important;
}

.champagne-plate .favorite-count-badge:hover {
    background: linear-gradient(135deg, #e6c547 0%, #d4af37 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(139, 105, 20, 0.3);
}

.champagne-plate .favorite-count-badge.active {
    background: linear-gradient(135deg, #8b6914 0%, #5a4a0d 100%);
    color: #ffffff !important;
}

.champagne-plate .favorite-count-badge.active svg {
    fill: #ffffff !important;
}

.champagne-plate .favorite-count-badge.active span {
    color: #8B0000;
    font-weight: 700;
}

/* RTL favorite badge */
body.rtl .favorite-count-badge {
    margin-left: 0;
    margin-right: 8px;
}

/* ---- Mobile Responsive ---- */
@media (max-width: 768px) {
    .favorite-count-badge {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .favorite-count-badge svg {
        width: 10px;
        height: 10px;
    }

    .plate-details .favorite-count-badge {
        font-size: 12px;
        padding: 3px 8px;
    }
    
    .plate-details .favorite-count-badge svg {
        width: 12px;
        height: 12px;
    }
}
