/* Font Import */
@font-face {
  font-family: "Neuebit";
  src:
    local("Neuebit"),
    url("https://memar.neocities.org/fonts/NeueBit-Regular.otf") format("opentype"),
    url("https://memar.neocities.org/fonts/NeueBit-Regular.ttff") format("truetype"),
    url("https://memar.neocities.org/fonts/NeueBit-Regular.woff") format("woff");
}

/* CSS Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Neuebit', monospace;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.6px;
    background-color: #f5f5f5;
    background-image: radial-gradient(circle, #d0d0d0 1px, transparent 1px);
    background-size: 20px 20px;
    color: #333;
    overflow: hidden;
}

/* Left Navigation Bar */
.left-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: 45px;
    height: 100vh;
    background-color: #000000;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 0px 0 15px 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

/* Home link with icon */
.home-link {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    padding: 5px;
}

.home-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Filter group container */
.filter-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding-bottom: 5px;
}

/* Rotated text for nav items */
.nav-text {
    transform: rotate(-90deg);
    white-space: nowrap;
    font-size: 16px;
    font-family: 'Neuebit';
    font-weight: 600;
    letter-spacing: 1px;
    padding: 0px 10px;
}

/* Filter buttons */
.filter-btn {
    width: 35px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.filter-btn:hover {
    background-color: #1a1a1a;
}

.filter-btn.active {
    color: #aaff01;
}

/* Canvas Wrapper - Draggable Area */
.canvas-wrapper {
    position: fixed;
    left: 45px;
    top: 0;
    right: 0;
    bottom: 0;
    overflow: auto;
    cursor: grab;
}

.canvas-wrapper::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.canvas-wrapper::-webkit-scrollbar-track {
    background: #e0e0e0;
}

.canvas-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

.canvas-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Canvas Container - Expandable Canvas */
.canvas-container {
    min-width: 200%;
    min-height: 200%;
    padding: 60px;
    cursor: grab;
}

.canvas-container.dragging {
    cursor: grabbing;
}

/* Intro Section */
.intro-section {
    max-width: 600px;
    margin: 0 0 60px 0;
    padding: 30px;
    background-color: #fff;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.intro-section h1 {
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #000;
}

.intro-section p {
    font-size: 16px;
    line-height: 1.6;
    color: #666;
}

/* Image Grid */
.image-grid {
    position: relative;
}

/* Grid Item */
.grid-item {
    position: absolute;
    background-color: #fff;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #e0e0e0;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.grid-item.visible {
    opacity: 1;
}

.grid-item img {
    display: block;
    max-width: 250px;
    max-height: 250px;
    width: auto;
    height: auto;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

/* Item Info - Hidden */
.item-info {
    display: none;
}

.item-category {
    display: none;
}

.item-description {
    display: none;
}

.item-link {
    display: none;
}

/* Zoom View - True Zoom Animation */
.zoom-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.zoom-view.active {
    background-color: rgba(0, 0, 0, 0.95);
    pointer-events: all;
}

/* Zoom Content - Animates from clicked position */
.zoom-content {
    position: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    will-change: transform;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.zoom-view:not(.active) .zoom-content {
    /* Start at the clicked item's position and size */
    left: var(--start-x, 50%);
    top: var(--start-y, 50%);
    width: var(--start-width, 150px);
    height: var(--start-height, 150px);
    transform: translate(0, 0) scale(1);
    opacity: 0;
}

.zoom-view.active .zoom-content {
    /* Zoom to center and full size */
    left: 50%;
    top: 50%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.zoom-content img {
    max-width: 85vw;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Zoom Info */
.zoom-info {
    margin-top: 30px;
    text-align: center;
    color: #fff;
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
}

.zoom-view.active .zoom-info {
    opacity: 1;
}

.zoom-category {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #aaff01;
    margin-bottom: 10px;
    font-weight: 600;
}

.zoom-description {
    font-size: 16px;
    color: #ccc;
    margin-top: 10px;
    max-width: 600px;
}

.zoom-link {
    margin-top: 15px;
}

.zoom-download {
    display: inline-block;
    padding: 10px 24px;
    background-color: #aaff01;
    color: #000;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.zoom-download:hover {
    background-color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(170, 255, 1, 0.3);
}

/* Close Button */
.zoom-close {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
}

.zoom-view.active .zoom-close {
    opacity: 1;
    pointer-events: all;
}

.zoom-close:hover {
    background-color: #aaff01;
    color: #000;
    border-color: #aaff01;
    transform: rotate(90deg);
}

/* Navigation Arrows */
.zoom-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
}

.zoom-view.active .zoom-nav {
    opacity: 1;
    pointer-events: all;
}

.zoom-prev {
    left: 30px;
}

.zoom-next {
    right: 30px;
}

.zoom-nav:hover {
    background-color: #aaff01;
    color: #000;
    border-color: #aaff01;
    transform: translateY(-50%) scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .canvas-container {
        padding: 30px;
    }

    .intro-section {
        padding: 20px;
        margin-bottom: 40px;
    }

    .intro-section h1 {
        font-size: 28px;
    }

    .intro-section p {
        font-size: 14px;
    }

    .grid-item img {
        max-width: 180px;
        max-height: 180px;
    }

    .zoom-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .zoom-nav {
        width: 45px;
        height: 45px;
        font-size: 28px;
    }

    .zoom-prev {
        left: 15px;
    }

    .zoom-next {
        right: 15px;
    }

    .zoom-content img {
        max-width: 90vw;
        max-height: 60vh;
    }
}

@media (max-width: 480px) {
    .grid-item img {
        max-width: 150px;
        max-height: 150px;
    }

    .canvas-container {
        padding: 20px;
    }
}

/* Selection Colors */
::selection {
    background-color: #aaff01;
    color: #000;
}

::-moz-selection {
    background-color: #aaff01;
    color: #000;
}

/* Prevent text selection during drag */
.canvas-container * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}
