/* --- MODAL STYLES --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    /* Darker overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.modal-overlay.visible {
    opacity: 1;
}

.modal-content {
    background-color: #fff;
    padding: 40px;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    /* Set a max-width */
    height: auto;
    /* Height will be determined by aspect-ratio */
    max-height: 500px;
    /* Set a max-height */
    aspect-ratio: 1 / 1;
    /* Make it square */
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow-y: auto;
    /* Allow scrolling if content overflows */
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #888;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close-btn:hover {
    color: #000;
}

.modal-body {
    width: 100%;
}

/* --- STYLES FOR CONTENT INSIDE THE MODAL --- */

/* Style for the cloned image/badge */
.modal-image {
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
    border-radius: 50%;
    /* Make portrait badges circular */
    overflow: hidden;
    width: 112px;
    height: 112px;
    flex-shrink: 0;
    /* Prevent the image from shrinking */
}

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

.modal-body h2 {
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 8px;
    color: #121212;
    transition: color 0.3s ease;
}

.modal-body p {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    transition: color 0.3s ease;
}

.modal-body .team-role,
.modal-body .expert-role,
.modal-body .founder-role {
    font-size: 18px;
    color: #333;
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.modal-body .team-org,
.modal-body .expert-org,
.modal-body .founder-org {
    font-size: 16px;
    color: #777;
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

.modal-body .expert-linkedin-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    color: #060507;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-top: 20px;
    margin-bottom: 16px;
}

.modal-body .expert-linkedin-icon:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

/* --- DARK MODE STYLES --- */
body.dark-mode .modal-content {
    background-color: #1E1E1E;
}

body.dark-mode .modal-close-btn {
    color: #bbb;
}

body.dark-mode .modal-close-btn:hover {
    color: #fff;
}

body.dark-mode .modal-body h2 {
    color: #FFFFFF;
}

body.dark-mode .modal-body p {
    color: rgba(255, 255, 255, 0.7);
}

body.dark-mode .modal-body .team-role,
body.dark-mode .modal-body .expert-role,
body.dark-mode .modal-body .founder-role {
    color: rgba(255, 255, 255, 0.87);
}

body.dark-mode .modal-body .team-org,
body.dark-mode .modal-body .expert-org,
body.dark-mode .modal-body .founder-org {
    color: rgba(255, 255, 255, 0.6);
}

body.dark-mode .modal-body .expert-linkedin-icon {
    background: rgba(253, 221, 60, 0.2);
    color: #FFFFFF;
}

body.dark-mode .modal-body .expert-linkedin-icon:hover {
    background: rgba(253, 221, 60, 0.3);
}