/* Collabs Page Specific Styles */
.collabs-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #010101;
    overflow: hidden;
}

.carousel-section {
    flex: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    perspective: 1000px;
    background: linear-gradient(135deg, #010101 0%, #1a1a1a 100%);
}

.carousel-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, #cd7f32 20%, #e6a861 50%, #cd7f32 80%, transparent 100%);
    box-shadow: 0 0 10px rgba(205, 127, 50, 0.5);
    z-index: 10;
}

.scene {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
}

/* New wrapper for cube and outer carousel for global 3D rotations */
.carousel-scene-content {
    position: absolute; /* Relative to .scene */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform: rotateX(0deg) translateZ(0); /* Default normal view */
    transition: transform 0.8s ease-in-out;
}

/* Birdseye View State for the whole scene content */
.scene.birdseye .carousel-scene-content {
    /* Rotate to look down, translate Z to pull back */
    transform: rotateX(-40deg) translateY(-80px) translateZ(400px); /* Adjusted for mobile */
}

/* Central Cube */
.cube-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transform-style: preserve-3d;
    z-index: 10; /* Ensure cube is on top of outer carousel */
}

.cube {
    width: 80px;
    height: 80px;
    position: relative;
    transform-style: preserve-3d;
}

.cube-face {
    position: absolute;
    width: 80px;
    height: 80px;
    background-image: url('https://anticontainmentsystem.com/pfp/tokenimage.png');
    background-size: cover;
    background-position: center;
    border: 2px solid #cd7f32;
    opacity: 0.8;
}

.cube-face.front { transform: rotateY(0deg) translateZ(40px); }
.cube-face.back { transform: rotateY(180deg) translateZ(40px); }
.cube-face.right { transform: rotateY(90deg) translateZ(40px); }
.cube-face.left { transform: rotateY(-90deg) translateZ(40px); }
.cube-face.top { transform: rotateX(90deg) translateZ(40px); }
.cube-face.bottom { transform: rotateX(-90deg) translateZ(40px); }

/* Outer Carousel */
.outer-carousel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotateY(0deg); /* Initial state, will be controlled by JS */
    transform-style: preserve-3d;
    width: 100%; /* Occupy full scene width for positioning */
    height: 100%; /* Occupy full scene height */
    transition: transform 0.6s ease; /* Smooth transition for outer carousel rotation */
}

/* Inner Carousel Cards (Multiple groups) */
.carousel {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    /* translate(-50%, -50%) is handled by JS for centering */
    transform-style: preserve-3d;
    /* transition removed here as transform is fully controlled by JS for inner + outer positioning */
}

/* Positioning for each inner carousel within the outer carousel - handled by JS now */
/* Initial positioning transforms are now primarily controlled via JS in animateInnerCarousels */

/* Individual card positioning within their respective carousels */
.card {
    position: absolute;
    width: 160px;
    height: 208px;
    transform-style: preserve-3d;
    cursor: pointer;
    transition: transform 0.6s ease;
}

.card[data-angle="0"] {
    transform: rotateY(0deg) translateZ(240px);
}

.card[data-angle="60"] {
    transform: rotateY(60deg) translateZ(240px);
}

.card[data-angle="120"] {
    transform: rotateY(120deg) translateZ(240px);
}

.card[data-angle="180"] {
    transform: rotateY(180deg) translateZ(240px);
}

.card[data-angle="240"] {
    transform: rotateY(240deg) translateZ(240px);
}

.card[data-angle="300"] {
    transform: rotateY(300deg) translateZ(240px);
}

.card:hover {
    /* Keep the hover effect relative to its position in the inner carousel */
    transform: rotateY(var(--angle)) translateZ(280px) rotateX(10deg) scale(1.05);
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.card:hover .card-inner {
    transform: rotateY(5deg);
}

.card-content {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.6) 0%, rgba(42, 42, 42, 0.6) 50%, rgba(26, 26, 26, 0.6) 100%);
    border: 2px solid #cd7f32;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.card-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(205, 127, 50, 0.1) 50%,
        transparent 70%
    );
    transform: rotate(-45deg);
    transition: opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.card:hover .card-content::before {
    opacity: 1;
    animation: shimmer 1.5s ease-in-out;
}

