/**
 * Crew Treatment Rating Styles
 *
 * Tier badges, Glassdoor star display, component breakdown bars,
 * ship profile crew treatment tab, and crew treatment rankings page.
 */

/* ── CSS Variables ── */
:root {
    --stcdb-crew-green: #22c55e;
    --stcdb-crew-blue: #3b82f6;
    --stcdb-crew-amber: #f59e0b;
    --stcdb-crew-red: #ef4444;
    --stcdb-crew-gray: #9ca3af;
}

/* ══════════════════════════════════════════
   CREW TREATMENT BADGE
   ══════════════════════════════════════════ */

.stcdb-crew-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px solid;
    border-radius: 16px;
    text-align: center;
    background: #fff;
}

.stcdb-crew-badge--large {
    width: 140px;
    height: 140px;
    padding: 16px;
}

.stcdb-crew-badge--medium {
    width: 100px;
    height: 100px;
    padding: 10px;
}

.stcdb-crew-badge--small {
    width: 60px;
    height: 60px;
    padding: 6px;
    border-width: 2px;
    border-radius: 10px;
}

.stcdb-crew-badge--nodata {
    border-color: #d1d5db;
    border-style: dashed;
}

.stcdb-crew-badge-score {
    font-weight: 800;
    line-height: 1;
}

.stcdb-crew-badge--large .stcdb-crew-badge-score {
    font-size: 2.5rem;
}

.stcdb-crew-badge--medium .stcdb-crew-badge-score {
    font-size: 1.75rem;
}

.stcdb-crew-badge--small .stcdb-crew-badge-score {
    font-size: 1.1rem;
}

.stcdb-crew-badge-out-of {
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    margin-top: 2px;
    line-height: 1;
}

.stcdb-crew-badge--small .stcdb-crew-badge-out-of {
    font-size: 0.55rem;
}

.stcdb-crew-badge-label {
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 4px;
    line-height: 1.2;
}

.stcdb-crew-badge--small .stcdb-crew-badge-label {
    font-size: 0.55rem;
    margin-top: 2px;
}

.stcdb-crew-badge-subtitle {
    font-size: 0.6rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.stcdb-crew-badge--small .stcdb-crew-badge-subtitle,
.stcdb-crew-badge--medium .stcdb-crew-badge-subtitle {
    display: none;
}

.stcdb-crew-badge--nodata .stcdb-crew-badge-score {
    color: #9ca3af;
}

/* ══════════════════════════════════════════
   GLASSDOOR STARS
   ══════════════════════════════════════════ */

.stcdb-crew-stars {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    font-size: 1rem;
    line-height: 1;
}

.stcdb-crew-star {
    display: inline-block;
}

.stcdb-crew-star--full {
    color: #f59e0b;
}

.stcdb-crew-star--half {
    color: #f59e0b;
    opacity: 0.5;
}

.stcdb-crew-star--empty {
    color: #d1d5db;
}

.stcdb-crew-star-value {
    font-size: 0.82rem;
    font-weight: 700;
    color: #374151;
    margin-left: 4px;
}

.stcdb-crew-stars--empty {
    color: #9ca3af;
    font-style: italic;
    font-size: 0.85rem;
}

/* ══════════════════════════════════════════
   TIER PILL (inline badge for tables)
   ══════════════════════════════════════════ */

.stcdb-crew-tier-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.4;
}

/* ══════════════════════════════════════════
   COMPONENT BREAKDOWN BARS
   ══════════════════════════════════════════ */

.stcdb-crew-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stcdb-crew-breakdown-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stcdb-crew-breakdown-label {
    width: 180px;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    gap: 4px;
}

.stcdb-crew-breakdown-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
}

.stcdb-crew-breakdown-bar-wrap {
    flex: 1;
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
}

.stcdb-crew-breakdown-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
    min-width: 2px;
}

