.list-lawyer-container {
    background-image: url("https://ai-chosa-asaka.com/images/main_image_v2.webp");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    width: 960px;
    height: 480px;
    margin: 0 auto;
    position: relative;
}

#lawyersGrid {
    position: absolute;
    top: 168px;
    left: 282px;
    height: 285px;
    width: 680px;
}

/* Lawyers grid */
.lawyers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
    grid-gap: 2px;
}

.lawyer-card {
    height: 56px;
    width: 80px;
    background: #1281b6;
    padding: 1px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.lawyer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.lawyer-child-container {
    display: block;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
}

.lawyer-image {
    width: 49px;
    height: 58px;
    object-fit: cover;
}

.lawyer-card:hover .lawyer-image {
    border-color: #fff;
}

.lawyer-child-container-position,
.lawyer-child-container-name,
.lawyer-child-container-region {
    margin-top: 3px;
}

.lawyer-child-container-position{
    color: black;
    font-size: 9px;
}

.lawyer-child-container-region {
    font-size: 10px;
}

.lawyer-child-container-name {
    color: black;
    font-size: 11px;
    font-weight: 700;
}

/* ======== section_list_lawyer_2 ======== */
.list-lawyer-container-2 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
    grid-gap: 2px;
}

.lawyer-container-2 {
    cursor: pointer;
}

.lawyer-container-2 .lawyer-region {
    text-align: center;
    margin-top: 5px;
    margin-bottom: 10px;
}

.portrait-frame {
    background-color: white;
    border: 2px solid #4a90e2;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 95px;
    height: 95px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.portrait-image {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 3px;
    background-color: #e8e8e8;
}

.name-badge {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 8px;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(74, 144, 226, 0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.title {
    font-size: 6px;
    margin-right: 2px;
}

.name {
    font-size: 7px;
}

.placeholder-image {
    width: 100%;
    height: 60px;
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 6px;
    border-radius: 3px;
    text-align: center;
    line-height: 1.1;
}


/* ======== Popup styles ======== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay.show {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

/* Modal */
.lawyer-modal {
    background-color: #f7f3e7;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.7);
    transition: transform 0.3s ease;
    padding: 40px;
}

.overlay.show .lawyer-modal {
    transform: scale(1);
}

.lawyer-modal .close-btn {
    position: absolute;
    top: 0;
    right: 0;
    padding: 3px 5px;
    background: #f2096c;
    color: #fff;
    border: none;
    cursor: pointer;
}

.lawyer-modal .modal-header {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}

.lawyer-modal .modal-header .avatar-section {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 135px;
    height: 145px;
}

.lawyer-modal .modal-header .avatar-section img {
    width: auto;
    height: auto;
    max-height: 100%;
    max-width: 100%;
}

.lawyer-modal .modal-header .profile-section {
    margin-left: 10px;
    text-align: left;
}

.lawyer-modal .modal-header .profile-section .profile-title,
.lawyer-modal .modal-header .profile-section .name-section {
    margin-bottom: 5px;
}

#modalProfile {
    line-height: 1.4;
    font-size: 12px;
}

#modalPosition,
#modalRegion {
    font-size: 12px;
}

#modalName {
    font-size: 22px;
    font-weight: 700;
}

#modalRecommendation {
    padding-top: 30px;
    font-size: 12px;
}

/* Responsive design */
@media (max-width: 480px) {
    .list-lawyer-container {
        background-image: url("https://ai-chosa-asaka.com/images/main_image_mobile_v2.webp");
        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;
        width: 430px;
        height: 558px;
        margin: 0 auto;
        position: relative;
    }

    .lawyers-grid {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
        grid-gap: 2px;
    }

    #lawyersGrid {
        position: absolute;
        top: 315px;
        left: 27px;
        width: 376px;
        height: 216px;
    }

    .lawyer-image {
        width: 37px;
        height: 44px;
        object-fit: cover;
    }

    .lawyer-child-container-position,
    .lawyer-child-container-name,
    .lawyer-child-container-region {
        margin-top: 2px;
    }

    .lawyer-child-container-position,
    .lawyer-child-container-region {
        color: black;
        font-size: 5px;
    }

    .lawyer-child-container-name {
        color: black;
        font-size: 7px;
        font-weight: 700;
    }


    /* list lawyer section 2 */
    .list-lawyer-container-2 {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 1fr;
        grid-gap: 2px;
    }

    /* modal */
    .lawyer-modal .modal-header {
        flex-direction: unset;
        flex-wrap: unset;
    }

    .lawyer-modal .modal-header .avatar-section {
        align-items: flex-start;
    }
}