:root {
    --secondary-color: #ff00ff;
    --bg-dark: #0a0a0a;
    --bg-darker: #0a0a0a0a;
}

.gallery-3d-container {
    perspective: 800px;
    perspective-origin: center center;
}

.gallery-grid {
    position: relative;
    margin: 0 auto;
    width: 100%;
    min-height: 200px;
    transform-style: preserve-3d;
}

.gallery-item {
    width: 260px;
    break-inside: avoid;
    position: relative;
    margin-bottom: 20px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--main-color);
    background: #000;

    transition: all 0.3s ease;

    transform: translateZ(0);
    transform-origin: center center;
    will-change: transform, box-shadow;
    backface-visibility: hidden;
}

.gallery-item-3d:hover:not(.dragging) {
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.5);
    border-color: var(--main-color);
    z-index: 1;
}

.gallery-item-3d img,
.gallery-item-3d video {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-grid.hovering .gallery-item {
    transition: all 0.3s ease;
}

.gallery-grid.hovering .gallery-item:not(.active) {
    opacity: 0.3;
    filter: grayscale(100%);
}

.gallery-grid.hovering .gallery-item.active {
    opacity: 1;
    filter: none;
}

.gallery-grid.hovering .gallery-item-3d.active {
    opacity: 1 !important;
    filter: none !important;
    transform: translateY(-8px) translateZ(15px) rotateX(2deg) scale(1.02);
    box-shadow:
            0 0 30px rgba(0, 255, 0, 0.5),
            0 12px 25px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-color);
    z-index: 10;
}

.gallery-grid.hovering .gallery-item-3d.active.hovered {
    transform: translateY(-12px) translateZ(20px) rotateX(3deg) scale(1.03);
    box-shadow:
            0 0 40px rgba(0, 255, 0, 0.6),
            0 0 20px rgba(0, 255, 255, 0.3),
            0 15px 30px rgba(0, 0, 0, 0.4);
    border-color: var(--secondary-color);
    z-index: 20;
    animation: hologram 1.5s ease-in-out infinite alternate;
}

.gallery-grid.hovering .gallery-item-3d:not(.active) {
    opacity: 0.35 !important;
    filter: grayscale(80%) blur(0.5px) !important;
    transform: translateY(3px) translateZ(-10px) scale(0.97);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    border-color: rgba(0, 255, 0, 0.2);
}

.gallery-grid:not(.hovering) .gallery-item-3d {
    transition:
            opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
            filter 1s cubic-bezier(0.25, 0.46, 0.45, 0.94),
            transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
            box-shadow 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
            border-color 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 1;
    filter: none;
    border-color: var(--main-color);
}

/* Info overlay effects - simple like original */
.info-overlay-3d,
.collection-info-overlay,
.media-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 15px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 10;
}

.gallery-item:hover .info-overlay-3d,
.gallery-item:hover .collection-info-overlay,
.gallery-item:hover .media-overlay {
    opacity: 1;
    transform: translateY(0);
}

/* Badge effects - simple */
.badge-3d,
.collection-indicator,
.featured-badge {
    transition: all 0.3s ease;
}

.gallery-item:hover .badge-3d,
.gallery-item:hover .collection-indicator,
.gallery-item:hover .featured-badge {
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.4);
}

/* Collection-specific hover effects - simple */
.gallery-collection::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--main-color) 50%, transparent 100%);
    z-index: 2;
    opacity: 0;
    transition: all 0.3s ease;
}

.gallery-collection:hover::before {
    opacity: 0.8;
    height: 4px;
}

/* Title effects - simple */
.title-3d,
.collection-name {
    transition: all 0.3s ease;
}

.gallery-item:hover .title-3d,
.gallery-item:hover .collection-name {
    text-shadow: 0 0 15px var(--main-color);
}

/* Category tag effects - simple */
.category-tag-3d,
.media-category,
.collection-category {
    transition: all 0.3s ease;
}

.gallery-item:hover .category-tag-3d,
.gallery-item:hover .media-category,
.gallery-item:hover .collection-category {
    box-shadow: 0 2px 8px rgba(0, 255, 0, 0.3);
}

/* Holographic line effect - simple */
.hologram-line {
    transition: all 0.3s ease;
}

.gallery-item:hover .hologram-line {
    height: 4px;
    box-shadow: 0 0 20px var(--main-color);
}

/* Category items hover - simple like your original */
.categories-list.hovering .category-item {
    transition: all 0.3s ease;
}

.categories-list.hovering .category-item:not(.active) {
    opacity: 0.3;
}

.categories-list.hovering .category-item.active {
    opacity: 1;
}

.category-item {
    transition: all 0.3s ease;
}

.category-item a {
    transition: all 0.3s ease;
}

.category-item:hover a {
    background: var(--main-color);
    color: #000;
    box-shadow: 0 0 15px var(--main-color);
}

/* Lightbox media container */
#lightbox-media-container img,
#lightbox-media-container video {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}

/* Edit mode overrides - disable 3D effects during editing */
.gallery-grid.edit-mode {
    perspective: none;
    display: flex !important;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
    align-content: flex-start;
    align-items: flex-start;
    padding: 20px;
    transform-style: flat;
}

