/* Experiments Page Styles */

/* Main content offset for sidebar */
.main-content {
    min-height: 100vh;
    padding-top: 64px;
    padding-left: 280px;
    padding-right: 280px;
    max-width: calc(1200px + 280px + 280px);
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 104px;
    color: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Mobile responsiveness for main content */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
        padding-top: 64px;
        max-width: none;
    }
}

/* Medium Article Styles */
.medium-article {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    background: transparent;
    box-sizing: border-box;
}

/* Gallery Container */
.gallery-container {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    min-height: 400px;
}

/* Gallery Grid */
.gallery-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    justify-content: flex-start;
    align-items: center;
}

/* Gallery Item */
.gallery-item {
    width: 100%;
    max-width: 720px;
    height: auto;
    aspect-ratio: 720 / 488;
    border-radius: 32px;
    overflow: hidden;
    background: #F2F2F2 !important;
    border: 1px solid #E9EBF0;
    transition: transform 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.gallery-item:hover {
    transform: translateY(-4px);
}

.gallery-item.animate {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
    border-radius: 32px;
    cursor: pointer;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Mobile Version */
@media (max-width: 767px) {
    .gallery-grid {
        gap: 16px;
        justify-content: center;
    }
}

/* Image Modal Styles */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    padding: 40px 24px;
    overflow: auto;
}

.image-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal.show.zoomed {
    align-items: flex-start;
    justify-content: flex-start;
}

.image-modal-content {
    max-width: min(90vw, 960px);
    max-height: 90vh;
    object-fit: contain;
    border-radius: 16px;
    cursor: zoom-in;
    display: block;
    margin: auto;
    transition: transform 0.3s ease;
}

.image-modal.zoomed .image-modal-content,
.image-modal.show.zoomed .image-modal-content {
    max-width: none;
    max-height: none;
    cursor: zoom-out;
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.image-modal-close:hover {
    opacity: 0.7;
}

/* Popup Modal Styles */
.popup-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

.popup-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.popup-modal-content {
    position: relative;
    width: 100%;
    max-width: 1440px;
    height: calc(100vh - 32px);
    max-height: calc(100vh - 32px);
    background: #FFFFFF;
    border-radius: 24px;
    overflow: visible;
    z-index: 2001;
    display: flex;
    flex-direction: column;
    margin: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.popup-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 24px;
    background: #FFFFFF;
    z-index: -1;
    pointer-events: none;
}

.popup-modal-body {
    overflow-y: auto;
    overflow-x: visible;
    flex: 1;
    padding: 0;
    height: 100%;
    position: relative;
}

.popup-modal-body main {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.popup-modal-body .main-content {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: visible;
    min-height: 100vh;
}

/* Hide back button in popup or make it close popup */
.popup-modal-body .back-button {
    display: none;
}

/* Ensure SignUp content fits in popup */
.popup-modal-body .content-wrapper {
    max-width: 100%;
    margin: 0;
    padding: 20px;
    position: relative;
    overflow: visible;
    min-height: 100%;
    width: 100%;
}

/* Override SignUp.css styles for popup */
.popup-modal-body .main-content {
    min-width: auto !important;
    width: 100% !important;
    overflow: visible !important;
    overflow-x: visible !important;
}

@media (min-width: 1024px) {
    .popup-modal-body .main-content {
        min-width: auto !important;
        width: 100% !important;
        overflow: visible !important;
        overflow-x: visible !important;
    }
    
    .popup-modal-body .content-wrapper {
        max-width: 100%;
        overflow: visible;
        width: 100%;
    }
}

.popup-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    z-index: 2002;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

.popup-modal-close svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.popup-modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.popup-loading,
.popup-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    color: #1A1A1A;
}

.popup-error {
    color: #dc2626;
}

/* Mobile responsiveness for popup */
@media (max-width: 767px) {
    .popup-modal-content {
        max-width: 100%;
        height: calc(100vh - 32px);
        max-height: calc(100vh - 32px);
        margin: 16px;
        border-radius: 24px;
    }

    .popup-modal-body {
        height: 100%;
    }

    .popup-modal-close {
        top: 16px;
        right: 16px;
        width: 36px;
        height: 36px;
        font-size: 24px;
    }
}
