/**
 * HomeoPilot Remedy Master — Frontend Styles
 *
 * Scope: public site.
 * Classes prefixed with .hprm- to avoid collisions.
 */

/* Generic wrapper */

.hprm-front-wrap {
    margin: 1em 0;
}

/* Search form + filters */

.hprm-front-search-form,
.hprm-affinity-filters,
.hprm-sides-filters,
.hprm-trios-filters {
    margin-bottom: 1em;
    padding: 0.75em 0.9em;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75em;
    align-items: flex-end;
}

.hprm-front-search-form label,
.hprm-affinity-filters label,
.hprm-sides-filters label,
.hprm-trios-filters label {
    display: block;
    font-size: 0.8rem;
    color: #4b5563;
}

.hprm-front-search-form input[type="text"],
.hprm-affinity-filters input[type="text"],
.hprm-affinity-filters select,
.hprm-sides-filters select,
.hprm-trios-filters select {
    min-width: 180px;
}

/* Result messages */

.hprm-front-message {
    font-size: 0.9rem;
    color: #4b5563;
    margin-bottom: 0.75em;
}

.hprm-front-message--muted {
    color: #6b7280;
    font-style: italic;
}

.hprm-rel-view-link {
    display: inline-block;
    white-space: nowrap;
}

/* Tables for results (relationships, affinities, sides, trios) */

.hprm-front-table-wrap {
    overflow-x: auto;
}

.hprm-front-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.hprm-front-table th,
.hprm-front-table td {
    padding: 0.45em 0.6em;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

.hprm-front-table th {
    background: #f3f4f6;
    font-weight: 600;
    color: #111827;
}

.hprm-front-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.hprm-front-table tbody tr:nth-child(odd) {
    background: #ffffff;
}

/* Remedy links */

.hprm-remedy-link {
    color: #2563eb;
    text-decoration: none;
}

.hprm-remedy-link:hover {
    text-decoration: underline;
}

/* Headings / section titles */

.hprm-section-heading {
    font-size: 1.1rem;
    margin-top: 0.5em;
    margin-bottom: 0.3em;
}

.hprm-section-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 0.75em;
}

/* Small tag / pill (e.g. “Kent”, “WB Repertory”, “Strong”) */

.hprm-pill {
    display: inline-block;
    padding: 0.1em 0.5em;
    font-size: 0.75rem;
    border-radius: 999px;
    background: #e5e7eb;
    color: #374151;
}

.hprm-pill--primary {
    background: #dbeafe;
    color: #1d4ed8;
}

.hprm-pill--success {
    background: #dcfce7;
    color: #166534;
}

/* -----------------------------------------------------------
 * Relationship of Remedies — search & details
 * --------------------------------------------------------*/

/* Page shell */

.hprm-rel-search-wrap,
.hprm-rel-details-wrap {
    margin: 1.5em 0;
}

.hprm-rel-page-title,
.hprm-rel-details-title {
    font-size: 1.5rem;
    line-height: 1.25;
    font-weight: 700;
    margin: 0 0 0.4em;
    color: #111827;
}

.hprm-rel-intro {
    font-size: 0.95rem;
    color: #4b5563;
    margin-bottom: 1.1em;
}

/* Search form */

.hprm-rel-search-form {
    margin-bottom: 1.25em;
    padding: 0.75em 0.9em;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

.hprm-rel-search-label {
    display: block;
    font-size: 0.8rem;
    color: #4b5563;
    margin-bottom: 0.35em;
}

.hprm-rel-search-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6em;
    align-items: center;
}

.hprm-rel-search-input {
    flex: 1 1 220px;
    min-width: 0;
    padding: 0.45em 0.55em;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    font-size: 0.9rem;
}

.hprm-rel-search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.hprm-rel-search-button {
    padding: 0.5em 1.1em;
    border-radius: 4px;
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #ffffff;
    font-size: 0.9rem;
    cursor: pointer;
}

