/* Prevent horizontal scrolling globally */
html, body {
    overflow-x: hidden;
    max-width: 100%;
    position: relative;
}

/* Gallery Carousel */
.gallery-carousel {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 0.75rem;
    padding: 0.5rem 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.gallery-carousel::-webkit-scrollbar {
    height: 8px;
}
.gallery-carousel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
.gallery-carousel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}
.gallery-carousel::-webkit-scrollbar-thumb:hover {
    background: #555;
}
.gallery-item {
    flex: 0 0 auto;
    width: 200px;
    height: 200px;
}
.gallery-item img {
    transition: transform 0.3s ease;
    cursor: zoom-in;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}
.gallery-item:hover img {
    transform: scale(1.05);
}
.gallery-overlay-item {
    position: relative;
}
.gallery-overlay-item .overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}
.gallery-overlay-item:hover .overlay {
    background: rgba(0, 0, 0, 0.7);
}

/* Sticky CTA Bar - Mobile */
.sticky-cta-bar-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 30;
    display: block;
    
    /* Safe area for notched devices */
    padding: 0.75rem max(1rem, env(safe-area-inset-right)) 
             calc(0.75rem + env(safe-area-inset-bottom)) 
             max(1rem, env(safe-area-inset-left));
    
    /* Performance optimization - prevents shift when address bar appears/disappears */
    will-change: transform;
    transform: translateZ(0);
}
@media screen and (min-width: 769px) {
    .sticky-cta-bar-mobile {
        display: none;
    }
}

/* Sticky CTA Bar - Desktop */
.sticky-cta-bar-desktop {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    padding: 0.75rem 1rem;
    z-index: 30;
    display: none;
}
.sticky-cta-bar-desktop.is-visible {
    display: block;
}
@media screen and (max-width: 768px) {
    .sticky-cta-bar-desktop {
        display: none !important;
    }
}

/* Expandable Sections */
.expandable-section {
    max-height: 150px;
    overflow: hidden;
    position: relative;
    transition: max-height 0.3s ease;
}
.expandable-section.is-expanded {
    max-height: none;
}
.expandable-section .fade-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, transparent, white);
    pointer-events: none;
}
.expandable-section.is-expanded .fade-overlay {
    display: none;
}

