/* Styling for list rows — these elements are built by app.js at runtime, so they
   never appear in the static page. Kept in a separate file, outside the visual
   editor's reach, so a GrapesJS save can never silently prune these rules again. */

/* List switcher chips (Layer 2: named lists) */
.list-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.list-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid transparent;
    border-radius: 999px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #ddd;
    transition: all 0.2s;
}

.list-chip:hover {
    background: rgba(255, 255, 255, 0.14);
}

.list-chip.active {
    background: rgba(102, 126, 234, 0.25);
    border-color: #667eea;
    color: #fff;
    font-weight: 600;
}

.list-chip-delete {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    line-height: 1;
}

.list-chip-delete:hover {
    opacity: 1;
    color: #ff6b6b;
}

.list-chip-add {
    background: rgba(56, 239, 125, 0.15);
    border: 2px dashed rgba(56, 239, 125, 0.5);
    border-radius: 999px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #38ef7d;
    transition: all 0.2s;
}

.list-chip-add:hover {
    background: rgba(56, 239, 125, 0.25);
}

.list-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-item {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.list-item.checked {
    opacity: 0.6;
    order: 1;
}

.list-item.unchecked {
    order: 0;
}

.list-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(102, 126, 234, 0.3);
}

/* BIG CHECKBOXES (Graham's requirement!) */
.item-check {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 8px;
    border: 2px solid #667eea;
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.item-check:hover {
    background: rgba(102, 126, 234, 0.3);
    transform: scale(1.05);
}

.item-check.checked {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
}

.item-check.checked:hover {
    background: rgba(255, 107, 107, 0.3);
}

.item-label {
    flex: 1;
    font-size: 1.2rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s;
}

.item-label.checked {
    text-decoration: line-through;
    color: #888;
}

.item-label.has-link {
    color: #6ea8ff;
}

.item-link {
    font-size: 1.1rem;
    text-decoration: none;
    padding: 4px;
    flex-shrink: 0;
}

/* Shows only when this item is linked to another list (brainstorm §6.5) —
   tapping it jumps straight there, no need to open the three-dots panel first. */
.item-sublist {
    background: none;
    border: none;
    font-size: 1.1rem;
    padding: 4px;
    flex-shrink: 0;
    cursor: pointer;
    line-height: 1;
}

/* Date-aware items (brainstorm §6.8) — only appears once a reminder date is
   actually close or overdue; quiet otherwise, per "clean front, power behind". */
.item-expiry-badge {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.item-expiry-badge.due-soon {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.item-expiry-badge.overdue {
    background: rgba(255, 77, 77, 0.2);
    color: #ff6b6b;
}

.item-dots {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #ccc;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
    transition: all 0.3s;
}

.item-dots:hover {
    background: rgba(255, 255, 255, 0.16);
}

.item-edit {
    background: rgba(102, 126, 234, 0.2);
    border: none;
    color: #667eea;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.item-edit:hover {
    background: rgba(102, 126, 234, 0.4);
}

.item-delete {
    background: rgba(255, 77, 77, 0.2);
    border: none;
    color: #ff6b6b;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.item-delete:hover {
    background: rgba(255, 77, 77, 0.4);
}

/* Item detail panel ("...") — the "rudder database page": which lists it's on,
   plus its curated Amazon link. */
.item-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.item-detail-overlay.hidden {
    display: none;
}

.item-detail-panel {
    background: #1f2240;
    border-radius: 16px;
    padding: 0 24px 24px;
    max-width: 420px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    color: #fff;
}

/* Stays pinned to the top of the panel while the rest scrolls underneath, so
   the close button is always reachable — never scrolls out of view like a
   floating one would. */
.detail-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #1f2240;
    margin: 0 -24px 10px;
    padding: 22px 24px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.item-detail-panel h3 {
    font-size: 1.4rem;
}

.detail-close {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 8px;
    flex-shrink: 0;
}

.detail-close:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* A second, unmissable way to close the panel — big, full-width, plain
   language, always at the very bottom so it's reachable just by scrolling
   down instead of hunting for the × or knowing to press Escape. */
.detail-done {
    display: block;
    width: 100%;
    margin-top: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 14px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
}

.detail-done:hover {
    background: rgba(255, 255, 255, 0.18);
}

.detail-close:hover {
    color: #fff;
}

.detail-section-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin: 18px 0 8px;
}

.detail-list-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 1.05rem;
    cursor: pointer;
}

.detail-list-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #667eea;
    cursor: pointer;
}

.detail-link-current a {
    color: #6ea8ff;
    word-break: break-all;
}

.detail-affiliate-note {
    font-size: 0.75rem;
    color: #888;
    margin-top: 6px;
}

.detail-link-remove {
    background: rgba(255, 77, 77, 0.2);
    border: none;
    color: #ff6b6b;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-top: 8px;
}

.detail-link-remove:hover {
    background: rgba(255, 77, 77, 0.4);
}

.detail-link-empty {
    color: #999;
    font-size: 0.9rem;
}

.detail-link-add {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.detail-link-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    padding: 10px;
    font-size: 0.9rem;
}

.detail-link-add button {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

/* Personal notes — phone number, address, anything private to this device.
   Never sent to the anonymous crowd catalogue, only to this person's own
   storage/export. */
.detail-notes-hint {
    color: #888;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.detail-notes-input {
    width: 100%;
    min-height: 70px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    padding: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
}

.detail-notes-save {
    background: rgba(102, 126, 234, 0.3);
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 8px;
}

.detail-notes-save:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* Date-aware items (brainstorm §6.8) — a reminder date that matters for this item. */
.detail-date-hint {
    color: #888;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.detail-date-row {
    display: flex;
    gap: 8px;
}

.detail-date-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    padding: 10px;
    font-size: 0.9rem;
    font-family: inherit;
}

.detail-date-row button {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.detail-date-remove {
    background: rgba(255, 77, 77, 0.2) !important;
    color: #ff6b6b;
}

.detail-date-warning {
    margin-top: 8px;
    font-weight: 600;
}