.hprm-rel-search-button:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.hprm-rel-search-hint,
.hprm-rel-search-no-results {
    font-size: 0.9rem;
    color: #6b7280;
    margin-top: 0.5em;
}

/* Search results table */

.hprm-rel-search-results {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-top: 0.75em;
}

.hprm-rel-search-results th,
.hprm-rel-search-results td {
    padding: 0.45em 0.6em;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

.hprm-rel-search-results th {
    background: #f3f4f6;
    font-weight: 600;
    color: #111827;
}

.hprm-rel-search-results tbody tr:nth-child(even) {
    background: #f9fafb;
}

.hprm-rel-search-results tbody tr:nth-child(odd) {
    background: #ffffff;
}

.hprm-rel-search-heading {
    font-size: 1.1rem;
    margin-top: 1em;
    margin-bottom: 0.3em;
}

.hprm-rel-relations-summary {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.8rem;
    color: #4b5563;
}

.hprm-rel-relations-summary li + li {
    margin-top: 0.2em;
}

.hprm-rel-view-link {
    display: inline-block;
    font-size: 0.85rem;
    color: #2563eb;
    text-decoration: none;
}

.hprm-rel-view-link:hover {
    text-decoration: underline;
}

.hprm-rel-duration {
    font-size: 0.8rem;
    color: #6b7280;
}

/* Details table */

.hprm-rel-details {
    margin-top: 0.5em;
}

.hprm-rel-details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-bottom: 1.25em;
}

.hprm-rel-details-table th,
.hprm-rel-details-table td {
    padding: 0.5em 0.6em;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

.hprm-rel-details-table th {
    width: 26%;
    max-width: 190px;
    background: #f3f4f6;
    font-weight: 600;
    color: #111827;
}

.hprm-rel-remedy-name {
    font-weight: 700;
    color: #b91c1c; /* red similar to your old design */
}

.hprm-rel-remedy-abbr a,
.hprm-rel-remedy-abbr {
    color: #2563eb;
}

.hprm-rel-remedy-source {
    font-size: 0.85rem;
    color: #374151;
}

.hprm-rel-remedy-duration {
    font-weight: 600;
}

/* Details grid (Complementary / Follows well / Inimical / Antidotes) */

.hprm-rel-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    margin-bottom: 1.3em;
}

.hprm-rel-block {
    padding: 0.85em 0.95em;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

.hprm-rel-block h2 {
    font-size: 1rem;
    margin: 0 0 0.4em;
}

.hprm-rel-block p {
    margin: 0;
    font-size: 0.9rem;
    color: #4b5563;
}

/* Pill list for abbr lists */

.hprm-rel-pill-list {
    list-style: none;
    margin: 0.1em 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35em;
}

.hprm-rel-pill-list li {
    display: inline-flex;
    align-items: center;
    padding: 0.15em 0.75em;
    border-radius: 999px;
    background: #eef2ff;
    color: #1d4ed8;
    font-size: 0.8rem;
    white-space: nowrap;
}

.hprm-rel-notes {
    margin-top: 1em;
    padding-top: 0.75em;
    border-top: 1px solid #e5e7eb;
}

.hprm-rel-notes h2 {
    font-size: 1rem;
    margin: 0 0 0.4em;
}

.hprm-rel-notes p {
    margin: 0;
    font-size: 0.9rem;
    color: #374151;
}

.hprm-rel-details-empty {
    font-size: 0.9rem;
    color: #6b7280;
    font-style: italic;
}

/* -----------------------------------------------------------
 * Responsive tweaks
 * --------------------------------------------------------*/

@media (max-width: 640px) {
    .hprm-front-search-form,
    .hprm-affinity-filters,
    .hprm-sides-filters,
    .hprm-trios-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .hprm-front-table th,
    .hprm-front-table td {
        padding: 0.4em 0.45em;
    }

    .hprm-rel-search-fields {
        flex-direction: column;
        align-items: stretch;
    }

    .hprm-rel-search-button {
        width: 100%;
    }

    .hprm-rel-details-grid {
        grid-template-columns: 1fr;
    }
}
