/* Styles for the MAIN request list page ONLY */
.rsp-archive-list-final .rsp-list-item-final {
    background: #fff;
    border: 1px solid #e9e9e9;
    border-radius: 4px;
    margin-bottom: 1.5em;
    padding: 1.5em;
    display: flex;
    flex-direction: column;
}
.rsp-archive-list-final .rsp-header-final {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1em;
    margin-bottom: 1em;
    border-bottom: 1px solid #f0f0f0;
}
.rsp-archive-list-final .rsp-header-left { display: flex; align-items: center; gap: 15px; }
.rsp-archive-list-final .rsp-header-left strong { font-size: 1.2em; }
.rsp-archive-list-final .rsp-header-right { font-size: 0.9em; color: #777; }
.rsp-archive-list-final .rsp-body-final {
    flex-grow: 1; /* Pushes footer down */
}
.rsp-archive-list-final .rsp-parts-archive-table { width: 100%; border-collapse: collapse; }
.rsp-archive-list-final .rsp-parts-archive-table td { padding: 4px 0; vertical-align: top; font-size: 14px; border: none; }
.rsp-archive-list-final .part-brand-desc { width: 60%; }
.rsp-archive-list-final .part-condition-mfg { width: 30%; font-style: italic; color: #555; }
.rsp-archive-list-final .part-qty { width: 10%; text-align: right; }
.rsp-archive-list-final .rsp-footer-final {
    margin-top: 1.5em;
    text-align: right; /* Moves button to the right */
}
.rsp-archive-list-final .rsp-button {
    background-color: #E67E22; /* Orange */
    border-color: #E67E22;
}
.rsp-archive-list-final .rsp-button:hover {
    background-color: #D35400; /* Darker Orange */
    border-color: #D35400;
}
/* --- Styles for the CORRECTED Archive Item Layout --- */

.rsp-list-item-final {
    display: flex;
    flex-direction: column; /* Stacks header, body, footer vertically */
    padding: 1.5em;
    border: 1px solid #e9e9e9;
    border-radius: 4px;
    background: #fff;
    margin-bottom: 1.5em;
}

.rsp-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 1em;
    padding-bottom: 1em;
    border-bottom: 1px solid #f0f0f0;
}

.rsp-list-header-left, .rsp-list-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.rsp-list-header-left strong { font-size: 1.1em; }
.rsp-list-header-right { font-size: 0.9em; color: #777; }

.rsp-list-body {
    flex-grow: 1; /* This is the key part that pushes the footer down */
    margin-bottom: 1.5em;
}

.rsp-parts-text-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rsp-parts-text-list li {
    padding: 2px 0;
    color: #555;
}

.rsp-list-footer {
    text-align: right; /* Pushes the button to the right */
}

/* Ensure the button has the correct orange color on this page */
.rsp-list-footer .rsp-button {
    background-color: #E67E22 !important;
    border-color: #E67E22 !important;
}

.rsp-list-footer .rsp-button:hover {
    background-color: #D35400 !important;
    border-color: #D35400 !important;
}
/*
==========================================================================
  NEW: "Load More" Button and Spinner Styling
==========================================================================
*/

/* 1. Wrapper for the button to center it */
.rsp-load-more-wrapper {
    text-align: center;
    margin-top: 30px;
    padding: 20px 0;
}

/* 2. The Button Itself */
#rsp-load-more-btn {
    /* Re-use your existing .rsp-button styles for consistency */
    background-color: #f97316; /* Orange color from your example */
    color: #ffffff;
    border: none;
    padding: 12px 28px; /* A bit larger for a main action button */
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease;
    
    /* --- THIS IS THE FIX for the hand icon --- */
    cursor: pointer; 
}

/* 3. Hover and Active States */
#rsp-load-more-btn:hover {
    background-color: #ea580c; /* A slightly darker orange for hover */
}

#rsp-load-more-btn:active {
    transform: translateY(1px); /* Gives a nice "press" effect */
}

/* 4. The Loading Spinner */
.rsp-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #3b82f6; /* A contrasting blue for the spinner */
    animation: rsp-spin 1s ease-in-out infinite;
    -webkit-animation: rsp-spin 1s ease-in-out infinite;
}

