/* Company Details Modal */
.company-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* Changed from center to allow scrolling from top */
    overflow-y: auto;
    /* Enable vertical scrolling on overlay */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 40px 0;
    /* Add padding to top/bottom for spacing */
    overscroll-behavior: contain;
    /* Prevent scroll chaining to body */
}

.company-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.company-modal-content {
    background: #fff;
    width: 90%;
    max-width: 800px;
    /* max-height: 90vh; Removed to allow content to grow */
    /* overflow-y: auto; Removed internal scroll */
    border-radius: 4px;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
    margin: auto;
    /* Centers modal vertically if content is short, handles long content */
}

.company-modal-overlay.active .company-modal-content {
    transform: scale(1);
}

.company-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--color-accent);
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.company-modal-close:hover {
    background: rgba(0, 0, 0, 1);
}

.company-modal-close svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
}

/* Modal Header with Image */
.company-modal-header {
    height: 300px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.company-modal-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.company-modal-header-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 30px;
}

.company-modal-title {
    color: #fff;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.company-modal-location {
    color: #fff;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

/* Modal Body */
.company-modal-body {
    padding: 40px;
    color: #333;
}

.company-modal-description {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    color: #555;
}

.company-modal-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    border-top: 1px solid #eee;
    padding-top: 2rem;
}

.modal-detail-item h4 {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    margin-bottom: 0.5rem;
}

.modal-detail-item p {
    font-size: 1rem;
    color: #333;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .company-modal-header {
        height: 200px;
    }

    .company-modal-title {
        font-size: 1.8rem;
    }

    .company-modal-body {
        padding: 25px;
    }
}