/* Add Chat Modal Styles to collabs page too for consistency */
#chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#chat-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.chat-modal-content {
    width: 90vw; /* Changed from 90vh to 90vw to make it wider */
    height: 90vh;
    max-width: 1440px; /* Set a max-width to prevent it from getting too wide on large screens */
    min-width: 320px; /* Prevent it from becoming too small */
    padding: 0; /* Remove padding */
    overflow: visible; /* Allow corner to be visible outside bounds */
    position: relative;
    background: #010101;
    border: 2px solid #cd7f32;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .chat-modal-content {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        border: none;
        padding: 0;
        min-width: 100vw;
    }
}

.chat-modal-content .modal-close-btn {
    z-index: 2;
    top: 1rem; /* Reposition with padding-like values */
    right: 1.5rem;
}

.chat-modal-body {
    flex-grow: 1;
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Ensure wrapper scaling doesn't cause scrollbars on the body */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* New wrapper to handle iframe scaling */
.iframe-wrapper {
    width: 1920px;
    height: 1080px;
    transform-origin: center center; /* Scale from the center */
    /* JS will calculate and apply the scale */
}

.chat-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 6px; /* Match modal content's border-radius */
}

.chat-modal-corner {
    position: absolute;
    bottom: -60px; /* Position relative to the modal corner */
    right: 15px; /* Position relative to the modal corner */
    width: 140px;
    height: 140px;
    background: #1a1a1a;
    border: 2px solid #cd7f32;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.4);
    pointer-events: none;
    transition: transform 0.3s ease;
    z-index: 10001; /* Above modal content */
    transform-origin: bottom right;
}

#chat-modal.is-open .chat-modal-corner {
    animation: floatCircle 4s ease-in-out infinite;
}

.chat-modal-corner img {
    width: 100%; /* Fill the container */
    height: 100%; /* Fill the container */
    object-fit: cover; /* Cover the area */
    border-radius: 50%; /* Ensure it stays circular */
}

@media (max-width: 1200px) {
    .chat-modal-corner {
        right: 5px;
    }
}

@media (max-width: 820px) {
    .chat-modal-content {
        min-width: 0; /* Remove min-width for smaller screens */
    }
    .chat-modal-corner {
        width: 120px;
        height: 120px;
        bottom: -50px;
        right: 15px;
    }
}

@media (max-width: 768px) {
    .chat-modal-corner {
        bottom: -40px;
        right: 15px;
        width: 150px;
        height: 150px;
    }
    .chat-modal-corner img {
        width: 100%;
        height: 100%;
    }
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(-45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(-45deg); }
}

.card-content:hover {
    background: linear-gradient(135deg, rgba(42, 42, 42, 0.7) 0%, rgba(58, 58, 58, 0.7) 50%, rgba(42, 42, 42, 0.7) 100%);
    transform: translateY(-2px);
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 20px rgba(205, 127, 50, 0.3);
}

.card-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #cd7f32;
    margin-bottom: 10px;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card h3 {
    color: #cd7f32;
    font-size: 0.9rem;
    margin-bottom: 6px;
    text-align: center;
    font-weight: bold;
}

.card p {
    color: #f5f5dc;
    font-size: 0.75rem;
    text-align: center;
    margin-bottom: 12px;
    line-height: 1.4;
}

.card-link {
    color: #cd7f32;
    text-decoration: none;
    border: 1px solid #cd7f32;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    z-index: 10;
}

.card:hover .card-link {
    background: #cd7f32;
    color: #010101;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(205, 127, 50, 0.4);
    border-color: #e6a861;
}

.card-link:hover {
    background: #e6a861 !important;
    color: #010101 !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 16px rgba(205, 127, 50, 0.6) !important;
}

/* Carousel Navigation Arrows */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(1, 1, 1, 0.7);
    color: #cd7f32;
    border: 2px solid #cd7f32;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 20; /* Above cube and carousels */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.carousel-arrow:hover {
    background: #cd7f32;
    color: #010101;
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.5);
    transform: translateY(-50%) scale(1.1);
}

.carousel-arrow.left-arrow {
    left: 20px;
}

.carousel-arrow.right-arrow {
    right: 20px;
}

