/* Agent Profile Page Styles */

.agent-profile-main {
    max-width: 1200px;
    margin: 120px auto 60px;
    padding: 0 40px;
}

/* Profile Hero Section */
.profile-hero-section {
    margin-bottom: 80px;
    position: relative;
    padding-top: 140px;
    /* For absolute positioning of button if needed, or flex */
}

.back-to-agents-btn {
    position: absolute;
    top: -50px;
    /* Position above the card */
    right: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #64748b;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-to-agents-btn:hover {
    color: #3675ff;
    transform: translateX(-4px);
}

.back-to-agents-btn svg {
    width: 18px;
    height: 18px;
}

.profile-hero-card {
    background: #3675ff;
    border-radius: 40px;
    padding: 60px 0 100px;
    /* Extra bottom padding for design balance */
    position: relative;
    text-align: center;
    color: white;
    margin-top: 60px;
    /* Space for the overlapping image */
}

/* Image Wrapper logic for overlapping */
.profile-image-wrapper {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid white;
    /* Optional: adds a nice border like a profile pic */
    position: absolute;
    top: -90px;
    /* Pulls it up halfway */
    left: 80px;
    /* Position from left */
    background: #eef2ff;
}

.profile-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Prime Star Styles (Below Image) */
.prime-star-container {
    margin-top: 12px;
    /* Space below image */
    position: relative;
    display: flex;
    justify-content: center;
    cursor: help;
    z-index: 10;
}

.prime-star-icon {
    color: #3675ff;
    width: 20px;
    /* Slightly larger on profile but still small */
    height: 20px;
    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: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    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);
}

.profile-hero-content {
    margin-top: 20px;
    /* Push text down to clear the image area visually if needed, though centered text might be fine */
}

.profile-hero-content h1 {
    font-size: 48px;
    font-weight: 500;
    margin: 0 0 8px;
}

.agent-handle {
    font-size: 24px;
    opacity: 0.9;
    font-weight: 500;
}

/* Socials positioned below the card or safely inside */
.profile-socials {
    display: flex;
    justify-content: flex-end;
    /* Align to right as per visual */
    gap: 20px;
    margin-top: 20px;
    padding-right: 40px;
}

.social-link {
    width: 24px;
    height: 24px;
    color: #3675ff;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.social-link:hover {
    transform: translateY(-2px);
    opacity: 0.8;
}

/* Layout Grid */
.agent-content-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 60px;
    align-items: start;
}

/* Sidebar "Book a call" */
.book-call-card {
    background: #fff;
    /* Box shadow to match the look */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    border-radius: 24px;
    padding: 32px;
}

.book-call-card h3 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 24px;
    color: #000;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    color: #000;
}

.contact-icon {
    width: 20px;
    height: 20px;
    color: #3675ff;
    flex-shrink: 0;
}

.contact-icon svg {
    width: 100%;
    height: 100%;
}

.contact-item span {
    font-size: 15px;
    font-weight: 500;
}

.hire-now-btn {
    display: block;
    width: 100%;
    background: #3675ff;
    color: white;
    text-align: center;
    padding: 14px 0;
    border-radius: 100px;
    /* Fully rounded pill */
    text-decoration: none;
    font-weight: 500;
    margin-top: 32px;
    transition: background 0.3s ease;
    box-shadow: 0 4px 12px rgba(54, 117, 255, 0.3);
}

.hire-now-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

/* Main Content Text */
.agent-details h2 {
    font-size: 32px;
    font-weight: 500;
    margin-bottom: 20px;
    color: #000;
}

.agent-details p {
    font-size: 16px;
    line-height: 1.7;
    color: #64748b;
    /* Muted text color */
    margin-bottom: 24px;
}

.about-agent-section {
    margin-bottom: 60px;
}

/* Share Button Styles */
.share-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 20;
    color: white;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.share-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Brokerage Logo Styles */
.brokerage-logo-container {
    position: absolute;
    bottom: 20px;
    right: 30px;
    opacity: 0.9;
    z-index: 10;
}

/* Text Logo (KW) */
.brokerage-text-logo {
    text-align: right;
    line-height: 1.1;
    color: white;
}

.brokerage-text-logo .kw-main {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: 2px;
}

.brokerage-text-logo .kw-sub {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 3px;
}

