/* LockShim — Locksport Workbench */

/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #222;
    background: #f8f8f8;
}

a {
    color: #2563eb;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* === Layout === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* === Nav === */
.top-nav {
    background: #1e293b;
    color: #fff;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.nav-brand {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
}
.nav-brand:hover {
    text-decoration: none;
    opacity: 0.9;
}

.nav-subtitle {
    color: #94a3b8;
    font-size: 0.9rem;
}

.nav-link {
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    margin-left: auto;
}
.nav-link:hover {
    color: #fff;
    text-decoration: none;
}

/* === Belt Badges === */
.belt-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
    white-space: nowrap;
}

.belt-badge-white {
    color: #333;
    border: 1px solid #ccc;
}

/* === Filter Bar === */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.filter-bar label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.filter-bar input[type="text"],
.filter-bar select {
    padding: 0.4rem 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.9rem;
    background: #fff;
}
.filter-bar input[type="text"] {
    width: 220px;
}

.belt-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.belt-pill {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #fff;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.15s, border-color 0.15s;
    background: none;
    font-family: inherit;
}

.belt-pill.active {
    opacity: 1;
    border-color: #334155;
}

.belt-pill-white {
    color: #333;
    border-color: #ccc;
}
.belt-pill-white.active {
    border-color: #334155;
}