/* About Content Collapsible */
.about-content {
    max-height: 200px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.about-content.is-expanded {
    max-height: none;
}

/* Reviews Collapsible */
.reviews-collapsible {
    display: block;
}
.reviews-collapsible.is-hidden {
    display: none !important;
}

/* Badge hover effects and microcopy */
.badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge-wrapper {
    position: relative;
    display: inline-block;
}

.tag[data-badge] {
    transition: all 0.2s ease;
}

.tag[data-badge]:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.badge-microcopy {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
    margin-top: 0;
}

.badge-microcopy.is-visible {
    max-height: 100px;
    opacity: 1;
    margin-top: 0.5rem;
}

.badge-microcopy p {
    margin: 0;
    padding: 0.5rem 0.75rem;
    background: #f5f5f5;
    border-radius: 4px;
    border-left: 3px solid #dbdbdb;
}

/* Interested trades — left column (desktop sidebar) */
.interested-trades-panel .card-header-title,
.interested-trades-panel__name {
    font-size: 0.875rem;
}
.interested-trades-panel__item {
    display: block;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}
.interested-trades-panel__item .image {
    flex-shrink: 0;
}
.interested-trades-panel__item:hover {
    background-color: #f9f9f9;
}
.interested-trades-panel__item.is-active {
    background-color: #eff5fb;
    border-left: 4px solid #3273dc;
    padding-left: calc(1rem - 4px);
}
.interested-trades-panel__item.is-active .icon.has-text-grey-light {
    color: #3273dc !important;
}
.interested-trades-panel__item:last-child {
    border-bottom: none;
}

/* Shortlisted: feedback panel inside contact box */
.shortlist-feedback-panel {
    border-top: 1px solid #ededed;
}

/* Interest message — badge straddles top border (insufficient-credits pattern, neutral frame) */
.interest-message-card {
    width: 100%;
    margin-top: 0.75rem;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    position: relative;
    background: #fff;
}
.interest-message-card__badge {
    position: absolute;
    top: -0.7rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    white-space: nowrap;
    padding: 0 0.625rem;
    background: #fff;
    line-height: 1;
}
.interest-message-card__header {
    padding: 0.875rem 1.25rem 0.75rem;
    border-bottom: 1px solid #e8e8e8;
}
.interest-message-card__heading {
    font-size: 0.875rem;
    font-weight: 500;
    color: #7a7a7a;
}
.interest-message-card__body {
    padding: 1rem 1.25rem;
}
.interest-message-card__text {
    line-height: 1.5;
    color: #2c3e50;
    white-space: pre-wrap;
}

/* Mobile Candidate Switcher - Floating Chip at Top */
.candidate-switcher-chip {
    display: block;
    margin-bottom: 1.5rem;
    cursor: pointer;
}
@media screen and (min-width: 769px) {
    .candidate-switcher-chip {
        display: none;
    }
}
.chip-content {
    background: white;
    border-radius: 24px;
    padding: 0.75rem 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    border: 1px solid #e8e8e8;
}
.candidate-switcher-chip:hover .chip-content {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), 0 3px 6px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}
.candidate-switcher-chip:active .chip-content {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.chip-content .icon {
    color: #3273dc;
    font-size: 1rem;
}
.chip-text {
    font-weight: 600;
    font-size: 0.9rem;
    color: #363636;
    white-space: nowrap;
}

/* Top Sheet - Mobile Candidate Selector */
.top-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    pointer-events: none;
}
.top-sheet.is-active {
    display: block;
    pointer-events: auto;
}
.top-sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.top-sheet.is-active .top-sheet-overlay {
    opacity: 1;
}
.top-sheet-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: white;
    border-radius: 0 0 16px 16px;
    max-height: 80vh;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    will-change: transform;
}
.top-sheet.is-active .top-sheet-content {
    transform: translateY(0);
}
.top-sheet-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f5f5f5;
    flex-shrink: 0;
}
.top-sheet-body {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Candidate Cards in Top Sheet */
.candidate-card {
    display: block;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}
.candidate-card:hover {
    background-color: #f9f9f9;
}
.candidate-card.is-active {
    background-color: #eff5fb;
    border-left: 4px solid #3273dc;
    padding-left: calc(1.5rem - 4px);
}
.candidate-card.is-active .icon.has-text-grey-light {
    color: #3273dc !important;
}
.candidate-card:last-child {
    border-bottom: none;
}
.candidate-avatar {
    flex-shrink: 0;
}
.avatar-placeholder {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide top sheet on desktop */
@media screen and (min-width: 769px) {
    .top-sheet {
        display: none !important;
    }
}

/* Bottom Sheet - Phone Validation & Shortlist Confirmation */
.bottom-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    pointer-events: none;
}
.bottom-sheet.is-active {
    display: block;
    pointer-events: auto;
}
.bottom-sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.bottom-sheet.is-active .bottom-sheet-overlay {
    opacity: 1;
}
.bottom-sheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: white;
    border-radius: 16px 16px 0 0;
    max-height: 90vh;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    will-change: transform;
}
.bottom-sheet.is-active .bottom-sheet-content {
    transform: translateY(0);
}
.bottom-sheet-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f5f5f5;
    flex-shrink: 0;
}
.bottom-sheet-body {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    padding: 1.5rem;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.bottom-sheet-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #f5f5f5;
    flex-shrink: 0;
    background: white;
}
.bottom-sheet-footer .buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0;
}
.bottom-sheet-footer .buttons .button {
    margin: 0;
}

/* Desktop: Center bottom sheets like modals */
@media screen and (min-width: 769px) {
    .bottom-sheet-content {
        position: fixed;
        bottom: auto;
        top: 50%;
        left: 50%;
        right: auto;
        width: 90%;
        max-width: 600px;
        max-height: 90vh;
        transform: translate(-50%, -50%) scale(0.95);
        border-radius: 8px;
        opacity: 0;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    .bottom-sheet.is-active .bottom-sheet-content {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Desktop spacing */
@media screen and (min-width: 769px) {
    .sticky-cta-bar {
        display: none;
    }
    .main-content-area {
        padding-bottom: 2rem;
    }
}
@media screen and (max-width: 768px) {
    .main-content-area {
        padding-bottom: 80px;
    }
    /* Adjust main content to full width on mobile */
    .main-content-area {
        width: 100%;
        flex: none;
    }
}

/* Profile image placeholders */
.profile-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    border-radius: 50%;
}

/* Ensure figure container has position relative for absolute positioning */
.image.is-48x48,
.image.is-64x64 {
    position: relative;
}

/* Star rating styles */
.stars {
    color: #ffa31a;
    font-size: 1rem;
    letter-spacing: 0.1rem;
}

.stars-lg {
    color: #ffa31a;
    font-size: 1.5rem;
    letter-spacing: 0.1rem;
}

/* Individual star styles */
.stars .star-full,
.stars-lg .star-full {
    color: #ffa31a;
}

.stars .star-empty,
.stars-lg .star-empty {
    color: #ffa31a;
}

/* Half star effect using gradient */
.stars .star-half,
.stars-lg .star-half {
    background: linear-gradient(to right, #ffa31a 50%, #d3d3d3 50%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