/* Footer Section */
.footer-section {
    background: #010101;
    color: white;
    padding: 1rem;
    position: relative;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.footer-section::-webkit-scrollbar {
    width: 12px;
}

.footer-section::-webkit-scrollbar-track {
    background: #010101;
    border-radius: 6px;
}

.footer-section::-webkit-scrollbar-thumb {
    background: #cd7f32;
    border-radius: 6px;
    border: 2px solid #010101;
}

.footer-section::-webkit-scrollbar-thumb:hover {
    background: #e6a861;
}

/* Firefox scrollbar styling for footer section */
.footer-section {
    scrollbar-width: thin;
    scrollbar-color: #cd7f32 #010101;
}

.collaborators-title {
    text-align: center;
    color: #cd7f32;
    font-size: 2rem;
    margin-bottom: 2rem;
}

/* Back Button */
#back-btn {
    padding: 6px 12px;
    background: #010101;
    color: #cd7f32;
    border: 2px solid #cd7f32;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(205, 127, 50, 0.3);
}

#back-btn:hover {
    background: #cd7f32;
    color: #010101;
    box-shadow: 0 0 20px rgba(205, 127, 50, 0.7);
    transform: translateY(-2px);
}

/* New Top Center Controls Container */
.top-center-controls {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

#birdseye-btn {
    padding: 6px 12px;
    background: #010101;
    color: #cd7f32;
    border: 2px solid #cd7f32;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(205, 127, 50, 0.3);
}

#birdseye-btn:hover {
    background: #cd7f32;
    color: #010101;
    box-shadow: 0 0 20px rgba(205, 127, 50, 0.7);
    transform: translateY(-2px);
}

/* Make sure top right info is visible */
.top-right-info {
    z-index: 1001 !important; /* Ensure it's above other elements */
}

/* Collaborations Modal */
#collabs-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#collabs-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

#collabs-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1); /* Standardized to be more transparent */
}

#collabs-modal .modal-content {
    position: relative;
    background: #010101;
    border: 2px solid #cd7f32;
    border-radius: 8px;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    color: #f5f5dc;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s ease;
    background-image: url('https://dev-nightperson.github.io/anticontainments-system/shortloop.gif');
    background-size: 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

#collabs-modal.is-open .modal-content {
    transform: scale(1) translateY(0);
}

#collabs-modal .modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #cd7f32;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}

#collabs-modal .modal-close-btn:hover {
    color: #f5f5dc;
    transform: rotate(90deg);
}

#collabs-modal .modal-title {
    text-align: center;
    color: #cd7f32;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.join-section {
    text-align: center;
    margin-bottom: 2rem;
}

.join-us-btn {
    display: inline-block;
    background: #cd7f32;
    color: #010101;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(205, 127, 50, 0.3);
}

.join-us-btn:hover {
    background: #e6a861;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(205, 127, 50, 0.5);
}

.active-projects-section,
.other-collabs-section {
    margin-bottom: 1.5rem;
}

.active-projects-section h3,
.other-collabs-section h3 {
    color: #cd7f32;
    border-bottom: 1px solid #444;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.active-projects-section ul,
.other-collabs-section ul {
    list-style: none;
    padding: 0;
}

.active-projects-section li,
.other-collabs-section li {
    margin-bottom: 0.75rem;
}

.active-projects-section a,
.other-collabs-section a {
    color: #f5f5dc;
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
    padding: 8px 12px;
    background: #1a1a1a;
    border-radius: 4px;
    border-left: 3px solid #cd7f32;
}

.active-projects-section a:hover,
.other-collabs-section a:hover {
    color: #cd7f32;
    background: #2a2a2a;
    transform: translateX(5px);
}

/* Modal scrollbar */
#collabs-modal .modal-content::-webkit-scrollbar {
    width: 12px;
}

#collabs-modal .modal-content::-webkit-scrollbar-track {
    background: rgba(16, 16, 16, 0.8);
    border-radius: 6px;
    border: 2px solid rgba(1, 1, 1, 0.9);
}

#collabs-modal .modal-content::-webkit-scrollbar-thumb {
    background: #cd7f32;
    border-radius: 6px;
    border: 2px solid rgba(16, 16, 16, 0.8);
    box-shadow: inset 0 0 6px rgba(205, 127, 50, 0.3);
}

#collabs-modal .modal-content::-webkit-scrollbar-thumb:hover {
    background: #e6a861;
    box-shadow: inset 0 0 6px rgba(230, 168, 97, 0.4);
}

