/* =============================================
   Resurrection Cemetery Search - Frontend Styles
   Light theme for white content area
   ============================================= */

.rcs-wrap {
    font-family: 'Titillium Web', 'Segoe UI', sans-serif;
    color: #2c2c2c;
    width: 100%;
    padding: 0;
}

.rcs-wrap *,
.rcs-wrap *::before,
.rcs-wrap *::after {
    box-sizing: border-box;
}

/* ---------- Search Form ---------- */

.rcs-search-form {
    background: #f5f5f7;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 20px;
}

.rcs-search-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.rcs-search-field label {
    display: block;
    font-size: 0.8em;
    color: #555;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.rcs-search-field--name {
    flex: 2;
    min-width: 200px;
}

.rcs-search-field--section {
    flex: 1;
    min-width: 140px;
}

.rcs-search-field--btn {
    flex: 0 0 auto;
}

.rcs-search-form input[type="text"],
.rcs-search-form select {
    width: 100%;
    padding: 10px 14px;
    font-family: 'Titillium Web', sans-serif;
    font-size: 1em;
    color: #222;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    transition: border-color 0.2s;
}

.rcs-search-form input[type="text"]:focus,
.rcs-search-form select:focus {
    outline: none;
    border-color: #7a00df;
    box-shadow: 0 0 0 2px rgba(122, 0, 223, 0.15);
}

/* ---------- Buttons ---------- */

.rcs-btn {
    font-family: 'Titillium Web', sans-serif;
    font-size: 1em;
    font-weight: 600;
    padding: 10px 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rcs-btn--primary {
    background: #7a00df;
    color: #ffffff;
}

.rcs-btn--primary:hover {
    background: #6600bb;
}

.rcs-btn--back {
    background: #f0f0f0;
    color: #444;
    border: 1px solid #ccc;
    margin-bottom: 24px;
    font-size: 0.95em;
    padding: 8px 20px;
}

.rcs-btn--back:hover {
    background: #e0e0e0;
    color: #222;
}

/* ---------- Results Info ---------- */

.rcs-results-info {
    font-size: 0.9em;
    color: #777;
    margin-bottom: 12px;
}

/* ---------- Results Table ---------- */

.rcs-results-wrap {
    overflow-x: auto;
    width: 100%;
}

.rcs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.rcs-table thead {
    background: #f5f5f7;
}

.rcs-table th {
    font-family: 'Abel', sans-serif;
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #444;
    padding: 12px 14px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 2px solid #ddd;
}

.rcs-table th.rcs-sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.rcs-table th.rcs-sortable:hover {
    color: #7a00df;
}

.rcs-table th.rcs-sort-active {
    color: #7a00df;
}

.rcs-sort-arrow {
    font-size: 0.7em;
    margin-left: 4px;
    opacity: 0.5;
}

.rcs-sort-active .rcs-sort-arrow {
    opacity: 1;
}

.rcs-table td {
    padding: 11px 14px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.rcs-table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}

.rcs-table tbody tr:hover {
    background: rgba(122, 0, 223, 0.06);
}

.rcs-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.rcs-table tbody tr:nth-child(even):hover {
    background: rgba(122, 0, 223, 0.06);
}

.rcs-veteran-flag {
    display: inline-block;
    background: #2d5016;
    color: #fff;
    font-size: 0.75em;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---------- Pagination ---------- */

.rcs-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.rcs-pagination button {
    font-family: 'Titillium Web', sans-serif;
    font-size: 0.9em;
    padding: 6px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    color: #444;
    cursor: pointer;
    transition: all 0.2s;
}

.rcs-pagination button:hover {
    background: #f0f0f0;
    color: #222;
}

.rcs-pagination button.active {
    background: #7a00df;
    color: #ffffff;
    border-color: #7a00df;
}

.rcs-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.rcs-pagination .rcs-page-info {
    font-size: 0.9em;
    color: #888;
    padding: 0 10px;
}

/* ---------- Loading ---------- */

.rcs-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 0;
    color: #888;
    font-size: 0.95em;
}

.rcs-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e0e0e0;
    border-top-color: #7a00df;
    border-radius: 50%;
    animation: rcs-spin 0.7s linear infinite;
}

@keyframes rcs-spin {
    to { transform: rotate(360deg); }
}

/* ---------- Detail View ---------- */

.rcs-detail__header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.rcs-detail__name {
    font-family: 'Abel', sans-serif;
    font-size: 2em;
    font-weight: 400;
    color: #1a1a1a;
    margin: 0;
}

