/**
 * Member directory modals: company detail + member detail.
 * Shared by the directory page and the homepage members carousel
 * (both use assets/js/directory.js).
 */

/* =========================================
   Company Detail Modal
   ========================================= */
.company-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
}

.company-modal.active {
    display: block;
}

.company-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.company-modal .modal-content {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.company-modal .modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    color: var(--color-gray-600, #666);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease, color 0.2s ease;
}

.company-modal .modal-close:hover {
    background: #fff;
    color: var(--color-gray-900, #111);
}

.company-modal-body {
    max-height: 90vh;
    overflow-y: auto;
}

.company-modal-header {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.company-modal-logo {
    max-width: 60%;
    max-height: 60%;
    object-fit: contain;
}

.company-modal-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
}

.company-modal-icon svg {
    width: 48px;
    height: 48px;
    color: rgba(255, 255, 255, 0.7);
}

.company-modal-info {
    padding: 1.5rem 2rem 2rem;
}

.company-modal-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.company-modal-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-gray-900, #111);
    margin: 0;
}

.company-modal-verified {
    width: 28px;
    height: 28px;
    background: var(--color-gray-100, #f3f8f7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.company-modal-verified svg {
    width: 18px;
    height: 18px;
    color: var(--color-primary, #03372e);
}

.company-modal-industry {
    font-size: 0.75rem;
    color: var(--color-gray-600, #666);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px 0;
}

.company-modal-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.modal-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.modal-badge.mentor {
    background: #fef3c7;
    color: #92400e;
}

.modal-badge.work {
    background: #dcfce7;
    color: #166534;
}

.company-modal-description {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--color-gray-700, #333);
    margin: 0 0 16px 0;
}

.company-modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    text-transform: uppercase;
}

.company-modal-tag {
    padding: 6px 12px;
    background: var(--color-secondary-light);
    color: var(--color-secondary-dark);
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 500;
}

.company-modal-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.company-modal-section h4 {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--color-gray-500, #999);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px 0;
}

.company-modal-contact {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.company-modal-contact .contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-gray-700, #333);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s ease;
}

.company-modal-contact .contact-item:hover {
    color: var(--color-primary, #03372e);
}

.company-modal-contact .contact-item svg {
    width: 18px;
    height: 18px;
    color: var(--color-gray-400, #aaa);
    flex-shrink: 0;
}

.company-modal-address {
    display: flex;
    gap: 10px;
    color: var(--color-gray-700, #333);
    font-size: 0.9375rem;
}

.company-modal-address svg {
    width: 18px;
    height: 18px;
    color: var(--color-gray-400, #aaa);
    flex-shrink: 0;
    margin-top: 2px;
}

.company-modal-address address {
    font-style: normal;
    line-height: 1.5;
}

.company-modal-team {
    grid-column: 1 / -1;
}

.company-modal-team-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px 20px;
    font-size: 0.9375rem;
    color: var(--color-gray-700, #333);
}

.company-modal-team-list li {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.company-modal-team-position {
    font-size: 0.8125rem;
    color: var(--color-gray-500, #999);
}

/* Team names open that member's profile. */
.company-modal-team-link {
    align-self: flex-start;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 600;
    color: var(--color-secondary, #6F5EAE);
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(111, 94, 174, 0.35);
    cursor: pointer;
}

.company-modal-team-link:hover,
.company-modal-team-link:focus-visible {
    text-decoration-color: currentColor;
}

.company-modal-team-link.is-loading {
    opacity: 0.6;
    cursor: progress;
}

.company-modal-socials {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.company-modal-socials .social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-gray-100, #f5f5f5);
    color: var(--color-gray-600, #666);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.company-modal-socials .social-link:hover {
    transform: translateY(-2px);
}

.company-modal-socials .social-link svg {
    width: 20px;
    height: 20px;
}

.company-modal-socials .social-link.facebook:hover {
    background: #1877f2;
    color: #fff;
}

.company-modal-socials .social-link.instagram:hover {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: #fff;
}

.company-modal-socials .social-link.linkedin:hover {
    background: #0a66c2;
    color: #fff;
}

.company-modal-socials .social-link.twitter:hover {
    background: #000;
    color: #fff;
}

.company-modal-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.company-modal-cta:hover {
    background: var(--color-accent);
    color: #fff !important;
    transform: translateY(-1px);
}

.company-modal-cta svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 768px) {
    /* Company Modal Responsive */
    .company-modal .modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .company-modal-header {
        height: 140px;
    }
    
    .company-modal-info {
        padding: 1.25rem 1.5rem 1.5rem;
    }
    
    .company-modal-name {
        font-size: 1.25rem;
    }

    .company-modal-sections {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Member Detail Modal (full bio + all tags)
   ========================================================================== */
.member-modal .modal-content {
    max-width: 560px;
}

.member-modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.75rem 2rem 1rem;
}

.member-modal-avatar,
.member-modal-initials {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.member-modal-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-secondary-light);
    color: var(--color-secondary-dark);
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
}

.member-modal-heading {
    min-width: 0;
}

.member-modal-name {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--color-gray-900, #111);
    margin: 0 0 4px 0;
}

.member-modal-pronouns {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--color-gray-600, #666);
}

.member-modal-details {
    font-size: 0.875rem;
    color: var(--color-gray-600, #666);
    margin: 0;
}

.member-modal-bio {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--color-gray-700, #333);
    margin: 0 0 1rem 0;
    white-space: pre-line;
}

.member-modal-company {
    font-size: 0.875rem;
    color: var(--color-gray-600, #666);
    margin: 0 0 1rem 0;
}

/* Company name link inside the member modal (opens the company modal) */
.member-modal-company-link {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: var(--color-primary, #03372e);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.member-modal-company-link:hover {
    text-decoration: none;
}

@media (max-width: 640px) {
    .member-modal-header {
        padding: 1.25rem 1.5rem 0.75rem;
    }

    .member-modal-avatar,
    .member-modal-initials {
        width: 60px;
        height: 60px;
    }

    .member-modal-name {
        font-size: 1.2rem;
    }
}