@keyframes rsp-spin {
    to { -webkit-transform: rotate(360deg); }
}
@-webkit-keyframes rsp-spin {
    to { -webkit-transform: rotate(360deg); }
}
/* --- Styles for Archive Filter Form --- */
.rsp-archive-filters {
    background-color: #f8f9fa;
    padding: 2em;
    border-radius: 8px;
    margin-bottom: 2em;
    border: 1px solid #e9ecef;
}
.rsp-filter-form {
    display: flex;
    gap: 2em;
    flex-wrap: wrap;
}
.filter-main {
    flex: 3;
    min-width: 300px;
}
.filter-side {
    flex: 1;
    min-width: 200px;
}
.filter-group {
    margin-bottom: 1.5em;
}
.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5em;
}
.filter-group select,
.filter-group input[type="search"] {
    width: 100%;
    padding: 0.75em;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #fff; /* Added for consistency */
    font-size: 14px; /* Added for consistency */
}
    width: 100%;
    padding: 0.75em;
    border: 1px solid #ced4da;
    border-radius: 4px;
}
.filter-side .filter-group {
    display: flex;
    align-items: stretch;
}
.filter-side input[type="search"] {
    flex-grow: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: 0;
}
.filter-side .rsp-button {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    white-space: nowrap;
}
.rsp-country-filter-box {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 1em;
    max-height: 350px; /* Increased from 250px to 350px */
    overflow-y: auto;
    background-color: #fff;
}
.rsp-country-filter-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.rsp-country-filter-box details summary {
    cursor: pointer;
    font-weight: bold;
    padding: 0.25em 0;
}
.rsp-country-filter-box details ul {
    padding-left: 1.5em;
}
.rsp-country-filter-box label {
    font-weight: normal;
}
.filter-checkboxes label {
    font-weight: normal;
}

/* --- Pagination Styles --- */
.rsp-pagination {
    margin-top: 2em;
    text-align: center;
}
.rsp-pagination .page-numbers {
    display: inline-block;
    padding: 0.5em 1em;
    margin: 0 0.25em;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-decoration: none;
    color: #0d6efd;
}
.rsp-pagination .page-numbers.current,
.rsp-pagination .page-numbers:hover {
    background-color: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}
/* --- NEW STYLES for Layout and "Showing..." Text --- */

/* This sets a max-width on the entire filter box and centers it */
.rsp-archive-filters {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

/* This styles the new "Showing X of Y" text */
.rsp-results-summary {
    max-width: 1100px;
    margin: 0 auto 1.5em auto; /* Aligns with the filter box */
    font-size: 0.9em;
    color: #555;
    padding: 0 0.5em;
}
/* --- NEW: Styles for Indeterminate Checkbox --- */
.continent-group summary {
    position: relative;
}

.continent-group .continent-checkbox {
    margin-right: 8px;
    vertical-align: middle;
}

/* Style the checkbox when it's in the "partially checked" state */
.continent-group input[type="checkbox"]:indeterminate {
    background-color: #0d6efd; /* Blue color */
    border-color: #0d6efd;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 8h12'/%3e%3c/svg%3e");
}

.continent-group summary label {
    display: inline-flex;
    align-items: center;
    width: 100%;
    cursor: pointer;
}
/* --- FINAL POLISH for Filter Form UI --- */

/* 1. Set a max-width for the brand filter specifically */
.filter-group #rsp-brand-filter {
    max-width: 300px;
}

/* 2. Style the continent summary to be clickable */
.rsp-country-filter-box details summary {
    display: flex;
    align-items: center;
    gap: 8px; /* Space between checkbox and name */
    padding: 4px 0;
    cursor: pointer;
    list-style: none; /* Hide the default triangle */
}

/* Hide the default disclosure triangle on Webkit browsers (Chrome, Safari) */
.rsp-country-filter-box details summary::-webkit-details-marker {
    display: none;
}

/* 3. Add a new, better-looking triangle using CSS */
.rsp-country-filter-box .continent-name::before {
    content: '►'; /* Right-pointing triangle */
    font-size: 0.7em;
    margin-right: 8px;
    color: #555;
    transition: transform 0.2s;
}

/* Rotate the triangle when the details are open */
.rsp-country-filter-box details[open] > summary .continent-name::before {
    transform: rotate(90deg);
}
/* --- Style for the Public Request Note --- */
.rsp-public-note {
    margin-top: 1em;
    padding-top: 1em;
    border-top: 1px dashed #e0e0e0;
    font-style: italic;
    color: #555;
    font-size: 0.9em;
    line-height: 1.5;
}
/* --- DEFINITIVE Styles for Request Card Table & Header --- */

/* BOLD HEADER TEXT */
.rsp-card-header .rsp-request-location,
.rsp-card-header .rsp-request-date,
.rsp-card-header .rsp-request-meta {
    font-weight: 600;
}

