/* ==========================================================================
   Thingiverse Wizard – Clean UI
   ========================================================================== */

#wp3d-wizard-app {
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#wp3d-wizard-app * {
    box-sizing: border-box;
}

/* --- Buttons (shared) --- */
.wp3d-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    min-height: 44px;
    white-space: nowrap;
}

.wp3d-btn:hover {
    background: #f5f5f5;
    border-color: #aaa;
}

.wp3d-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wp3d-btn-primary {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

.wp3d-btn-primary:hover {
    background: #005f8c;
    border-color: #005f8c;
}

.wp3d-btn-back {
    background: transparent;
    border: 1px solid #ccc;
    color: #555;
    font-size: 13px;
    padding: 10px 16px;
}

.wp3d-btn-back:hover {
    background: #f0f0f0;
}

/* --- Search Bar --- */
.wp3d-search-bar {
    display: flex;
    gap: 10px;
}

#wp3d-search-input {
    flex: 1;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s;
}

#wp3d-search-input:focus {
    border-color: #0073aa;
}

#wp3d-search-submit {
    padding: 14px 28px;
    font-size: 16px;
}

/* --- Results Grid --- */
.results-wrapper {
    margin-top: 20px;
}

#wp3d-grid-output {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.wp3d-thing-card {
    position: relative;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wp3d-thing-card:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.15);
}

.wp3d-thing-card.wp3d-loading {
    opacity: 0.5;
    pointer-events: none;
}

.wp3d-thing-card.wp3d-no-files {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

.wp3d-thing-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.wp3d-thing-card-name {
    display: block;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wp3d-no-files-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 11px;
    text-align: center;
    padding: 4px 0;
}

.wp3d-no-results {
    text-align: center;
    color: #666;
    padding: 40px 20px;
    font-size: 15px;
}

.wp3d-pagination {
    margin-top: 24px;
    text-align: center;
}

#wp3d-load-more {
    padding: 14px 32px;
    font-size: 15px;
}

/* --- File Selection Panel --- */
#wp3d-file-selection-panel {
    margin-top: 10px;
}

.wp3d-panel-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.wp3d-panel-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #222;
}

#wp3d-thing-preview-wrap {
    margin-bottom: 16px;
}

#wp3d-thing-preview {
    width: 100%;
    max-height: 180px;
    object-fit: contain;
    border-radius: 8px;
    background: #f5f5f5;
    padding: 8px;
}

#wp3d-bulk-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 12px;
}

.wp3d-select-all-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    margin: 0;
    min-height: 44px;
    padding: 0 8px;
}

.wp3d-select-all-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.wp3d-file-hint {
    margin: 0 0 12px;
    font-size: 13px;
    color: #666;
}

/* --- File List --- */
#wp3d-individual-files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wp3d-file-row {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.15s;
}

.wp3d-file-row:hover {
    border-color: #0073aa;
}

.wp3d-file-checkbox-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    min-height: 52px;
    border-right: 1px solid #e8e8e8;
    cursor: pointer;
    background: #fafafa;
    margin: 0;
}

.wp3d-file-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.wp3d-file-name {
    flex: 1;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    text-align: left;
    background: none;
    border: none;
    border-right: 1px solid #e8e8e8;
    cursor: pointer;
    min-height: 52px;
    display: flex;
    align-items: center;
    transition: background 0.1s;
}

.wp3d-file-name:hover {
    background: #f0f7fc;
    color: #0073aa;
}

.wp3d-download-btn {
    min-height: 52px;
    border: none;
    border-radius: 0;
    padding: 14px 18px;
    font-size: 13px;
}

/* --- Slicer Workspace --- */
#wp3d-slicer-workspace,
#wp3d-bulk-slicer-workspace {
    margin-top: 10px;
}

#slicer-status-message,
#slicer-status-bulk {
    font-weight: 600;
    font-size: 14px;
    color: #0073aa;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    #wp3d-grid-output {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .wp3d-search-bar {
        flex-direction: column;
    }

    #wp3d-search-submit {
        width: 100%;
    }

    #wp3d-bulk-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .wp3d-file-name {
        font-size: 13px;
        padding: 12px;
    }
}