.rcs-veteran-badge {
    background: #2d5016;
    color: #fff;
    font-size: 0.8em;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---------- Detail Top Row: Info left, Map right ---------- */

.rcs-detail__top-row {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.rcs-detail__info-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rcs-detail__map-col {
    flex: 0 0 500px;
    max-width: 500px;
}

/* ---------- Cards ---------- */

.rcs-card {
    background: #f9f9fb;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px 24px;
}

.rcs-card__title {
    font-family: 'Abel', sans-serif;
    font-size: 1.1em;
    font-weight: 400;
    color: #333;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8e8e8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rcs-card__desc {
    font-size: 0.85em;
    color: #888;
    margin: -8px 0 16px;
}

/* ---------- Location Numbers ---------- */

.rcs-location-numbers {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.rcs-location-item {
    text-align: center;
    padding: 14px 28px;
    background: #f0eafc;
    border: 1px solid #d4c4f0;
    border-radius: 8px;
    min-width: 100px;
}

.rcs-location-label {
    display: block;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 600;
}

.rcs-location-value {
    display: block;
    font-family: 'Abel', sans-serif;
    font-size: 2em;
    color: #7a00df;
    line-height: 1;
}

/* ---------- Detail List ---------- */

.rcs-detail-list {
    margin: 0;
}

.rcs-detail-list__item {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.rcs-detail-list__item:last-child {
    border-bottom: none;
}

.rcs-detail-list dt {
    flex: 0 0 120px;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #777;
    padding-top: 2px;
    font-weight: 600;
}

.rcs-detail-list dd {
    flex: 1;
    margin: 0;
    color: #333;
    line-height: 1.5;
}

/* ---------- Cemetery Map ---------- */

.rcs-map-container {
    position: relative;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.rcs-map-image {
    display: block;
    width: 100%;
    height: auto;
}

.rcs-map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.rcs-map-section {
    fill: transparent;
    stroke: transparent;
    stroke-width: 2;
    cursor: default;
    transition: fill 0.3s, stroke 0.3s;
}

.rcs-map-section.rcs-map-section--active {
    fill: rgba(122, 0, 223, 0.3);
    stroke: rgba(122, 0, 223, 0.8);
    stroke-width: 3;
}

.rcs-map-legend {
    margin-top: 10px;
    text-align: center;
}

.rcs-map-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    color: #666;
}

.rcs-map-legend__item--active .rcs-map-legend__swatch {
    width: 14px;
    height: 14px;
    background: rgba(122, 0, 223, 0.35);
    border: 2px solid rgba(122, 0, 223, 0.8);
    border-radius: 3px;
    display: inline-block;
}

/* ---------- Nearby Grid ---------- */

.rcs-card--nearby {
    margin-top: 24px;
}

.rcs-nearby-grid {
    overflow-x: auto;
}

.rcs-nearby-grid table {
    border-collapse: collapse;
    margin: 0 auto;
    width: 100%;
}

.rcs-nearby-grid th {
    font-family: 'Abel', sans-serif;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #777;
    padding: 6px 8px;
    text-align: center;
    white-space: nowrap;
}

.rcs-nearby-grid td {
    border: 1px solid #e0e0e0;
    padding: 0;
    text-align: center;
    vertical-align: middle;
    min-width: 100px;
    height: 60px;
}

.rcs-nearby-grid .rcs-nearby-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100%;
    padding: 6px 4px;
    font-size: 0.78em;
    line-height: 1.3;
    color: #555;
    gap: 2px;
}

.rcs-nearby-grid .rcs-nearby-cell--current {
    background: rgba(122, 0, 223, 0.12);
}

.rcs-nearby-grid .rcs-nearby-cell--empty {
    color: #ccc;
    font-size: 0.75em;
}

.rcs-nearby-grid .rcs-nearby-cell__person {
    display: block;
    text-align: center;
    color: #333;
    text-decoration: none;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.rcs-nearby-grid .rcs-nearby-cell__person:hover {
    background: rgba(122, 0, 223, 0.1);
    color: #7a00df;
    text-decoration: none;
}

.rcs-nearby-grid .rcs-nearby-cell__person--active {
    font-weight: 700;
    color: #7a00df;
}

.rcs-nearby-grid .rcs-grid-row-header {
    font-family: 'Abel', sans-serif;
    font-size: 0.75em;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    padding: 6px 10px;
    text-align: right;
    border: none;
    width: 80px;
    font-weight: 600;
}

/* ---------- Empty State ---------- */

.rcs-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.rcs-empty-state__icon {
    font-size: 2.5em;
    margin-bottom: 12px;
    opacity: 0.3;
}

.rcs-empty-state__text {
    font-size: 1.1em;
    color: #666;
}

.rcs-empty-state__hint {
    font-size: 0.9em;
    color: #999;
    margin-top: 6px;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
    .rcs-search-row {
        flex-direction: column;
    }

    .rcs-search-field--name,
    .rcs-search-field--section {
        flex: 1 1 100%;
    }

    .rcs-search-field--btn {
        width: 100%;
    }

    .rcs-btn--primary {
        width: 100%;
        justify-content: center;
    }

    .rcs-detail__top-row {
        flex-direction: column;
    }

    .rcs-detail__map-col {
        flex: 1 1 auto;
        max-width: 100%;
    }

    .rcs-location-numbers {
        gap: 10px;
    }

    .rcs-location-item {
        padding: 10px 14px;
        min-width: 70px;
        flex: 1;
    }

    .rcs-location-value {
        font-size: 1.6em;
    }

    .rcs-detail__name {
        font-size: 1.5em;
    }

    .rcs-detail-list__item {
        flex-direction: column;
        gap: 2px;
    }

    .rcs-detail-list dt {
        flex: none;
    }

    .rcs-table {
        font-size: 0.85em;
    }

    .rcs-table th,
    .rcs-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .rcs-nearby-grid td {
        min-width: 75px;
        height: 50px;
    }

    .rcs-nearby-grid .rcs-nearby-cell {
        font-size: 0.7em;
    }
}
