/* Brickset LEGO Sets Plugin - Frontend Styles */

/* ============================================
   Wrapper & Grid
   ============================================ */
.bls-sets-wrap {
    --bls-primary: #e3000b;
    --bls-text: #1a1a1a;
    --bls-muted: #666;
    --bls-border: #e0e0e0;
    --bls-bg: #fff;
    --bls-radius: 10px;
    --bls-shadow: 0 2px 12px rgba(0,0,0,0.09);
    font-family: inherit;
    margin: 1.5em 0;
}

/* Grid layout */
.bls-style-grid {
    display: grid;
    grid-template-columns: repeat(var(--bls-cols, 3), 1fr);
    gap: 1.25rem;
}
.bls-cols-1 { --bls-cols: 1; }
.bls-cols-2 { --bls-cols: 2; }
.bls-cols-3 { --bls-cols: 3; }
.bls-cols-4 { --bls-cols: 4; }
.bls-cols-5 { --bls-cols: 5; }
.bls-cols-6 { --bls-cols: 6; }

@media (max-width: 900px) {
    .bls-style-grid { --bls-cols: 2 !important; }
}
@media (max-width: 580px) {
    .bls-style-grid { --bls-cols: 1 !important; }
}

/* List layout */
.bls-style-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.bls-style-list .bls-set--list {
    flex-direction: row;
    align-items: flex-start;
}
.bls-style-list .bls-set--list .bls-set__image {
    flex: 0 0 120px;
    margin-right: 1rem;
    margin-bottom: 0;
}

/* ============================================
   Set Card
   ============================================ */
.bls-set {
    background: var(--bls-bg);
    border: 1px solid var(--bls-border);
    border-radius: var(--bls-radius);
    overflow: hidden;
    box-shadow: var(--bls-shadow);
    transition: transform .15s, box-shadow .15s;
    display: flex;
    flex-direction: column;
}
.bls-set:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.13);
}

.bls-set__image {
    background: #f5f5f5;
    text-align: center;
    padding: .75rem;
    margin-bottom: 0;
}
.bls-set__image img {
    max-width: 100%;
    height: 160px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    transition: transform .2s;
}
.bls-set__image img:hover {
    transform: scale(1.05);
}

.bls-set__body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    flex: 1;
}

.bls-set__number {
    font-size: .75rem;
    color: var(--bls-muted);
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.bls-set__name {
    margin: 0 !important;
    font-size: 1rem !important;
    line-height: 1.35 !important;
    font-weight: 700 !important;
}
.bls-set__name a {
    color: var(--bls-text) !important;
    text-decoration: none !important;
}
.bls-set__name a:hover {
    color: var(--bls-primary) !important;
}

/* Badges */
.bls-set__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    margin-top: .2rem;
}
.bls-badge {
    background: #f0f0f0;
    color: #444;
    font-size: .7rem;
    padding: .15rem .5rem;
    border-radius: 20px;
    font-weight: 500;
}
.bls-badge--theme {
    background: #fff3cd;
    color: #856404;
}

/* Stats row */
.bls-set__stats {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .4rem;
}
.bls-stat {
    display: flex;
    align-items: center;
    gap: .2rem;
    font-size: .78rem;
    background: #f8f8f8;
    border-radius: 6px;
    padding: .2rem .45rem;
}
.bls-stat__icon { font-size: .85rem; }
.bls-stat__value { font-weight: 700; color: var(--bls-text); }
.bls-stat__label { color: var(--bls-muted); margin-left: .1rem; }

/* Availability */
.bls-set__availability {
    font-size: .72rem;
    color: var(--bls-muted);
    margin-top: .2rem;
}

/* Link */
.bls-set__link {
    display: inline-block;
    margin-top: auto;
    padding-top: .6rem;
    font-size: .8rem;
    color: var(--bls-primary) !important;
    text-decoration: none !important;
    font-weight: 600;
}
.bls-set__link:hover {
    text-decoration: underline !important;
}

/* ============================================
   Table
   ============================================ */
.bls-table-wrap {
    overflow-x: auto;
    border-radius: var(--bls-radius);
    border: 1px solid var(--bls-border);
    box-shadow: var(--bls-shadow);
}
.bls-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.bls-table th {
    background: #f5f5f5;
    text-align: left;
    padding: .65rem .9rem;
    font-weight: 700;
    border-bottom: 2px solid var(--bls-border);
    white-space: nowrap;
}
.bls-table td {
    padding: .55rem .9rem;
    border-bottom: 1px solid var(--bls-border);
    vertical-align: middle;
}
.bls-table tr:last-child td { border-bottom: none; }
.bls-table tr:hover td { background: #fafafa; }
.bls-table__img img {
    display: block;
    border-radius: 4px;
}
.bls-table a {
    color: var(--bls-primary) !important;
    text-decoration: none !important;
    font-weight: 600;
}
.bls-table a:hover { text-decoration: underline !important; }

/* ============================================
   Messages
   ============================================ */
.bls-error {
    background: #fef2f2;
    border-left: 4px solid #e3000b;
    padding: .75rem 1rem;
    border-radius: 4px;
    color: #c0392b;
    font-size: .875rem;
}
.bls-no-results {
    background: #f8f8f8;
    padding: 1rem;
    border-radius: 6px;
    color: var(--bls-muted);
    text-align: center;
}

/* ============================================
   Widget
   ============================================ */
.bls-widget-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
.bls-widget-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem 0;
    border-bottom: 1px solid #eee;
}
.bls-widget-item:last-child { border-bottom: none; }
.bls-widget-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 4px;
    background: #f5f5f5;
    flex-shrink: 0;
}
.bls-widget-info {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    min-width: 0;
}
.bls-widget-name {
    font-size: .85rem;
    font-weight: 600;
    color: var(--bls-text, #1a1a1a) !important;
    text-decoration: none !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bls-widget-name:hover { color: #e3000b !important; }
.bls-widget-num {
    font-size: .72rem;
    color: #888;
}

/* ============================================
   Lightbox
   ============================================ */
.bls-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}
.bls-lightbox { display: none; }
.bls-lightbox__inner {
    position: relative;
    background: #fff;
    border-radius: 10px;
    padding: 1rem;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bls-lightbox__inner img {
    max-width: 80vw;
    max-height: 80vh;
    object-fit: contain;
    display: block;
}
.bls-lightbox__close {
    position: absolute;
    top: .4rem;
    right: .6rem;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    color: #666;
}
.bls-lightbox__close:hover { color: #e3000b; }
.bls-set__image img { cursor: zoom-in; }
