/* ============================================
   Individual Directory Table Styles
   ============================================ */

/* Table container */
.amo-member-directory-wrapper {
    margin: 0 0 20px 0;
}

/* Desktop/Tablet: Table view */
.amo-directory-table-view {
    display: block;
}

/* Make all spans within table view display as block for stacked layout */
.amo-directory-table-view span {
    display: block;
}

/* Keep sortable location elements inline (City, State Zip on one line) */
.amo-directory-table thead .amo-header-location .amo-sortable {
    display: inline;
}

/* Mobile: Card view (hidden on desktop) */
.amo-directory-card-view {
    display: none;
}

/* Base table styles */
.amo-directory-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

/* Table borders */
.amo-directory-table.table-bordered {
    border: 1px solid #ddd;
}

.amo-directory-table.table-bordered th,
.amo-directory-table.table-bordered td {
    border: 1px solid #ddd;
}

/* Table stripes */
.amo-directory-table.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--stripe-color, #f9f9f9); /* Use CSS variable with fallback */
}

/* Table header */
.amo-directory-table thead th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    background-color: #f5f5f5;
    border-bottom: 2px solid #ddd;
}

/* Sortable columns */
.amo-directory-table thead th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 25px;
}

.amo-directory-table thead th.sortable:hover {
    background-color: #e9e9e9;
}

/* Sortable header text elements */
.amo-directory-table thead .amo-sortable {
    cursor: pointer;
    user-select: none;
}

.amo-directory-table thead .amo-sortable:hover {
    opacity: 0.7;
}

/* Sort indicator (arrow) */
.amo-directory-table thead th.sortable .sort-indicator {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 5px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    opacity: 0.3;
}

/* Default: both arrows */
.amo-directory-table thead th.sortable .sort-indicator:before,
.amo-directory-table thead th.sortable .sort-indicator:after {
    content: '';
    position: absolute;
    right: 8px;
}

.amo-directory-table thead th.sortable .sort-indicator:before {
    border-bottom: 4px solid currentColor;
    top: 8px;
}

.amo-directory-table thead th.sortable .sort-indicator:after {
    border-top: 4px solid currentColor;
    bottom: 8px;
}

/* Active sort: ascending */
.amo-directory-table thead th.sortable .sort-indicator.asc {
    opacity: 1;
    border-bottom: 6px solid currentColor;
    border-top: 0;
}

/* Active sort: descending */
.amo-directory-table thead th.sortable .sort-indicator.desc {
    opacity: 1;
    border-top: 6px solid currentColor;
    border-bottom: 0;
}

/* Table cells */
.amo-directory-table tbody td {
    padding: 10px;
    vertical-align: top;
}

/* Hover effect on rows */
.amo-directory-table tbody tr:hover {
    background-color: #f0f0f0;
}

/* Button styling */
.amo-directory-table .btn {
    padding: 5px 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    text-transform: uppercase;
}

.amo-directory-table .btn-primary {
    background-color: #0073aa;
    color: white;
}

.amo-directory-table .btn-primary:hover {
    background-color: #005a87;
}

.amo-directory-table .btn-default {
    background-color: #f0f0f0;
    color: #555;
}

.amo-directory-table .btn:hover {
    opacity: 0.8;
}

/* Directory bio/details button hover */
.amo-individual-details-link:hover,
.amo-organization-details-link:hover {
    background-color: #005a87 !important;
    border-color: #005a87 !important;
}

/* ============================================
   Responsive: Mobile View (Cards)
   ============================================ */

@media (max-width: 767px) {
    /* Hide table on mobile */
    .amo-directory-table-view {
        display: none;
    }

    /* Show cards on mobile */
    .amo-directory-card-view {
        display: block;
    }

    /* Individual card */
    .amo-directory-card {
        background: #fff;
        border: 1px solid #ddd;
        border-radius: 5px;
        padding: 15px;
        margin-bottom: 15px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        display: flex;
        gap: 15px;
    }

    /* Card image */
    .amo-directory-card .amo-card-image {
        flex-shrink: 0;
        width: 100px;
    }

    .amo-directory-card .amo-card-image img {
        width: 100%;
        height: auto;
        border-radius: 5px;
        object-fit: cover;
    }

    /* Card content wrapper */
    .amo-directory-card .amo-card-content {
        flex: 1;
        min-width: 0;
    }

    .amo-directory-card h4 {
        margin-top: 0;
        margin-bottom: 10px;
        font-size: 18px;
        border-bottom: 1px solid #eee;
        padding-bottom: 8px;
    }

    .amo-directory-card p {
        margin: 5px 0;
        font-size: 14px;
    }

    .amo-directory-card .card-label {
        font-weight: 600;
        display: inline-block;
        min-width: 80px;
    }

    .amo-directory-card .btn {
        width: 100%;
        margin-top: 10px;
    }
}

/* Search form */
.amo-directory-search-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.amo-directory-search-form .amo-form-group {
    margin-bottom: 15px;
}

.amo-directory-search-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.amo-directory-search-form input[type="text"],
.amo-directory-search-form select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
}

.amo-directory-search-form button {
    padding: 10px 20px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.amo-directory-search-form button:hover {
    background-color: #005a87;
}

/* Pagination */
.amo-directory-pagination {
    margin-top: 20px;
    text-align: center;
}

.amo-directory-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 3px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
}

.amo-directory-pagination .page-numbers.current {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.amo-directory-pagination .page-numbers:hover {
    background: #e0e0e0;
}

/* Export loading animation */
@keyframes rotation {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(359deg);
    }
}