/* PARTS TABLE STYLING */
.rsp-parts-list-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

.rsp-parts-list-table thead th {
    background-color: #f8f9fa;
    padding: 0.75em;
    text-align: left; /* Aligns headers to the left */
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    border-bottom: 1px solid #e9ecef;
}

.rsp-parts-list-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
}

.rsp-parts-list-table tbody tr:last-child {
    border-bottom: none;
}

.rsp-parts-list-table td {
    padding: 0.75em;
    vertical-align: top;
    font-size: 13px; /* Smaller font size for the content */
    color: #374151;
    text-align: left; /* Aligns content to the left */
}

/* Column Widths - Description is now the largest */
.rsp-parts-list-table .part-brand { width: 15%; font-weight: 600; color: #111827; }
.rsp-parts-list-table .part-model { width: 15%; }
.rsp-parts-list-table .part-no { width: 15%; }
.rsp-parts-list-table .part-desc { width: 25%; }
.rsp-parts-list-table .part-condition { width: 15%; }
.rsp-parts-list-table .part-manufacturer { width: 15%; }
.rsp-parts-list-table .part-qty {
    width: 5%;
    text-align: right; /* Qty should be right-aligned */
    font-weight: 600;
    color: #111827;
}
/*
==========================================================================
   STYLES for Request Archive Page
==========================================================================
*/

/* --- The card container for a single request --- */
.rsp-request-card {
    background-color: #ffffff;
    border: 1px solid #e9e9e9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

/* --- Card Header --- */
.rsp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.rsp-header-left, .rsp-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 14px;
}

.rsp-request-id {
    font-weight: 600;
    color: #111827;
}

.rsp-request-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #4b5563;
    font-weight: 600;
}

.rsp-request-meta,
.rsp-request-date {
    font-weight: 600;
    color: #4b5563;
}

/* --- Card Body & Parts Table --- */
.rsp-card-body {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.rsp-parts-list-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

.rsp-parts-list-table thead th {
    background-color: #f8f9fa;
    padding: 0.75em;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    border-bottom: 1px solid #e9ecef;
}

.rsp-parts-list-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
}

.rsp-parts-list-table tbody tr:last-child {
    border-bottom: none;
}

.rsp-parts-list-table td {
    padding: 0.75em;
    vertical-align: top;
    font-size: 13px;
    color: #374151;
    text-align: left;
}

/* Column Widths (v2 - Adjusted for QTY) */
.rsp-parts-list-table .part-brand { width: 15%; font-weight: 600; color: #111827; }
.rsp-parts-list-table .part-model { width: 14%; }
.rsp-parts-list-table .part-no { width: 14%; }
.rsp-parts-list-table .part-desc { width: 24%; }
.rsp-parts-list-table .part-condition { width: 14%; }
.rsp-parts-list-table .part-manufacturer { width: 11%; }
.rsp-parts-list-table .part-qty {
    width: 8%;
    text-align: left;
    font-weight: 600;
    color: #111827;
    white-space: nowrap; /* Prevents "pcs" from wrapping */
}

/* --- Public Note --- */
.rsp-public-note {
    margin-top: 1em;
    padding-top: 1em;
    border-top: 1px dashed #e0e0e0;
    font-style: italic;
    color: #555;
    font-size: 0.9em;
    line-height: 1.5;
}

/* --- Card Footer & Buttons --- */
.rsp-card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 1rem;
    gap: 0.75rem;
}

/* Styles for buttons (copied for consistency) */
.rsp-button {
    display: inline-block;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.rsp-button.rsp-button-small {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 5px;
}

/* Orange "Quote" button */
.rsp-button.rsp-button-quote {
    background-color: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #ffffff !important;
}
.rsp-button.rsp-button-quote:hover {
    background-color: #d97706 !important;
    border-color: #d97706 !important;
}

/* Light Grey "View more" button */
.rsp-button.rsp-button-tertiary {
    background-color: #f3f4f6 !important;
    border-color: #e5e7eb !important;
    color: #374151 !important;
}
.rsp-button.rsp-button-tertiary:hover {
    background-color: #e5e7eb !important;
    border-color: #d1d5db !important;
}

/* Secondary "View Your Quote" button */
.rsp-button.rsp-button-secondary {
    background-color: #e0e7ff !important;
    border-color: #c7d2fe !important;
    color: #4338ca !important;
}
.rsp-button.rsp-button-secondary:hover {
    background-color: #c7d2fe !important;
    border-color: #a5b4fc !important;
    color: #312e81 !important;
}