/* === Overlays: Modals, Lightbox, Tooltips === */

/* Tooltips */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 300px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    top: 125%;
    left: 50%;
    margin-left: -150px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #555 transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Consent modal */
#consentModal>div {
    margin: 10px;
}

/* Modal backdrop */
.fixed.inset-0.flex.items-center.justify-center.bg-black.bg-opacity-70 {
    z-index: 50;
}

.fixed.inset-0.flex.items-center.justify-center.bg-black.bg-opacity-70 .bg-gray-800 {
    max-height: 80%;
    overflow-y: auto;
}

.bg-gray-800 pre {
    background-color: #1a202c;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
}

/* Lightbox */
.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 0 32px rgba(0, 0, 0, 0.5);
    display: block;
    margin: 0 auto;
    transition: opacity 0.3s ease-in-out;
    cursor: zoom-in;
}

.lightbox-image:hover {
    opacity: 0.9;
}

.lightbox-caption {
    max-width: 80%;
    margin: 0 auto;
    font-size: 1.2rem;
    padding: 10px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    margin-top: 20px;
    text-align: center;
    color: white;
}

#image-lightbox {
    z-index: 1000;
    padding: 20px;
}

#image-lightbox button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    transition: opacity 0.3s ease-in-out;
}

#image-lightbox button:hover {
    opacity: 0.7;
}

/* HTML preview modal */
.html-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.html-preview-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    z-index: 1001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.html-preview-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.html-preview-container {
    width: 90%;
    height: 80%;
    display: flex;
    flex-direction: column;
}

.html-preview-label {
    color: white;
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.html-preview-label::before {
    content: '▶';
    margin-right: 8px;
    color: #4CAF50;
}

.html-preview-iframe {
    width: 100%;
    height: 100%;
    border: 1px solid #4a5568;
    border-radius: 5px;
    background-color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.play-button {
    position: absolute;
    bottom: 10px;
    right: 155px;
    min-width: 120px;
    background-color: #38a169;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.2s;
}

.play-button:hover {
    background-color: #2f855a;
}

.play-button i {
    color: white;
}

/* Lightbox responsive */
@media (max-width: 768px) {
    .lightbox-image {
        max-width: 95%;
        max-height: 85vh;
    }

    .lightbox-caption {
        font-size: 1rem;
        text-align: center;
    }
}
