/**
 * AR Member Directory Frontend Styles
 */

.ar-member-directory-container {
    margin: 20px 0;
}

/* Search Container */
.ar-member-search-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.ar-member-search {
    flex: 1;
    min-width: 250px;
    padding: 10px 15px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.3s;
}

.ar-member-search:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.ar-member-filter {
    min-width: 200px;
    padding: 10px 15px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.3s;
    background-color: white;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23666' d='m2 0-2 2h4zm0 5 2-2h-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    padding-right: 35px;
}

.ar-member-filter:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.ar-member-download-btn {
    padding: 10px 20px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.ar-member-download-btn:hover {
    background-color: #005a87;
}

.ar-member-download-btn:active {
    transform: translateY(1px);
}

/* Individual download buttons - Bootstrap button style */
.ar-member-download-single {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    cursor: pointer;
    text-decoration: none;
    
    /* Bootstrap primary button styling */
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.ar-member-download-single:hover {
    color: #fff;
    background-color: #0069d9;
    border-color: #0062cc;
}

.ar-member-download-single:focus {
    color: #fff;
    background-color: #0069d9;
    border-color: #0062cc;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.ar-member-download-single:active {
    color: #fff;
    background-color: #0062cc;
    border-color: #005cbf;
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}

.ar-member-download-single:disabled {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
    opacity: 0.65;
    cursor: not-allowed;
}

/* Spinning animation for loading state */
.ar-spin {
    animation: ar-member-spin 1s linear infinite;
}

/* Column widths */
.ar-member-col-company {
    width: 20%;
    min-width: 150px;
}

.ar-member-col-contact {
    width: 18%;
    min-width: 130px;
}

.ar-member-col-address {
    width: 25%;
    min-width: 200px;
}

.ar-member-col-phone {
    width: 12%;
    min-width: 100px;
}

.ar-member-col-email {
    width: 15%;
    min-width: 120px;
}

.ar-member-col-actions {
    width: 10%;
    min-width: 80px;
    text-align: center;
    white-space: nowrap;
}

/* New table layout styles */
.ar-member-company {
    line-height: 1.4;
}

.ar-member-company strong {
    display: block;
    margin-bottom: 2px;
    color: #333;
}

.ar-member-website {
    font-size: 0.9em;
    color: #666;
}

.ar-member-website a {
    color: #0073aa;
    text-decoration: none;
}

.ar-member-website a:hover {
    text-decoration: underline;
}

.ar-member-contact {
    line-height: 1.4;
}

.ar-member-contact strong {
    display: block;
    margin-bottom: 2px;
    color: #333;
}

.ar-member-title {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
}

/* Filter class for hiding filtered rows */
.ar-member-filtered {
    display: none !important;
}

/* Table Styles */
.ar-member-table-wrapper {
    overflow-x: auto;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    background: white;
}

.ar-member-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.ar-member-table thead {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.ar-member-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    z-index: 10;
}

.ar-member-table tbody tr {
    border-bottom: 1px solid #e1e1e1;
    transition: background-color 0.2s;
}

.ar-member-table tbody tr:hover {
    background-color: #f5f5f5;
}

.ar-member-table tbody tr:last-child {
    border-bottom: none;
}

.ar-member-table td {
    padding: 10px 15px;
    color: #555;
}

/* Column-specific styles */
.ar-member-col-company_name {
    font-weight: 500;
    color: #333;
}

.ar-member-col-email a,
.ar-member-col-website a {
    color: #0073aa;
    text-decoration: none;
}

.ar-member-col-email a:hover,
.ar-member-col-website a:hover {
    text-decoration: underline;
}

.ar-member-col-phone,
.ar-member-col-fax {
    white-space: nowrap;
}

/* No results message */
.ar-member-no-results {
    padding: 40px;
    text-align: center;
    color: #666;
    font-size: 16px;
}

/* Hidden class for search filtering */
.ar-member-hidden {
    display: none !important;
}

/* Responsive styles */
@media (max-width: 768px) {
    .ar-member-search-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ar-member-search,
    .ar-member-filter {
        min-width: 100%;
        margin-bottom: 10px;
    }
    
    .ar-member-search:last-child,
    .ar-member-filter:last-child {
        margin-bottom: 0;
    }
    
    .ar-member-table {
        font-size: 13px;
    }
    
    .ar-member-table th,
    .ar-member-table td {
        padding: 8px 6px;
    }
    
    /* Hide address column on tablets */
    .ar-member-col-address {
        display: none;
    }
    
    /* Smaller download buttons on mobile */
    .ar-member-download-single {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .ar-member-col-actions {
        width: 80px;
        min-width: 70px;
    }
}

@media (max-width: 480px) {
    /* Hide phone column on very small screens, keep only essentials */
    .ar-member-col-phone {
        display: none;
    }
    
    .ar-member-table th,
    .ar-member-table td {
        padding: 6px 4px;
        font-size: 12px;
    }
    
    .ar-member-download-single {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }
    
    .ar-member-col-actions {
        width: 70px;
        min-width: 60px;
    }
}

/* Loading state */
.ar-member-loading {
    opacity: 0.6;
    pointer-events: none;
}

.ar-member-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: ar-member-spin 1s linear infinite;
}

@keyframes ar-member-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Print styles */
@media print {
    .ar-member-search-container {
        display: none;
    }
    
    .ar-member-table-wrapper {
        border: none;
    }
    
    .ar-member-table {
        border: 1px solid #000;
    }
    
    .ar-member-table th,
    .ar-member-table td {
        border: 1px solid #000;
    }
}