/* Zillow-Style Search Layout */
.agents-search-section {
    max-width: 1200px;
    margin: 120px auto 40px;
    /* Reduced top margin slightly */
    padding: 0 40px;
    position: relative;
    z-index: 20 !important;
}

.zillow-tabs {
    display: flex;
    gap: 32px;
    margin-bottom: 32px;
    border-bottom: 1px solid #e2e8f0;
}

.z-tab {
    background: none;
    border: none;
    font-size: 16px;
    color: #64748b;
    padding-bottom: 12px;
    cursor: pointer;
    position: relative;
    font-weight: 500;
}

.z-tab.active {
    color: #3675ff;
    font-weight: 600;
}

.z-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #3675ff;
}

.zillow-title {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 24px;
}

.zillow-inputs-row {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.z-input-wrapper {
    position: relative;
}

.z-input {
    width: 100%;
    padding: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    color: #1e293b;
}

.z-input:focus {
    border-color: #3675ff;
    box-shadow: 0 0 0 3px rgba(54, 117, 255, 0.1);
}

.zillow-filters-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 40px;
    position: relative;
    z-index: 100 !important;
}

.z-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s;
}

.z-filter-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.z-filter-btn.active {
    background: #eff6ff;
    border-color: #3675ff;
    color: #3675ff;
}

.btn-star-icon {
    width: 14px;
    height: 14px;
    color: #3675ff;
}

.results-count {
    margin-bottom: 24px;
    color: #64748b;
    font-size: 16px;
}

.agents-grid-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px 100px 40px;
    position: relative;
    z-index: 1;
}

.agents-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 40px;
}

/* Agent List Card - Zillow Style */
.agent-list-card {
    display: flex;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    gap: 24px;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.agent-list-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.agent-list-card:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
    transform: translateY(-2px);
    z-index: 40;
}

.agent-list-card.z-active {
    z-index: 50;
    border-color: #cbd5e1;
}

/* Left: Photo */
.agent-card-left {
    flex-shrink: 0;
}

.agent-photo-wrapper {
    width: 140px;
    height: 140px;
    border-radius: 8px;
    /* Slightly rounded square like Zillow */
    overflow: hidden;
    position: relative;
    background: #f1f5f9;
}

.agent-photo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Prime Star Styles (Below Image) */
.prime-star-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
}

.prime-star-icon {
    color: #3675ff;
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 2px 4px rgba(54, 117, 255, 0.2));
}

.prime-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #1e293b;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.prime-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}

.prime-star-container:hover .prime-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-12px);
}

/* Middle: Info */
.agent-card-middle {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.agent-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.agent-card-middle h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    line-height: 1.3;
}

.agent-role {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 12px;
    font-weight: 500;
}

.agent-stats-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 12px;
}

.star {
    color: #3675ff;
    /* Brand Blue */
}

.agent-stat-divider {
    color: #cbd5e1;
}

.agent-description {
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.agent-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.agent-tag {
    background: #f1f5f9;
    color: #64748b;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Right: Actions */
.agent-card-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
    min-width: 160px;
    border-left: 1px solid #f1f5f9;
    padding-left: 24px;
}

.btn-profile {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 10px 20px;
    background: white;
    color: #3675ff;
    border: 1px solid #3675ff;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-profile:hover {
    background: #eff6ff;
}

.btn-contact-primary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 10px 20px;
    background: #3675ff;
    /* Brand Blue */
    color: white;
    border: 1px solid #3675ff;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-contact-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(54, 117, 255, 0.2);
}

.mobile-contact-btn {
    display: none;
    /* Desktop only */
}

/* Responsive */
@media (max-width: 1024px) {
    .agents-header h1 {
        font-size: 42px;
    }
}