/* === Status Filter Pills === */
.filter-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}
.filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}
.status-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.status-pill {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.15s, border-color 0.15s;
    background: none;
    font-family: inherit;
    color: #fff;
}
.status-pill.active {
    opacity: 1;
    border-color: #334155;
}
.status-pill-wish-list { background: #94a3b8; }
.status-pill-ordered { background: #f59e0b; }
.status-pill-owned { background: #22c55e; }
.status-pill-untracked { background: #e2e8f0; color: #475569; }
.picking-pill-waiting { background: #94a3b8; }
.picking-pill-picking { background: #f59e0b; }
.picking-pill-picked { background: #86efac; color: #1e293b; }
.picking-pill-occasionally { background: #4ade80; color: #1e293b; margin-left: 0.5rem; position: relative; }
.picking-pill-regularly { background: #16a34a; margin-left: 0.5rem; position: relative; }
.picking-pill-occasionally::before,
.picking-pill-regularly::before {
    content: '\2514';
    position: absolute;
    left: -0.65rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.6rem;
    color: #94a3b8;
    line-height: 1;
}

/* === Status Tags on Cards === */
.card-statuses {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.3rem;
}
.status-tag {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: capitalize;
}
.status-wish_list { background: #f1f5f9; color: #64748b; border: 1px dashed #94a3b8; }
.status-ordered { background: #fef3c7; color: #92400e; }
.status-owned { background: #dcfce7; color: #166534; }
.picking-waiting { background: #f1f5f9; color: #64748b; }
.picking-picking { background: #fef3c7; color: #92400e; }
.picking-picked { background: #dcfce7; color: #166534; }
.picking-picked_occasionally { background: #bbf7d0; color: #15803d; }
.picking-picked_regularly { background: #86efac; color: #14532d; font-weight: 700; }

/* === Status Badges (Detail Page) === */
.status-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}
.status-none { background: #f1f5f9; color: #94a3b8; }

/* === Tension Badge === */
.tension-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #e0e7ff;
    color: #3730a3;
    margin-right: 0.25rem;
}

/* === Lock Card Grid === */
.lock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.lock-card {
    display: block;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, transform 0.1s;
}
.lock-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    text-decoration: none;
}

.lock-card .card-image {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f1f5f9;
}
.lock-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card-body {
    padding: 0.75rem;
}

.card-body .belt-badge {
    margin-bottom: 0.4rem;
}

.card-body h3 {
    margin: 0.3rem 0 0.2rem;
    font-size: 1.05rem;
    color: #1e293b;
}

.card-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 0.4rem;
}

.card-pins {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

/* === Image Placeholder === */
.img-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}
.img-placeholder svg {
    width: 48px;
    height: 48px;
    opacity: 0.5;
}

/* === Security Pin Tags === */
.pin-tag {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
}

.pin-spool { background: #4169E1; }
.pin-serrated { background: #DC143C; }
.pin-mushroom { background: #800080; }
.pin-standard { background: #888; }

/* === No Results === */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    color: #64748b;
    padding: 2rem;
    font-size: 1.1rem;
}

/* === Detail Page === */
.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.lock-header {
    margin-bottom: 1.5rem;
}
.lock-header h1 {
    margin: 0 0 0.3rem;
    font-size: 1.8rem;
    color: #1e293b;
}
.lock-header .aliases {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 0.3rem;
}
.lock-header .lpu-link {
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

/* === Inline Status Dropdowns (Detail Page Header) === */
.inline-status-selects {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    align-items: center;
}
.inline-status-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.inline-status-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.inline-status-group select {
    padding: 0.25rem 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.3s;
}
.inline-status-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* === Detail Images === */
.detail-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.detail-images .img-placeholder {
    border-radius: 8px;
}
.detail-images img {
    border-radius: 8px;
    width: 100%;
    cursor: pointer;
}
.detail-images .img-label {
    text-align: center;
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.3rem;
}

/* === Spec Grid === */
.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid #e2e8f0;
}

.spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.spec-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
}
.spec-item .spec-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.spec-item .spec-value {
    font-size: 0.95rem;
    color: #1e293b;
    margin-top: 0.15rem;
}

/* === Community Notes === */
.community-block {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}
.community-block h4 {
    margin: 0 0 0.3rem;
    font-size: 0.9rem;
    color: #475569;
}
.community-block p {
    margin: 0;
    color: #334155;
    line-height: 1.6;
}

.tool-list, .video-list, .reddit-list, .store-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
}

.tool-list li {
    padding: 0.3rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}
.tool-list li:last-child {
    border-bottom: none;
}

.video-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}
.video-card .video-title {
    font-weight: 600;
    color: #2563eb;
}
.video-card .video-creator {
    font-size: 0.82rem;
    color: #64748b;
}
.video-card .video-desc {
    font-size: 0.85rem;
    color: #475569;
    margin-top: 0.25rem;
}

.reddit-list li, .store-list li {
    padding: 0.3rem 0;
}

/* === Personal Tracking === */
.personal-display {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.personal-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}
.personal-item .spec-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}
.personal-item .spec-value {
    font-size: 0.95rem;
    color: #1e293b;
}

.personal-notes {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}
.personal-notes p {
    margin: 0;
    color: #334155;
}

/* === Pin Stack === */
.pin-stack-display {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.75rem 0;
}
.pin-position {
    text-align: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    min-width: 60px;
}
.pin-position .pos-num {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 600;
}
.pin-position .pos-type {
    font-size: 0.8rem;
    font-weight: 600;
}

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 0.45rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #334155;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn:hover {
    background: #f1f5f9;
}
.btn-primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.btn-primary:hover {
    background: #1d4ed8;
}
.btn-sm {
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
}
.btn-danger {
    color: #dc2626;
    border-color: #fca5a5;
}
.btn-danger:hover {
    background: #fef2f2;
}

/* === Forms === */
.edit-form {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    padding: 0.4rem 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
}
.form-group textarea {
    min-height: 80px;
    resize: vertical;
}
.form-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.pin-stack-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
}
.pin-stack-table th, .pin-stack-table td {
    padding: 0.4rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.85rem;
}
.pin-stack-table th {
    font-weight: 600;
    color: #475569;
}

/* === 404 / Not Found === */
.not-found {
    text-align: center;
    padding: 3rem 1rem;
}
.not-found h2 {
    font-size: 1.5rem;
    color: #475569;
}

/* === Retail Section === */
.price-range {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

/* === Status Messages === */
.status-msg {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}
.status-msg.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.status-msg.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* === Tools Table === */
.tools-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}
.tools-table th, .tools-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.85rem;
}
.tools-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.tools-table tr:last-child td {
    border-bottom: none;
}
.tools-table tr.location-ordered {
    background: #fffbeb;
}
.tools-table tr.location-salinas {
    opacity: 0.6;
}

/* === Responsive === */
@media (max-width: 768px) {
    .lock-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-bar input[type="text"] {
        width: 100%;
    }
    .detail-images {
        grid-template-columns: 1fr;
    }
    .spec-grid {
        grid-template-columns: 1fr 1fr;
    }
    .inline-status-selects {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* === Image Lightbox === */
.image-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.image-lightbox.active {
    display: flex;
}
.image-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    cursor: default;
}