.gallery-grid.edit-mode .gallery-item {
    position: relative !important;
    width: 260px;
    flex: 0 0 260px;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    margin-bottom: 0;
    height: auto !important;
    display: flex;
    flex-direction: column;
    pointer-events: none;
    cursor: move;
    border: 2px solid transparent;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    transform-style: flat;
}

.gallery-grid.edit-mode .gallery-item img,
.gallery-grid.edit-mode .gallery-item video {
    width: 100%;
    height: auto !important;
    max-height: none !important;
    object-fit: cover;
    display: block;
    transform: none !important;
}

.gallery-grid.edit-mode .gallery-item:hover {
    border-color: var(--main-color);
    box-shadow: 0 0 15px var(--main-color) !important;
    transform: none !important;
}

.gallery-grid.edit-mode .gallery-item:hover .media-overlay,
.gallery-grid.edit-mode .gallery-item:hover .collection-info-overlay {
    opacity: 0 !important;
}

/* Drag handle styles */
.drag-handle {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    width: 40px !important;
    height: 40px !important;
    background: var(--main-color) !important;
    border: 3px solid #000 !important;
    color: #000 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: grab !important;
    font-size: 18px !important;
    z-index: 9999 !important;
    font-family: 'VT323', monospace !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 15px rgba(0, 255, 0, 0.6) !important;
    font-weight: bold !important;
    pointer-events: none !important;
}

.gallery-grid.edit-mode .gallery-item .drag-handle {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: all !important;
    visibility: visible !important;
    animation: pulse 1s infinite !important;
}

.gallery-grid.edit-mode .gallery-item:hover .drag-handle {
    background: var(--accent-color) !important;
    color: #000 !important;
    transform: scale(1.2) !important;
    box-shadow: 0 6px 20px rgba(0, 255, 255, 0.8) !important;
}

/* Sortable states */
.sortable-ghost {
    opacity: 0.4 !important;
    background: linear-gradient(45deg, var(--main-color), var(--accent-color)) !important;
    border: 3px dashed var(--main-color) !important;
    transform: scale(0.98) !important;
    border-radius: 8px !important;
}

.sortable-chosen {
    box-shadow: 0 0 25px var(--main-color), 0 0 50px var(--accent-color) !important;
    z-index: 1000 !important;
    transform: scale(1.03) !important;
    border: 3px solid var(--main-color) !important;
    border-radius: 8px !important;
}

.sortable-drag {
    opacity: 0.9 !important;
    transform: rotate(2deg) scale(1.05) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6) !important;
    z-index: 1001 !important;
    border-radius: 8px !important;
}

/* Button styles for lightbox actions */
.btn {
    @apply w-full px-6 py-3 border border-main text-main hover:bg-main hover:text-black transition-all duration-300 text-center cursor-pointer font-cyber uppercase tracking-wide;
    background: rgba(0, 255, 0, 0.1);
}

