/**
 * Earthies™ Reuse Library - My Account Tab Styles
 *
 * Brand: light mint/sage surfaces, dark green text only, brandon-grotesque, 6px radius.
 * Prefix: sj-rl- (SmartJar Reuse Library) to avoid conflicts.
 *
 * Layout:
 *   heading → summary count → groups (by container type) → swap note → info
 *
 * Each group shows one illustration, the type name + a count, and a list
 * of "N due by <date>" buckets. RFID labels have no visible unique ID, so
 * the UI deliberately does NOT show individual jar identities.
 */

/* ── Container ────────────────────────────────────────────── */
.sj-rl-container {
    max-width: 720px;
    font-family: brandon-grotesque, -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
    color: #333;
}

/* ── Level 1: Page heading ────────────────────────────────── */
.sj-rl-heading {
    color: #2c5e54;
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    margin-top: 0;
    margin-bottom: 0.15rem;
}

.sj-rl-subheading {
    color: #999;
    font-size: 0.85rem;
    margin-top: 0;
    margin-bottom: 1.25rem;
}

/* ── Status confirmation (compact, quiet) ─────────────────── */
.sj-rl-status-box {
    font-size: 0.82rem;
    color: #888;
    margin-bottom: 1rem;
    padding: 0;
}

.sj-rl-status-box p {
    margin: 0;
}

.sj-rl-status-box strong {
    color: #2c5e54;
    font-weight: 600;
}

/* ── Level 2: Section anchor (container count) ────────────── */
.sj-rl-count {
    font-size: 1.05rem;
    font-weight: 600;
    color: #2c5e54;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #e2ece7;
}

.sj-rl-overdue-badge {
    display: inline-block;
    background: #fce8e6;
    color: #8b4f4a;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
}

