/* ──────────────────────────────────────────────────────────────
   ArchDrawings Library — Public Stylesheet
   File: public/style.css
   ────────────────────────────────────────────────────────────── */

/* ── VARIABLES ──────────────────────────────────────────────── */
:root {
    --arch-primary:       #1a3c5e;
    --arch-primary-hover: #14304e;
    --arch-accent:        #e07b39;
    --arch-bg:            #f7f8fa;
    --arch-card-bg:       #ffffff;
    --arch-border:        #e2e5ea;
    --arch-text:          #1d2327;
    --arch-muted:         #6b7280;
    --arch-radius:        8px;
    --arch-shadow:        0 2px 8px rgba(0,0,0,0.07);
}

/* ── WRAPPER ─────────────────────────────────────────────────── */
.arch-search-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--arch-text);
}

/* ── FILTER PANEL ────────────────────────────────────────────── */
.arch-filter-panel {
    background: var(--arch-card-bg);
    border: 1px solid var(--arch-border);
    border-radius: var(--arch-radius);
    padding: 28px 32px;
    margin-bottom: 28px;
    box-shadow: var(--arch-shadow);
}

.arch-filter-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--arch-primary);
    margin: 0 0 24px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--arch-border);
}

/* ── FILTER GRID ─────────────────────────────────────────────── */
.arch-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.arch-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.arch-filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--arch-text);
}

.arch-select,
.arch-input {
    padding: 9px 12px;
    border: 1px solid var(--arch-border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--arch-text);
    background: #fff;
    transition: border-color 0.15s;
    width: 100%;
    box-sizing: border-box;
}

.arch-select:focus,
.arch-input:focus {
    outline: none;
    border-color: var(--arch-primary);
    box-shadow: 0 0 0 3px rgba(26,60,94,0.12);
}

/* Checkbox row */
.arch-filter-checkbox-group {
    justify-content: flex-end;
    padding-bottom: 2px;
}

.arch-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 9px 0;
}

.arch-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--arch-primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* ── FILTER ACTIONS ──────────────────────────────────────────── */
.arch-filter-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.arch-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    line-height: 1;
}

.arch-btn:active {
    transform: scale(0.98);
}

.arch-btn-primary {
    background: var(--arch-primary);
    color: #ffffff;
    border-color: var(--arch-primary);
}

.arch-btn-primary:hover {
    background: var(--arch-primary-hover);
    border-color: var(--arch-primary-hover);
}

.arch-btn-secondary {
    background: transparent;
    color: var(--arch-muted);
    border-color: var(--arch-border);
}

.arch-btn-secondary:hover {
    background: var(--arch-bg);
    color: var(--arch-text);
    border-color: #c8cdd5;
}

/* ── RESULTS AREA ────────────────────────────────────────────── */
.arch-results-area {
    min-height: 80px;
}

.arch-results-placeholder,
.arch-no-results {
    text-align: center;
    color: var(--arch-muted);
    padding: 40px 20px;
    font-size: 15px;
}

.arch-results-count {
    font-size: 14px;
    color: var(--arch-muted);
    margin: 0 0 20px;
    font-weight: 500;
}

/* ── RESULTS GRID ────────────────────────────────────────────── */
.arch-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* ── RESULT CARD ─────────────────────────────────────────────── */
.arch-result-card {
    background: var(--arch-card-bg);
    border: 1px solid var(--arch-border);
    border-radius: var(--arch-radius);
    box-shadow: var(--arch-shadow);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}

.arch-result-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

/* Thumbnail */
.arch-card-thumb {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: var(--arch-bg);
    border-bottom: 1px solid var(--arch-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.arch-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* No thumbnail fallback */
.arch-card-thumb-placeholder {
    width: 100%;
    height: 140px;
    background: linear-gradient(135deg, #e8edf3 0%, #d4dce8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9aa5b4;
    font-size: 48px;
}

/* Card body */
.arch-card-body {
    padding: 18px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.arch-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--arch-primary);
    margin: 0;
    line-height: 1.3;
}

/* Spec list */
.arch-card-specs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.arch-card-specs li {
    background: var(--arch-bg);
    border: 1px solid var(--arch-border);
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--arch-text);
    font-weight: 500;
    white-space: nowrap;
}

/* Taxonomy badges */
.arch-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.arch-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.arch-badge-building {
    background: #e8f0fe;
    color: #1a3c5e;
}

.arch-badge-drawing {
    background: #fef3e2;
    color: #92400e;
}

/* Download button */
.arch-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: auto;
    padding: 10px 18px;
    background: var(--arch-accent);
    color: #ffffff;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
    text-align: center;
}

.arch-download-btn:hover {
    background: #c96a2a;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
}

.arch-download-btn:before {
    content: "⬇";
    font-size: 14px;
}

/* ── LOADING SPINNER ─────────────────────────────────────────── */
.arch-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--arch-muted);
}

.arch-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--arch-border);
    border-top-color: var(--arch-primary);
    border-radius: 50%;
    animation: arch-spin 0.7s linear infinite;
    margin: 0 auto 12px;
}

@keyframes arch-spin {
    to { transform: rotate(360deg); }
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 640px) {
    .arch-filter-panel {
        padding: 20px 18px;
    }
    .arch-filter-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }
    .arch-results-grid {
        grid-template-columns: 1fr;
    }
    .arch-filter-actions {
        flex-direction: column;
    }
    .arch-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 400px) {
    .arch-filter-grid {
        grid-template-columns: 1fr;
    }
}