.stcdb-crew-breakdown-value {
    width: 36px;
    text-align: right;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .stcdb-crew-breakdown-label {
        width: 130px;
    }
    .stcdb-crew-breakdown-name {
        font-size: 0.78rem;
    }
}

/* ══════════════════════════════════════════
   SHIP PROFILE CREW TREATMENT TAB
   ══════════════════════════════════════════ */

.stcdb-crew-profile-header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 24px;
}

.stcdb-crew-profile-summary {
    flex: 1;
    font-size: 0.92rem;
    color: #374151;
    line-height: 1.7;
}

.stcdb-crew-profile-summary p {
    margin: 0 0 10px;
}

.stcdb-crew-glassdoor-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    margin-bottom: 16px;
}

.stcdb-crew-glassdoor-info {
    flex: 1;
}

.stcdb-crew-glassdoor-info h4 {
    margin: 0 0 4px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #1f2937;
}

.stcdb-crew-glassdoor-info p {
    margin: 0;
    font-size: 0.82rem;
    color: #6b7280;
}

.stcdb-crew-recommend-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.stcdb-crew-recommend-bar-track {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    max-width: 200px;
}

.stcdb-crew-recommend-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: #22c55e;
}

.stcdb-crew-recommend-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
}

.stcdb-crew-methodology-link {
    text-align: center;
    margin-top: 24px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.stcdb-crew-methodology-link a {
    color: #0077B6;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
}

.stcdb-crew-methodology-link a:hover {
    text-decoration: underline;
}

/* ══════════════════════════════════════════
   CREW TREATMENT RANKINGS TABLE
   ══════════════════════════════════════════ */

.stcdb-crew-rankings-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

.stcdb-crew-rankings-header {
    margin-bottom: 24px;
}

.stcdb-crew-rankings-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #023E73;
    margin: 0 0 8px;
}

.stcdb-crew-rankings-header p {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0 0 16px;
}

.stcdb-crew-nav {
    margin-bottom: 20px;
}

.stcdb-crew-rankings-table-wrap {
    overflow-x: auto;
}

.stcdb-crew-rankings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.stcdb-crew-rankings-table thead th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    border-bottom: 2px solid #e5e7eb;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    position: sticky;
    top: 0;
    background: #fff;
}

.stcdb-crew-rankings-table thead th:hover {
    color: #0077B6;
}

.stcdb-crew-rankings-table thead th.is-sorted {
    color: #0077B6;
}

.stcdb-crew-rankings-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.stcdb-crew-rankings-table tbody tr:hover {
    background: #f9fafb;
}

.stcdb-crew-cell-line {
    font-weight: 600;
    color: #1f2937;
}

.stcdb-crew-review-count {
    font-size: 0.72rem;
    color: #9ca3af;
    margin-left: 4px;
}

/* ══════════════════════════════════════════
   MOBILE RESPONSIVE
   ══════════════════════════════════════════ */

@media (max-width: 768px) {
    .stcdb-crew-rankings-table {
        font-size: 0.8rem;
    }
    .stcdb-crew-rankings-table thead th,
    .stcdb-crew-rankings-table tbody td {
        padding: 8px 6px;
    }
    .stcdb-crew-rankings-table .stcdb-crew-col-detail {
        display: none;
    }
    .stcdb-crew-profile-header {
        flex-direction: column;
        align-items: center;
    }
    .stcdb-crew-profile-summary {
        text-align: center;
    }
    .stcdb-crew-badge {
        margin: 0 auto;
    }
    .stcdb-crew-glassdoor-card {
        flex-direction: column;
        text-align: center;
    }
    .stcdb-crew-recommend-bar {
        justify-content: center;
    }
    .stcdb-crew-stars {
        font-size: 0.88rem;
    }
}

@media (max-width: 640px) {
    .stcdb-crew-rankings-header h1 {
        font-size: 1.3rem;
    }
    .stcdb-crew-tier-pill {
        font-size: 0.68rem;
        padding: 2px 8px;
    }
}