/* Image Logo (eXp) */
.brokerage-img-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* Responsive */
/* Responsive */
@media (max-width: 900px) {

    /* Fix "Scroll to see content" issue: disable intersection observer fade-in on mobile */
    .fade-in-up {
        opacity: 1 !important;
        transform: translateY(0) !important;
        transition: none !important;
    }

    .agent-profile-main {
        padding: 0 20px;
        margin-top: 0px;
        /* Removed margin to let padding handle spacing */
        margin-bottom: 40px;
    }

    .agent-content-grid {
        display: flex;
        flex-direction: column;
        gap: 24px;
        /* Reduced from 40px */
    }

    /* Move details (About) above sidebar (Contact) */
    .agent-details {
        order: 1;
    }

    .agent-sidebar {
        order: 2;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        /* Align card to the left */
        width: 100%;
    }

    /* Hero Section Mobile Redesign (Title -> Image -> Content) */
    .profile-hero-section {
        margin-bottom: 0px !important;
        /* Forced zero */
        margin-top: 0px !important;
        position: relative;
        padding-top: 70px !important;
        /* STRICTLY header height (64px) + small buffer */
        padding-bottom: 0px !important;
        /* No bottom padding */
    }

    /* Back Button: Clean, simple arrow above content */
    .back-to-agents-btn {
        position: static;
        display: inline-flex;
        margin-bottom: 10px;
        /* Reduced from 20px */
        font-size: 14px;
        color: #64748b;
        background: transparent;
        padding: 0;
        border: none;
        box-shadow: none;
        align-items: center;
        gap: 6px;
    }

    .back-to-agents-btn:active {
        background: transparent;
        color: #3675ff;
        transform: translateX(-4px);
    }

    /* Flexbox Container for Reordering */
    .profile-hero-card {
        padding: 32px 20px;
        margin-top: 5px;
        /* Reduced from 20px to 5px */
        border-radius: 24px;
        background: #3675ff;
        /* Blue background restored */
        box-shadow: 0 10px 30px rgba(54, 117, 255, 0.2);
        text-align: center;
        /* Centered like desktop */
        color: white;

        display: flex;
        flex-direction: column;
        align-items: center;
        /* Center items */
    }

    /* 1. Image comes FIRST (like desktop layout logic, but stacked) */
    .profile-image-wrapper {
        order: 1;
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        width: 140px;
        /* Smaller size */
        height: 140px;
        border-radius: 50%;
        /* Circular */
        border: 4px solid white;
        margin-bottom: 20px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        background: #eef2ff;
        display: block;
    }

    .profile-image-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* 2. Title/Content comes SECOND */
    .profile-hero-content {
        order: 2;
        margin-top: 0;
        margin-bottom: 20px;
    }

    .profile-hero-content h1 {
        font-size: 32px;
        margin-bottom: 8px;
        line-height: 1.1;
        font-weight: 600;
        color: white;
        /* White text */
        letter-spacing: -0.01em;
    }

    .agent-handle {
        font-size: 16px;
        color: rgba(255, 255, 255, 0.9);
        /* Lighter text */
        font-weight: 400;
        margin: 0;
    }

    /* Socials come LAST (order 3) */
    .profile-socials {
        order: 3;
        justify-content: center;
        /* Center socials */
        padding-right: 0;
        margin-top: 16px;
        /* Explicit spacing from username */
        width: 100%;
        display: flex;
    }

    .social-link {
        color: #3675ff !important;
        /* Blue color */
        opacity: 1 !important;
        background: #ffffff;
        /* White bubble */
        width: 50px;
        /* Big touch target */
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        padding: 12px;
        /* Adjust padding to scale icon */
        transition: background 0.2s ease;
    }

    .social-link svg {
        stroke: #3675ff !important;
        /* Blue stroke */
        width: 100%;
        height: 100%;
    }

    /* Sidebar Mobile */
    .book-call-card {
        padding: 24px;
        border-radius: 20px;
        text-align: center;
        max-width: 100%;
        /* Full width */
        width: 100%;
        margin: 0;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    }

    .contact-item {
        justify-content: center;
    }

    .share-btn {
        top: 16px;
        right: 16px;
        width: 36px;
        height: 36px;
    }
}

/* Global Mobile Spacing Fix for Agent/Lake Pages */
@media (max-width: 768px) {
    .agent-profile-main {
        padding-top: 80px !important;
        /* Reduced from potential 120px+ */
        padding-bottom: 40px !important;
    }

    .profile-hero-section {
        margin-bottom: 24px !important;
        /* Reduced gap below hero */
        padding: 0 20px !important;
    }

    .experience-section,
    .about-agent-section,
    .service-areas-section {
        margin-top: 24px !important;
        /* Eliminate huge gaps between sections */
        margin-bottom: 24px !important;
        padding: 20px !important;
    }

    .about-agent-section {
        margin-bottom: 24px !important;
    }

    .experience-section h2,
    .about-agent-section h2,
    .service-areas-section h2 {
        margin-bottom: 16px !important;
        font-size: 24px !important;
    }

    /* Hero Card Specifics */
    .profile-hero-card {
        flex-direction: column !important;
        padding: 24px !important;
        gap: 20px !important;
        text-align: center !important;
    }

    .profile-hero-content h1 {
        font-size: 32px !important;
        margin-bottom: 8px !important;
    }

    .profile-hero-content {
        text-align: center !important;
    }

    /* Remove large margins from injected content */
    #featured-agents-container,
    #featured-blogs-container {
        margin-top: 16px !important;
        gap: 16px !important;
    }

    /* Fallback box spacing */
    #no-agents-fallback,
    #no-blogs-fallback {
        padding: 30px 20px !important;
        margin-top: 16px !important;
    }

    /* Mobile Brokerage Logo Adjustments */
    .brokerage-logo-container {
        bottom: 15px;
        right: 15px;
    }

    .brokerage-text-logo .kw-main {
        font-size: 24px;
    }

    .brokerage-text-logo .kw-sub {
        font-size: 10px;
        letter-spacing: 1px;
    }

    .brokerage-img-logo {
        height: 30px;
    }
}