/* Expandable Widget Styles */

.slide-widget {
    position: fixed;
    z-index: 100;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slide-widget.top-right {
    top: 50px;
    right: 50px;
}

.slide-widget.top-left {
    top: 20px;
    left: 20px;
}

.slide-widget.bottom-right {
    bottom: 20px;
    right: 20px;
}

.slide-widget.bottom-left {
    bottom: 20px;
    left: 20px;
}

.widget-button {
    background: rgba(168, 89, 74, 0.9);
    border: 2px solid rgba(232, 196, 189, 0.8);
    border-radius: 8px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.widget-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.widget-button::before {
    content: "+";
    display: block;
    transition: transform 0.3s ease;
}

.slide-widget.expanded .widget-button::before {
    transform: rotate(45deg);
}

.widget-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 90vw;
    max-width: 1200px;
    height: 85vh;
    max-height: 900px;
    background: white;
    border: 3px solid rgba(168, 89, 74, 0.9);
    border-radius: 12px;
    box-shadow: none;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.slide-widget.expanded .widget-panel {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: all;
}

.widget-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 999;
    pointer-events: none;
    transition: background 0.4s ease;
}

.slide-widget.expanded .widget-overlay {
    background: rgba(0, 0, 0, 0.7);
    pointer-events: all;
}

.widget-slideshow {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10px 40px 40px 40px;
}

.widget-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    padding: 10px 40px 40px 40px;
}

.widget-slide.active {
    opacity: 1;
    pointer-events: all;
}

.widget-slide img,
.widget-slide video {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0;
    box-shadow: none;
}

.widget-slide-content {
    margin-top: 20px;
    color: #333;
    text-align: center;
    max-width: 80%;
}

.widget-slide-content h3 {
    margin: 0 0 10px 0;
    font-size: 1.3em;
    color: #333;
}

.widget-slide-content p {
    margin: 0;
    font-size: 1em;
    line-height: 1.5;
    color: #333;
}

.widget-nav {
    padding: 20px;
    display: none;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid rgba(168, 89, 74, 0.5);
}

.widget-nav-btn {
    background: rgba(168, 89, 74, 0.8);
    border: 2px solid rgba(232, 196, 189, 0.6);
    border-radius: 8px;
    color: white;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.widget-nav-btn:hover:not(:disabled) {
    background: rgba(168, 89, 74, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.widget-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.widget-indicators {
    display: flex;
    gap: 8px;
}

.widget-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(232, 196, 189, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.widget-indicator.active {
    background: rgba(232, 196, 189, 1);
    transform: scale(1.3);
}

.widget-indicator:hover {
    background: rgba(232, 196, 189, 0.6);
}

/* No fade transition for specific widgets */
#natlat-conditioning .widget-slide {
    transition: none;
}

/* Center images for specific widgets */
#latent-variable-model .widget-slide {
    justify-content: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .widget-panel {
        width: 90vw;
        height: 80vh;
    }

    .widget-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .widget-panel-title {
        font-size: 1.2em;
    }
}
