/* ============================================
   Star Rating Component (Amazon-style)
   ============================================ */

/* Main container */
.star-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    line-height: 1;
}

/* Numeric value */
.star-rating-value {
    font-weight: 600;
    color: var(--color-text);
}

/* Stars container */
.star-rating-stars {
    display: inline-flex;
    gap: 0.1rem;
}

/* Individual star with partial fill support */
.star-rating-stars .star {
    position: relative;
    display: inline-block;
    width: 1em;
    height: 1em;
    font-size: 1rem;
}

/* Empty star (background) */
.star-rating-stars .star::before {
    content: "\2605"; /* Filled star character */
    position: absolute;
    left: 0;
    top: 0;
    color: #d1d5db; /* Light gray for empty */
}

/* Filled portion (foreground with clip) */
.star-rating-stars .star::after {
    content: "\2605"; /* Filled star character */
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-warning); /* Amber/gold for filled */
    clip-path: inset(0 calc(100% - var(--fill, 0%)) 0 0);
}

/* Rating count */
.star-rating-count {
    color: var(--color-text-light);
    font-size: 0.8125rem;
}

/* Size variants */
.star-rating.star-rating-sm {
    font-size: 0.75rem;
}

.star-rating.star-rating-sm .star-rating-stars .star {
    font-size: 0.875rem;
}

.star-rating.star-rating-lg {
    font-size: 1rem;
}

.star-rating.star-rating-lg .star-rating-stars .star {
    font-size: 1.25rem;
}

/* Interactive star input */
.star-rating-input {
    display: inline-flex;
    gap: 0.25rem;
}

.star-rating-input .star-input {
    font-size: 1.5rem;
    cursor: pointer;
    color: #d1d5db;
    transition: color 0.1s ease, transform 0.1s ease;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.star-rating-input .star-input:hover {
    transform: scale(1.1);
}

.star-rating-input .star-input.filled,
.star-rating-input .star-input.preview {
    color: var(--color-warning);
}

.star-rating-input .star-input.preview:not(.filled) {
    color: #fcd34d; /* Lighter gold for preview */
}

/* Star rating input - Alpine.js version */
.star-rating-input {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.star-rating-input .star-input-btn {
    font-size: 1.5rem;
    cursor: pointer;
    color: #d1d5db;
    transition: color 0.15s ease, transform 0.15s ease;
    background: none;
    border: none;
    padding: 0.125rem;
    line-height: 1;
}

.star-rating-input .star-input-btn:hover {
    transform: scale(1.15);
}

.star-rating-input .star-input-btn:focus {
    outline: none;
}

.star-rating-input .star-input-btn:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
    border-radius: 2px;
}

.star-rating-input .star-input-btn.active,
.star-rating-input .star-input-btn.hover {
    color: var(--color-warning);
}

.star-rating-input .star-input-btn.hover:not(.active) {
    color: #fcd34d; /* Lighter gold for hover preview */
}

.star-rating-input .star-input-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.star-rating-input .star-rating-input-label {
    margin-left: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-light);
}

/* Size variants */
.star-rating-input.star-rating-input-sm .star-input-btn {
    font-size: 1.25rem;
}

.star-rating-input.star-rating-input-lg .star-input-btn {
    font-size: 2rem;
}

/* Avatar component for rating cards */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--brand-primary);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.avatar-md {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.875rem;
}

.avatar-lg {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.125rem;
}

/* Sidebar badge for rating count */
.sidebar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    border-radius: 0.625rem;
    background: var(--color-error);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    margin-left: auto;
}

/* ==================================
   SKILL TOOLTIP COMPONENT
   ================================== */

/* Skill pill hover state */
.skill-pill {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.skill-pill:hover {
    background-color: #e2e8f0 !important;
}

/* Bootstrap tooltip customization for skill ratings */
.tooltip.skill-tooltip {
    --bs-tooltip-max-width: 280px;
    --bs-tooltip-bg: rgba(15, 15, 15, 0.95);
    --bs-tooltip-padding-x: 0.875rem;
    --bs-tooltip-padding-y: 0.75rem;
}

.tooltip.skill-tooltip .tooltip-inner {
    max-width: var(--bs-tooltip-max-width);
    text-align: left;
}

/* Tooltip content layout */
.skill-tooltip-content {
    min-width: 180px;
}

.skill-tooltip-header {
    font-weight: 600;
    font-size: 0.8125rem;
    color: #fff;
    margin-bottom: 0.5rem;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.skill-tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.75rem;
}

.skill-tooltip-comp {
    color: rgba(255, 255, 255, 0.85);
    margin-right: 0.75rem;
}

.skill-tooltip-stars {
    white-space: nowrap;
}

/* Rating value - white text, not gold */
.skill-tooltip-stars .rating-value {
    color: #fff;
    font-weight: 600;
    margin-right: 0.25rem;
}

/* Filled stars - gold */
.skill-tooltip-stars .stars {
    color: #fbbf24;
    letter-spacing: 0;
}

/* Rating count - muted */
.skill-tooltip-stars .rating-count {
    color: rgba(255, 255, 255, 0.6);
    margin-left: 0.25rem;
}