/* ── Level 3: Grouped containers (by type) ────────────────── */
.sj-rl-groups {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.sj-rl-group {
    display: flex;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #d5e8e5;
    border-radius: 6px;
    padding: 1rem 1.1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sj-rl-group:hover {
    border-color: #bfe2dc;
    box-shadow: 0 2px 8px rgba(44, 94, 84, 0.08);
}

.sj-rl-group.sj-rl-group-has-overdue {
    border-color: #e8c9c6;
    background: #fefafa;
}

.sj-rl-group.sj-rl-group-has-overdue:hover {
    border-color: #d4a5a0;
}

/* Group illustration - slightly larger than the old per-jar cards since
   each group now represents multiple containers. */
.sj-rl-group-img {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sj-rl-group-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.sj-rl-group-body {
    flex: 1;
    min-width: 0;
}

.sj-rl-group-title {
    margin: 0 0 0.45rem 0;
    color: #2c5e54;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.sj-rl-group-count {
    color: #7a9f97;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* ── Due-date bucket list ─────────────────────────────────── */
.sj-rl-bucket-list {
    list-style: none;
    margin: 0 0 0.55rem 0;
    padding: 0;
}

.sj-rl-bucket {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.15rem 0;
    font-size: 0.92rem;
    color: #444;
}

.sj-rl-bucket-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #a5ccbc;
}

.sj-rl-bucket-on-track .sj-rl-bucket-dot {
    background: linear-gradient(135deg, #bfe2dc, #a5ccbc);
}

.sj-rl-bucket-due-soon .sj-rl-bucket-dot {
    background: linear-gradient(135deg, #f0d88c, #d4a843);
}

.sj-rl-bucket-overdue .sj-rl-bucket-dot {
    background: linear-gradient(135deg, #e0a8a3, #c47e78);
}

.sj-rl-bucket-text {
    font-weight: 500;
}

.sj-rl-bucket-on-track .sj-rl-bucket-text {
    color: #2c5e54;
}

.sj-rl-bucket-due-soon .sj-rl-bucket-text {
    color: #8b7724;
    font-weight: 600;
}

.sj-rl-bucket-overdue .sj-rl-bucket-text {
    color: #8b4f4a;
    font-weight: 600;
}

.sj-rl-bucket-ext {
    display: inline-block;
    background: #fef8e8;
    color: #8b7724;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Group meta (Earthies held per container) - quietest */
.sj-rl-group-meta {
    font-size: 0.75rem;
    color: #999;
    margin: 0.45rem 0 0 0;
    padding-top: 0.35rem;
    border-top: 1px solid #f0f0f0;
}

/* ── Swap note (interchangeable returns messaging) ────────── */
.sj-rl-swap-note {
    margin-top: 1.1rem;
    margin-bottom: 0;
    padding: 0.9rem 1rem;
    background: #f3faf7;
    border: 1px solid #d5e8e5;
    border-radius: 6px;
}

.sj-rl-swap-note p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #444;
}

.sj-rl-swap-note p + p {
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px dashed #d5e8e5;
}

.sj-rl-swap-note strong {
    color: #2c5e54;
    font-weight: 700;
}

.sj-rl-swap-yes::before {
    content: "\2713\00a0";  /* ✓ */
    color: #2c5e54;
    font-weight: 700;
    margin-right: 0.1rem;
}

.sj-rl-swap-no::before {
    content: "\2715\00a0";  /* ✕ */
    color: #8b4f4a;
    font-weight: 700;
    margin-right: 0.1rem;
}

.sj-rl-swap-no strong {
    color: #8b4f4a;
}

/* ── Setup notice (no phone linked) ──────────────────────── */
.sj-rl-notice {
    background: #e8f5f3;
    border-left: 4px solid #2c5e54;
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 1.25rem;
}

.sj-rl-notice h3 {
    margin: 0 0 8px 0;
    color: #2c5e54;
    font-size: 1.1rem;
}

.sj-rl-notice p {
    margin: 4px 0;
    line-height: 1.5;
    font-size: 0.92rem;
}

.sj-rl-notice ol {
    margin: 8px 0;
    padding-left: 20px;
}

.sj-rl-notice ol li {
    margin-bottom: 5px;
    font-size: 0.92rem;
}

/* ── CTA button (brand gradient, always rectangular 6px) ──── */
.sj-rl-btn {
    display: inline-block;
    background: linear-gradient(135deg, #bfe2dc 0%, #a5ccbc 100%);
    color: #2c5e54;
    padding: 10px 22px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    border: 1.5px solid #a5ccbc;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.sj-rl-btn:hover {
    background: linear-gradient(135deg, #a5ccbc 0%, #8ebdad 100%);
    color: #2c5e54;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(165, 204, 188, 0.3);
}

/* ── Level 5: Supplementary info ──────────────────────────── */
.sj-rl-info {
    background: #fafbfa;
    border: 1px solid #e2ece7;
    border-radius: 6px;
    padding: 14px 18px;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.sj-rl-info h3,
.sj-rl-info-heading {
    margin: 0 0 6px 0;
    color: #2c5e54;
    font-size: 0.95rem;
}

.sj-rl-info p {
    margin: 4px 0;
    line-height: 1.5;
    font-size: 0.85rem;
    color: #666;
}

.sj-rl-info-link {
    margin-top: 8px !important;
}

.sj-rl-info ul {
    margin: 6px 0;
    padding-left: 20px;
}

.sj-rl-info ul li {
    margin-bottom: 3px;
    font-size: 0.85rem;
    color: #666;
}

/* ── Link style ───────────────────────────────────────────── */
.sj-rl-link {
    color: #2c5e54;
    text-decoration: underline;
    font-weight: 500;
    font-size: 0.85rem;
}

.sj-rl-link:hover {
    color: #1e4d45;
}

/* ── Empty state ──────────────────────────────────────────── */
.sj-rl-empty {
    text-align: center;
    padding: 2.5rem 1rem;
}

.sj-rl-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.sj-rl-empty h3 {
    color: #2c5e54;
    margin: 0 0 0.5rem 0;
}

.sj-rl-empty p {
    color: #666;
    font-size: 0.92rem;
    margin: 0 0 1rem 0;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 480px) {
    .sj-rl-group {
        flex-direction: column;
    }

    .sj-rl-group-img {
        margin: 0 0 0.6rem 0;
        width: 56px;
        height: 56px;
    }

    .sj-rl-bucket {
        font-size: 0.9rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .sj-rl-container {
        max-width: 600px;
        margin: 0 auto;
    }
}