@media (max-width: 768px) {

    /* Mobile Layout for List Card */
    .agent-list-card {
        padding: 16px;
        gap: 16px;
        flex-direction: row;
        /* Revert to Row Layout (Hamburger style) */
        align-items: flex-start;
        text-align: left;
    }

    .agent-photo-wrapper {
        width: 100px;
        height: 100px;
        margin: 0;
        /* Reset margin */
        flex-shrink: 0;
    }

    .agent-card-middle {
        width: auto;
        flex: 1;
        align-items: flex-start;
        display: block;
        /* Use block to let elements stack naturally */
    }

    .agent-header-row {
        flex-direction: row;
        /* Keep header row horizontal */
        justify-content: space-between;
        align-items: center;
        width: 100%;
        margin-bottom: 4px;
        gap: 8px;
    }

    .agent-card-middle h3 {
        font-size: 18px;
        text-align: left;
        margin-bottom: 0;
    }

    .contact-dropdown-wrapper {
        width: auto;
        /* Auto width for inline button */
        display: block;
    }

    .mobile-contact-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: auto;
        padding: 8px 16px;
        /* Pill shape but smaller for header row */
        background: #3675ff;
        color: white;
        border: none;
        border-radius: 100px;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        box-shadow: none;
        /* Cleaner look for header row */
    }

    /* Reset Dropdown Alignment */
    .contact-dropdown {
        left: auto;
        right: 0;
        transform: translateY(10px);
        width: max-content;
        max-width: none;
        text-align: left;
    }

    .contact-dropdown.show {
        transform: translateY(0);
    }

    .contact-dropdown a {
        justify-content: flex-start;
    }

    .agent-role {
        margin-bottom: 8px;
    }

    .agent-stats-row {
        justify-content: center;
        margin-bottom: 16px;
    }

    .agent-stats-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .agent-stat-divider {
        display: none;
    }

    .agent-description {
        display: none;
        /* Hide description on mobile to save space like Zillow */
    }

    .agent-card-right {
        display: none;
        /* Hide desktop action column */
    }

    .agent-tags {
        display: none;
        /* Optional: hide tags on very small screens or keep them */
    }

    /* Make the whole card clickable, rely on that or add mobile specific bottom buttons if requested. 
       Zillow usually puts a big contact button. Let's make the card clickable (already is) and add a secondary mobile button if needed. 
       For now, we have the 'Contact' button in the header row on mobile.
    */

    .agents-grid {
        gap: 12px;
    }

    .agents-filter-bar {
        padding: 16px;
    }
}

@media (max-width: 640px) {
    .agents-header h1 {
        font-size: 36px;
        margin-bottom: 30px;
    }

    .agents-hero {
        padding-top: 80px !important;
        padding-bottom: 0px;
    }

    .agent-list-card {
        padding: 12px;
    }

    .agent-photo-wrapper {
        width: 80px;
        height: 80px;
    }
}

/* Filter Bar Styles */
.agents-filter-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.search-wrapper {
    flex: 2;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    width: 20px;
    height: 20px;
    color: #94a3b8;
}

#agent-search {
    width: 100%;
    padding: 14px 14px 14px 48px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

#agent-search:focus {
    border-color: #3675ff;
    box-shadow: 0 0 0 3px rgba(54, 117, 255, 0.1);
}

.filter-wrapper {
    flex: 1;
    position: relative;
}

#area-filter {
    width: 100%;
    appearance: none;
    padding: 14px 40px 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    background: white;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

#area-filter:focus {
    border-color: #3675ff;
}

.chevron-down {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #64748b;
    pointer-events: none;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: flex-end;
    /* Toggle alignment as requested (user asked for toggle, assume standard pagination) */
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #e2e8f0;
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    color: #171717;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    border-color: #3675ff;
    color: #3675ff;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8fafc;
}

.pagination-btn svg {
    width: 16px;
    height: 16px;
}

#page-indicator {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

/* Additional Card Text */
.agent-area-tag {
    font-size: 13px;
    color: #bfdbfe;
    /* Light blue */
    margin-top: 4px;
    font-weight: 400;
}

/* Responsive Filters */
@media (max-width: 768px) {
    .agents-filter-bar {
        flex-direction: column;
        gap: 12px;
    }

    .search-wrapper,
    .filter-wrapper {
        width: 100%;
    }

    .pagination-container {
        justify-content: center;
    }
}

