body {
    margin: 0;
    padding: 10px;
    background-color: black;
    color: white;
    font-family: Arial, sans-serif;
    min-height: 100vh;
    max-width: 100%;
    box-sizing: border-box;
}

.folder-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 800px;
    margin: 0 auto;
    padding: 10px;
}

.folder-link {
    color: #00ff00;
    text-decoration: none;
    padding: 15px;
    border: 1px solid #333;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    word-break: break-word;
    background-color: rgba(34, 34, 34, 0.8);
    transition: background-color 0.2s ease;
}

.folder-link:hover {
    background-color: #333;
}

.image-viewer {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding-top: 60px; /* Space for fixed back button */
}

.image-container img {
    width: 100%;
    height: auto;
    margin: 5px 0;
    display: block;
}

.hidden {
    display: none;
}

.nav-button {
    background-color: rgba(51, 51, 51, 0.9);
    color: white;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    border-radius: 5px;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1000;
    font-size: 16px;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.nav-button:hover {
    background-color: #444;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }

    .folder-list {
        padding: 5px;
    }

    .folder-link {
        padding: 12px;
        font-size: 14px;
    }

    .image-viewer {
        padding-top: 50px;
    }

    .nav-button {
        padding: 10px 15px;
        font-size: 14px;
    }

    .image-container img {
        margin: 3px 0;
    }
}

.single-image-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    cursor: pointer;
    min-height: 200px;
}

.single-image-wrapper img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    transition: transform 0.2s ease;
    display: block;
}

.single-image-wrapper img:hover {
    transform: scale(1.02);
}

.image-counter {
    text-align: center;
    padding: 10px;
    font-size: 16px;
    color: #888;
}

.fullscreen-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: black;
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.viewer-controls {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(5px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 2001;
    gap: 20px;
}

.viewer-controls.hidden {
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
}

.navigation-controls,
.zoom-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.viewer-controls button {
    background-color: rgba(51, 51, 51, 0.9);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    min-width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.viewer-controls button:hover {
    background-color: rgba(75, 75, 75, 0.8);
}

.close-button {
    background-color: rgba(200, 0, 0, 0.8) !important;
}

.close-button:hover {
    background-color: rgba(255, 0, 0, 0.8) !important;
}

.image-wrapper {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-image {
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
    transition: transform 0.2s ease;
    transform-origin: center center;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .viewer-controls {
        padding: 15px 10px;
        flex-direction: column;
        gap: 15px;
        transform: translateY(-100%);
    }

    .viewer-controls.visible {
        transform: translateY(0);
    }

    .navigation-controls,
    .zoom-controls {
        width: 100%;
        justify-content: center;
        gap: 12px;
    }

    .viewer-controls button {
        padding: 10px;
        min-width: 44px;
        height: 44px;
        font-size: 14px;
    }

    .viewer-counter {
        min-width: 80px;
        text-align: center;
        font-size: 14px;
    }

    .close-button {
        position: absolute;
        top: 15px;
        right: 15px;
    }

    .toggle-controls {
        width: 60px;
        height: 5px;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .viewer-controls {
        opacity: 1;
        transform: none;
    }

    .viewer-controls.hidden {
        opacity: 0;
        transform: translateY(-100%);
    }

    .viewer-controls button {
        padding: 15px;
        min-width: 48px;
        height: 48px;
    }
}

.viewer-counter {
    color: #888;
    font-size: 14px;
}

.fullscreen-image {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    margin: 0;
    padding: 0;
    background: black;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .viewer-controls {
        padding: 10px;
        gap: 8px;
    }

    .viewer-controls button {
        padding: 8px 12px;
        font-size: 12px;
    }

    .close-button {
        padding: 6px 10px !important;
    }
}

.toggle-controls {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 5px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 0 0 10px 10px;
    z-index: 2002;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-controls:hover {
    background-color: rgba(255, 255, 255, 0.5);
    height: 7px;
}

/* Update mobile styles for both portrait and landscape */
@media (max-width: 768px), (max-height: 768px) and (orientation: landscape) {
    .viewer-controls {
        padding: 15px 10px;
        flex-direction: column;
        gap: 15px;
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .viewer-controls.visible {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .close-button {
        position: absolute;
        top: 70px !important; /* Move down to avoid overlap */
        right: 15px;
    }

    .toggle-controls {
        width: 60px;
        height: 5px;
        opacity: 0.8;
    }

    .toggle-controls.active {
        background-color: rgba(255, 255, 255, 0.5);
        height: 7px;
    }
}

/* Landscape-specific adjustments */
@media (orientation: landscape) and (max-height: 768px) {
    .viewer-controls {
        flex-direction: row;
        padding: 10px;
        gap: 20px;
    }

    .navigation-controls,
    .zoom-controls {
        flex-direction: row;
        width: auto;
    }

    .close-button {
        position: static;
        top: auto !important;
    }
}

/* Add these styles for touch zones */
.touch-zones {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2001;
    pointer-events: none;
}

.touch-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30%;
    pointer-events: auto;
}

.left-zone {
    left: 0;
}

.right-zone {
    right: 0;
}

/* Only show touch zones on mobile */
@media (min-width: 769px) {
    .touch-zones {
        display: none;
    }
}

/* Adjust for landscape mode */
@media (orientation: landscape) and (max-height: 768px) {
    .touch-zone {
        width: 15%; /* Narrower zones in landscape */
        height: 100vh;
        top: 0; /* Reset top position */
    }
    
    .touch-zones {
        top: 0; /* Reset top position */
        height: 100vh;
        pointer-events: none;
    }

    .left-zone {
        position: fixed;
        left: 0;
        pointer-events: auto;
    }

    .right-zone {
        position: fixed;
        right: 0;
        pointer-events: auto;
    }

    /* Ensure zones are above other elements but below controls */
    .touch-zones {
        z-index: 2001;
    }

    .viewer-controls {
        z-index: 2002;
    }
}

/* Make sure touch zones don't interfere with controls */
.viewer-controls,
.toggle-controls {
    z-index: 2002;
}

/* Ensure image wrapper doesn't block touch zones */
.image-wrapper {
    pointer-events: none;
}

.image-wrapper img {
    pointer-events: auto;
}

/* Add these styles for pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
    padding: 10px;
}

.page-button {
    background-color: rgba(51, 51, 51, 0.9);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    min-width: 40px;
    transition: background-color 0.2s ease;
}

.page-button:hover {
    background-color: rgba(75, 75, 75, 0.9);
}

.page-button.active {
    background-color: #00ff00;
    color: black;
    font-weight: bold;
}

/* Mobile adjustments for pagination */
@media (max-width: 768px) {
    .pagination {
        gap: 5px;
    }
    
    .page-button {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 35px;
    }
}

.preload-container {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}
 