.btn-danger {
    @apply border-cyber-red text-cyber-red hover:bg-cyber-red hover:text-white;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    z-index: 10000;
    font-family: 'VT323', monospace;
    font-size: 16px;
    animation: slideIn 0.3s ease-out;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.notification-success {
    background: var(--main-color);
    color: #000;
    border: 2px solid var(--main-color);
}

.notification-error {
    @apply bg-cyber-red text-white border-2 border-cyber-red;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Hologram animation */
@keyframes hologram {
    0% {
        box-shadow: 0 0 20px var(--main-color), inset 0 0 20px rgba(0, 255, 0, 0.1);
        border-color: var(--main-color);
    }
    100% {
        box-shadow: 0 0 40px var(--accent-color), inset 0 0 40px rgba(0, 255, 255, 0.2);
        border-color: var(--accent-color);
    }
}

/* Active category styling */
.category-item.active a {
    background: var(--main-color) !important;
    color: #000 !important;
    box-shadow: 0 0 15px var(--main-color);
}

/* Edit mode indicator */
.edit-mode-indicator {
    position: fixed;
    bottom: 100px;
    left: 30px;
    background: rgba(0, 0, 0, 0.9);
    color: var(--accent-color);
    padding: 12px 20px;
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    font-family: 'VT323', monospace;
    font-size: 16px;
    z-index: 90;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: pulse 2s infinite;
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.3);
    max-width: 300px;
}

/* Grid edit mode save/cancel buttons */
.grid-save-btn,
.grid-cancel-btn {
    position: fixed;
    bottom: 30px;
    z-index: 100;
    padding: 12px 24px;
    font-family: 'VT323', monospace;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    font-weight: bold;
}

.grid-save-btn {
    right: 200px;
    background: var(--main-color);
    color: #000;
    box-shadow: 0 4px 15px rgba(0, 255, 0, 0.3);
}

.grid-save-btn:hover {
    background: var(--accent-color);
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(0, 255, 0, 0.5);
}

.grid-cancel-btn {
    right: 360px;
    background: var(--main-color, #ff0000);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
}

.grid-cancel-btn:hover {
    background: #cc0000;
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(255, 0, 0, 0.5);
}

/* Collection dropdown styles */
.cyber-dropdown-option {
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 255, 0, 0.1);
    color: var(--main-color);
    font-family: 'VT323', monospace;
}

.cyber-dropdown-option:hover {
    background: rgba(0, 255, 0, 0.2);
    text-shadow: 0 0 5px var(--main-color);
}

.cyber-dropdown-option:last-child {
    border-bottom: none;
}

.cyber-dropdown-category {
    display: inline-block;
    margin-left: 10px;
    font-size: 12px;
    color: var(--accent-color);
    opacity: 0.8;
}

.cyber-dropdown-error,
.cyber-dropdown-empty {
    padding: 16px;
    text-align: center;
    color: var(--main-color, #ff0000);
    font-family: 'VT323', monospace;
}

.cyber-dropdown-loading {
    padding: 16px;
    text-align: center;
    color: var(--main-color);
    font-family: 'VT323', monospace;
}

/* Pulse animation */
@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* Responsive adjustments - smooth scaling */
@media (max-width: 1200px) {
    .gallery-item {
        width: calc(25% - 15px);
        max-width: 260px;
        min-width: 220px;
    }

    .gallery-3d-container {
        perspective: 700px;
    }
}

@media (max-width: 768px) {
    .gallery-item {
        width: calc(33.333% - 14px);
        max-width: 260px;
        min-width: 200px;
    }

    .gallery-3d-container {
        perspective: 600px;
    }

    /* Simple effects on mobile for smooth performance */
    .gallery-item:hover:not(.dragging) {
        box-shadow: 0 0 25px rgba(0, 255, 0, 0.4);
        border-color: var(--main-color);
        z-index: 1;
    }

    .gallery-grid.hovering .gallery-item.active {
        transform: translateY(-5px) translateZ(12px) rotateX(1deg) scale(1.02);
    }
}

@media (max-width: 640px) {
    .gallery-item {
        width: calc(50% - 10px);
        max-width: 260px;
        min-width: 180px;
    }

    .gallery-3d-container {
        perspective: 500px;
    }
}

@media (max-width: 480px) {
    .gallery-item {
        width: calc(100% - 20px);
        max-width: 320px;
        min-width: 260px;
    }

    .gallery-3d-container {
        perspective: 400px;
    }

    /* Minimal effects on very small screens */
    .gallery-item:hover:not(.dragging) {
        box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
        border-color: var(--main-color);
        z-index: 1;
    }

    .gallery-grid.hovering .gallery-item.active {
        transform: translateY(-3px) scale(1.01);
    }
}

/* Performance optimization - reduce animations on slower devices */
@media (prefers-reduced-motion: reduce) {
    .gallery-item,
    .info-overlay-3d,
    .collection-info-overlay,
    .media-overlay,
    .category-item,
    .category-item a {
        transition: none;
        animation: none;
    }

    .gallery-grid.hovering .gallery-item.active {
        transform: none;
    }
}

#media-lightbox .flex.items-center.justify-center.min-h-screen > div {
    max-height: 90vh;
    height: 90vh;
    display: flex;
    flex-direction: column;
}

/* Make the main content area flex properly */
#media-lightbox .flex.flex-col.lg\\:flex-row.h-full {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Keep media side stable */
#media-lightbox .flex-1.bg-cyber-darker {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Fix the info panel to be scrollable */
#media-lightbox .w-full.lg\\:w-96 {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 100%;
    display: flex;
    flex-direction: column;
}

/* Make edit mode properly scrollable */
#lightbox-edit-mode {
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

#lightbox-edit-mode h2 {
    flex-shrink: 0;
}

#lightbox-edit-mode form {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
    min-height: 0;
}

/* Style the scrollbar */
#lightbox-edit-mode form::-webkit-scrollbar {
    width: 8px;
}

#lightbox-edit-mode form::-webkit-scrollbar-track {
    background: rgba(0, 255, 0, 0.1);
    border-radius: 4px;
}

#lightbox-edit-mode form::-webkit-scrollbar-thumb {
    background: var(--main-color);
    border-radius: 4px;
}

#lightbox-edit-mode form::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Firefox scrollbar */
#lightbox-edit-mode form {
    scrollbar-width: thin;
    scrollbar-color: var(--main-color) rgba(0, 255, 0, 0.1);
}

/* Ensure buttons stay visible */
#edit-media-form .flex.flex-col.gap-3.pt-4 {
    flex-shrink: 0;
    margin-top: auto;
    background: var(--bg-dark);
    padding-bottom: 10px;
}

/* Limit collaborators section height if needed */
#edit-selected-collaborators {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Fix for view mode as well to be consistent */
#lightbox-view-mode {
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Mobile responsive fixes */
@media (max-width: 768px) {
    #media-lightbox .flex.flex-col.lg\\:flex-row.h-full {
        max-height: 90vh;
    }

    #media-lightbox .w-full.lg\\:w-96 {
        height: 50vh;
        max-height: 50vh;
    }
}