/* Join Team Section - Premium Style */
.join-team-section {
    max-width: 1200px;
    margin: 80px auto;
    background: #0f172a;
    /* Dark Navy for Premium Feel */
    border-radius: 40px;
    padding: 80px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
}

.join-content {
    max-width: 500px;
    position: relative;
    z-index: 2;
}

.join-tag {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 24px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.join-content h2 {
    font-size: 48px;
    font-weight: 500;
    /* Matching overall thinner premium weight */
    margin-bottom: 24px;
    line-height: 1.1;
}

.join-content p {
    font-size: 18px;
    color: #94a3b8;
    /* Slate 400 */
    margin-bottom: 40px;
    line-height: 1.6;
}

.join-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: white;
    color: #0f172a;
    padding: 16px 32px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.join-btn:hover {
    gap: 16px;
    /* Expanding hover effect */
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.join-btn svg {
    width: 20px;
    height: 20px;
}

/* Decorative Visuals */
.join-visual {
    position: absolute;
    right: 0;
    top: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, #3675ff, #60a5fa);
    opacity: 0.1;
    filter: blur(40px);
}

.c1 {
    width: 300px;
    height: 300px;
    top: -50px;
    right: -50px;
}

.c2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    right: 150px;
}

@media (max-width: 900px) {
    .join-team-section {
        flex-direction: column;
        text-align: center;
        padding: 60px 24px;
        margin: 60px 20px;
    }

    .join-content {
        max-width: 100%;
    }

    .join-content h2 {
        font-size: 36px;
    }
}

/* Simple White Button */
.btn-white-normal {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px 24px !important;
    background-color: white !important;
    color: #0f172a !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    border-radius: 100px !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

.btn-white-normal:hover {
    background-color: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Identical Section Styles from Properties Page */
.listing-cta-box {
    background: #172554;
    padding: 80px 40px;
    border-radius: 32px;
    color: white;
    text-align: left;
    max-width: 1220px;
    margin: 0 auto;
}

.listing-cta-box h2 {
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 16px;
    color: white;
}

.listing-cta-box p {
    font-size: 18px;
    margin-bottom: 32px;
    opacity: 0.9;
    max-width: 700px;
}

.listing-cta-box .cta-btn {
    background: white;
    color: #172554;
    padding: 14px 32px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: transform 0.2s;
}

.listing-cta-box .cta-btn:hover {
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .listing-cta-box {
        padding: 40px 24px;
        /* Reduced padding */
        text-align: center;
        /* Center align on mobile */
    }

    .listing-cta-box h2 {
        font-size: 28px;
    }

    .listing-cta-box p {
        font-size: 16px;
        margin-bottom: 24px;
    }
}

.listing-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.btn-white-normal:hover {
    background-color: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Contact Dropdown Styles */
.contact-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.contact-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 100;
}

.contact-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.contact-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #1e293b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.contact-dropdown a:hover {
    background: #f8fafc;
}

.contact-dropdown a:first-child {
    border-radius: 8px 8px 0 0;
}

.contact-dropdown a:last-child {
    border-radius: 0 0 8px 8px;
}

.contact-dropdown a svg {
    width: 16px;
    height: 16px;
    color: #3675ff;
    flex-shrink: 0;
}

/* Add chevron to contact buttons */
.mobile-contact-btn svg,
.btn-contact-primary svg {
    margin-left: 4px;
    transition: transform 0.2s;
}

/* Filter Dropdown Styles */
.filter-dropdown-wrapper {
    position: relative;
    display: inline-block;
    z-index: 200 !important;
}

.filter-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 9999 !important;
    padding: 8px 0;
}

.filter-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.filter-option:hover {
    background: #f8fafc;
}

.filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #3675ff;
}

.filter-option span {
    font-size: 14px;
    color: #1e293b;
    font-weight: 500;
}

/* Chevron rotation for dropdowns */
.filter-dropdown-wrapper .z-filter-btn svg {
    transition: transform 0.2s;
}

.filter-dropdown.show+.z-filter-btn svg,
.z-filter-btn.active svg {
    transform: rotate(180deg);
}