/* Firefox scrollbar styling for modal */
#collabs-modal .modal-content {
    scrollbar-width: thin;
    scrollbar-color: #cd7f32 rgba(16, 16, 16, 0.8);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cube {
        width: 60px;
        height: 60px;
    }
    
    .cube-face {
        width: 60px;
        height: 60px;
    }
    
    .cube-face.front { transform: rotateY(0deg) translateZ(30px); }
    .cube-face.back { transform: rotateY(180deg) translateZ(30px); }
    .cube-face.right { transform: rotateY(90deg) translateZ(30px); }
    .cube-face.left { transform: rotateY(-90deg) translateZ(30px); }
    .cube-face.top { transform: rotateX(90deg) translateZ(30px); }
    .cube-face.bottom { transform: rotateX(-90deg) translateZ(30px); }
    
    .card {
        width: 140px;
        height: 182px;
    }
    
    .card[data-angle="0"] {
        transform: rotateY(0deg) translateZ(180px);
    }
    
    .card[data-angle="60"] {
        transform: rotateY(60deg) translateZ(180px);
    }
    
    .card[data-angle="120"] {
        transform: rotateY(120deg) translateZ(180px);
    }
    
    .card[data-angle="180"] {
        transform: rotateY(180deg) translateZ(180px);
    }
    
    .card[data-angle="240"] {
        transform: rotateY(240deg) translateZ(180px);
    }
    
    .card[data-angle="300"] {
        transform: rotateY(300deg) translateZ(180px);
    }
    
    .card:hover {
        transform: rotateY(var(--angle)) translateZ(200px) rotateX(5deg) scale(1.02);
    }
    
    /* Outer carousel radius adjustment for mobile */
    /* These properties are now primarily controlled by JS for translateZ part */
    .outer-carousel .carousel[data-group-index="0"] {
        transform: translate(-50%, -50%) rotateY(0deg); /* translateZ removed, now controlled by JS */
    }
    
    .outer-carousel .carousel[data-group-index="1"] {
        transform: translate(-50%, -50%) rotateY(120deg); /* translateZ removed, now controlled by JS */
    }
    
    .outer-carousel .carousel[data-group-index="2"] {
        transform: translate(-50%, -50%) rotateY(240deg); /* translateZ removed, now controlled by JS */
    }
    
    .card-content {
        padding: 10px;
    }
    
    .card-image {
        width: 40px;
        height: 40px;
        margin-bottom: 6px;
    }
    
    .card h3 {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }
    
    .card p {
        font-size: 0.65rem;
        margin-bottom: 10px;
    }
    
    .collaborators-title {
        text-align: center;
    }
    
    .footer-columns {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer-section {
        flex: 1;
        min-height: 0;
        padding: 1.5rem;
        text-align: center;
    }

    .footer-content {
        padding-top: 2rem; /* Add buffer */
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    #collabs-modal .modal-content {
        width: 95%;
        padding: 1.5rem;
        max-height: 85vh;
    }

    #collabs-modal .modal-title {
        font-size: 1.3rem;
    }

    .join-us-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .carousel-arrow {
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
    }
    .carousel-arrow.left-arrow { left: 10px; }
    .carousel-arrow.right-arrow { right: 10px; }

    /* Mobile responsiveness for the new button */
    .top-center-controls {
        top: 10px; /* Adjust top position for mobile */
    }
    #birdseye-btn {
        padding: 5px 10px;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .footer-columns {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
    }
    
    .card {
        width: 120px;
        height: 156px;
    }
    
    .card[data-angle="0"] {
        transform: rotateY(0deg) translateZ(130px);
    }
    
    .card[data-angle="60"] {
        transform: rotateY(60deg) translateZ(130px);
    }
    
    .card[data-angle="120"] {
        transform: rotateY(120deg) translateZ(130px);
    }
    
    .card[data-angle="180"] {
        transform: rotateY(180deg) translateZ(130px);
    }
    
    .card[data-angle="240"] {
        transform: rotateY(240deg) translateZ(130px);
    }
    
    .card[data-angle="300"] {
        transform: rotateY(300deg) translateZ(130px);
    }
    
    .footer-section {
        text-align: center;
        padding-top: 2rem;
    }

    .footer-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
}