/* Pondora Collection Builder — minimal, utilitarian. */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background: #f4f3ee;
    color: #1f2a1a;
    font-size: 14px;
}

.app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 320px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #dcd8c8;
    padding: 24px 20px;
    overflow-y: auto;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.brand h1 {
    margin: 0;
    font-size: 20px;
    letter-spacing: 0.5px;
    color: #2b5f36;
}
.brand .subtitle {
    margin: 2px 0 0;
    font-size: 12px;
    color: #6c7a55;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.meta {
    font-size: 12px;
    color: #6c7a55;
    padding: 10px;
    background: #f8f7ef;
    border: 1px solid #e6e1cf;
    border-radius: 6px;
    line-height: 1.5;
}
.meta strong {
    color: #1f2a1a;
    font-weight: 600;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #5a6842;
}

.control > span {
    font-weight: 500;
    letter-spacing: 0.3px;
}

.control input[type="search"],
.control input[type="number"],
.control select {
    padding: 7px 9px;
    font-size: 13px;
    border: 1px solid #c8c2ad;
    border-radius: 4px;
    background: #fff;
    color: #1f2a1a;
    font-family: inherit;
}
.control input:focus,
.control select:focus {
    outline: none;
    border-color: #2b5f36;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #1f2a1a;
}

.rank-filter {
    border: 1px dashed #c8c2ad;
    padding: 10px;
    border-radius: 4px;
    background: #fbfaf3;
}
.rank-filter-label {
    font-size: 12px;
    font-weight: 500;
    color: #5a6842;
    margin-bottom: 6px;
}
.rank-filter-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.rank-filter-row input {
    flex: 1;
    padding: 6px;
    border: 1px solid #c8c2ad;
    border-radius: 4px;
    font-size: 12px;
}
.rank-filter-row input:disabled {
    background: #ece9db;
    color: #9b9882;
    cursor: not-allowed;
}
.rank-filter .hint {
    margin: 6px 0 0;
    font-size: 11px;
    color: #8a8a70;
    font-style: italic;
}

/* Trait filters */
.trait-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.trait-filter-group {
    border-top: 1px solid #e6e1cf;
    padding-top: 10px;
}
.trait-filter-group summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: #5a6842;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}
.trait-filter-group summary::after {
    content: "+";
    font-size: 16px;
    color: #8a8a70;
}
.trait-filter-group[open] summary::after {
    content: "−";
}
.trait-options {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 6px 0 0 4px;
    max-height: 220px;
    overflow-y: auto;
}
.trait-option {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: #1f2a1a;
    cursor: pointer;
    padding: 2px 0;
}
.trait-option input[type="checkbox"] {
    margin: 0;
}
.trait-option .trait-count {
    margin-left: auto;
    font-size: 11px;
    color: #8a8a70;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #e6e1cf;
}

.btn {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    font-family: inherit;
    font-weight: 500;
    transition: background 80ms, border-color 80ms;
}
.btn-primary {
    background: #2b5f36;
    color: #fff;
}
.btn-primary:hover { background: #224d2c; }
.btn-secondary {
    background: #fff;
    color: #1f2a1a;
    border-color: #c8c2ad;
}
.btn-secondary:hover { background: #f4f3ee; }

/* Main content */
.content {
    flex: 1;
    padding: 24px 28px 40px;
    min-width: 0;
}
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}
.result-count {
    font-size: 14px;
    color: #1f2a1a;
    font-weight: 500;
}
.active-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.filter-pill {
    background: #fff;
    border: 1px solid #c8c2ad;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11px;
    color: #1f2a1a;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.filter-pill button {
    background: none;
    border: 0;
    cursor: pointer;
    font-size: 14px;
    color: #8a8a70;
    padding: 0;
    line-height: 1;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.card {
    background: #fff;
    border: 1px solid #e6e1cf;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 80ms, box-shadow 80ms;
    display: flex;
    flex-direction: column;
}
.card:hover {
    border-color: #2b5f36;
    box-shadow: 0 2px 8px rgba(43, 95, 54, 0.12);
}
.card-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f4f3ee;
    display: block;
    object-fit: cover;
}
.card-meta {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.card-title {
    font-size: 13px;
    font-weight: 600;
    color: #1f2a1a;
    display: flex;
    align-items: center;
    gap: 6px;
}
.card-sub {
    font-size: 11px;
    color: #6c7a55;
}
.card-badges {
    display: flex;
    gap: 4px;
    margin-top: 3px;
    flex-wrap: wrap;
}
.badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    background: #e6e1cf;
    color: #5a6842;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.badge-pond {
    background: #d4e8d6;
    color: #2b5f36;
}
.badge-rank {
    background: #f0e6cf;
    color: #8a6b20;
}

.empty {
    padding: 40px;
    text-align: center;
    color: #8a8a70;
    font-style: italic;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(31, 42, 26, 0.55);
}
.modal-body {
    position: relative;
    background: #fff;
    border-radius: 8px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: 0;
    font-size: 26px;
    color: #8a8a70;
    cursor: pointer;
    line-height: 1;
}
.modal-content {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 1fr;
    gap: 24px;
}
.modal-content img {
    width: 100%;
    border-radius: 4px;
    background: #f4f3ee;
}
.modal-info h2 {
    margin: 0 0 4px;
    font-size: 22px;
    color: #1f2a1a;
}
.modal-info .modal-sub {
    font-size: 13px;
    color: #6c7a55;
    margin-bottom: 16px;
}
.attrs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}
.attrs .attr {
    background: #f8f7ef;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 12px;
}
.attrs .attr-key {
    color: #6c7a55;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}
.attrs .attr-val {
    color: #1f2a1a;
    font-weight: 600;
}
.info-block {
    margin-top: 16px;
    font-size: 12px;
    color: #5a6842;
}
.info-block .label {
    font-weight: 600;
    color: #1f2a1a;
    margin-right: 6px;
}
.mono {
    font-family: "SF Mono", Menlo, Consolas, monospace;
    font-size: 11px;
    color: #5a6842;
    word-break: break-all;
}

@media (max-width: 900px) {
    .sidebar { width: 260px; padding: 16px 14px; }
    .content { padding: 16px; }
    .modal-content { grid-template-columns: 1fr; }
}
