/* Modal Styles for Timeline Events */
.event-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.event-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #241a10;
    border: 2px solid #d4af37;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
    transform: translateY(-50px);
    transition: transform 0.4s ease;
    color: #d4af37;
}

.event-modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #ba9b37;
    position: sticky;
    top: 0;
    background-color: #241a10;
    z-index: 2;
}

.modal-title {
    font-family: 'Cinzel', serif;
    margin: 0;
    font-size: 2rem;
    color: #d4af37;
}

.modal-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    margin-top: 0.5rem;
    color: #a08a53;
}

.modal-close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #d4af37;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: #f5d76e;
    transform: scale(1.1);
}

.modal-body {
    padding: 1.5rem;
}

.modal-section {
    margin-bottom: 1.5rem;
}

.modal-section-title {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    color: #d4af37;
}

.modal-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #d4af37;
}

.modal-image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.modal-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border: 1px solid #ba9b37;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-image:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(186, 155, 55, 0.3);
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.modal-tag {
    background-color: rgba(186, 155, 55, 0.2);
    color: #d4af37;
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    font-size: 0.9rem;
    border: 1px solid #ba9b37;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #ba9b37;
    display: flex;
    justify-content: space-between;
    background-color: rgba(36, 26, 16, 0.9);
}

.modal-nav-button {
    background-color: rgba(186, 155, 55, 0.3);
    color: #d4af37;
    border: 1px solid #ba9b37;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-nav-button:hover {
    background-color: rgba(186, 155, 55, 0.5);
}

.modal-sources {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed #ba9b37;
}

.source-list {
    list-style-type: none;
    padding-left: 0;
}

.source-item {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.source-link {
    color: #ba9b37;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.source-link:hover {
    color: #f5d76e;
}

.theoretical-badge {
    display: inline-block;
    background-color: rgba(212, 175, 55, 0.2);
    color: #d4af37;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-left: 1rem;
    border: 1px solid #d4af37;
}

.modal-location-map {
    height: 200px;
    background-color: rgba(186, 155, 55, 0.1);
    border: 1px solid #ba9b37;
    border-radius: 4px;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-style: italic;
}

.did-you-know {
    background-color: rgba(186, 155, 55, 0.1);
    border-left: 3px solid #d4af37;
    padding: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
}

/* Generic Modal Styles (used by artifacts and other pages) */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0);
    transition: background-color 0.3s ease;
}

.modal.show {
    background-color: rgba(0, 0, 0, 0.8);
}

.modal .modal-content {
    margin: 50px auto;
    padding: 0;
    width: 90%;
    max-width: 1000px;
    opacity: 0;
    transform: translateY(-50px);
    transition: all 0.3s ease;
}

.modal.show .modal-content {
    opacity: 1;
    transform: translateY(0);
}

.modal .close {
    color: #d4af37;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal .close:hover,
.modal .close:focus {
    color: #f5d76e;
}

/* Tablet & Mobile adjustments */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
    }
    
    .modal-title {
        font-size: 1.5rem;
        padding-right: 30px; /* Make room for close button */
    }
    
    .modal-image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .modal-image {
        height: 120px;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.8rem;
    }
}
