/**
 * Community Database Search Styles
 */

.community-search-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.community-search-header {
    margin-bottom: 30px;
    text-align: center;
}

.community-search-header h2 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #333;
}

.community-search-form {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.search-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.search-field {
    margin-bottom: 15px;
}

.search-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #444;
}

.search-field input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-field input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.advanced-field {
    display: none;
}

.show-advanced .advanced-field {
    display: block;
}

.search-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.button {
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.button.primary {
    background-color: #2271b1;
    color: white;
}

.button.primary:hover {
    background-color: #135e96;
}

.button.secondary {
    background-color: #f0f0f1;
    color: #2c3338;
    border: 1px solid #c3c4c7;
}

.button.secondary:hover {
    background-color: #e0e0e1;
}

#toggle-advanced-search .hide-text {
    display: none;
}

.show-advanced #toggle-advanced-search .show-text {
    display: none;
}

.show-advanced #toggle-advanced-search .hide-text {
    display: inline;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.search-results-header h3 {
    margin: 0;
    font-size: 20px;
}

.search-results-count {
    font-size: 14px;
    color: #666;
}

.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.member-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.member-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.member-card-header {
    padding: 15px;
    text-align: center;
    background: #f5f5f5;
}

.member-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 10px;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-name {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 5px;
}

.member-card-body {
    padding: 15px;
}

.member-info {
    margin-bottom: 5px;
    font-size: 14px;
    color: #555;
}

.member-info strong {
    color: #333;
    margin-right: 5px;
}

.member-card-footer {
    padding: 10px 15px;
    background: #f9f9f9;
    text-align: center;
    border-top: 1px solid #eee;
}

.view-details-btn {
    color: #2271b1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.view-details-btn:hover {
    text-decoration: underline;
}

.search-pagination {
    text-align: center;
    margin-top: 20px;
}

.search-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 0;
    color: #666;
}

.search-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 0;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #2271b1;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Modal Styles */
.community-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 50px auto;
    padding: 0;
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.member-detail-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.member-detail-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 15px;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.member-detail-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-detail-name {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 5px;
}

.member-detail-info {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.detail-group {
    margin-bottom: 15px;
}

.detail-label {
    font-weight: 500;
    color: #666;
    margin-bottom: 5px;
    font-size: 14px;
}

.detail-value {
    color: #333;
    font-size: 16px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .search-form-grid {
        grid-template-columns: 1fr;
    }
    
    .search-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-actions button {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .member-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .modal-content {
        width: 95%;
        margin: 20px auto;
    }
    
    .member-detail-info {
        grid-template-columns: 1fr;
    }
}