* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #000;
    min-height: 100vh;
    height: 100vh;
    padding: 0;
    margin: 0;
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    background: #000;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

header {
    background: #000;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-buttons {
    display: flex;
    gap: 12px;
}

.header-buttons.hidden {
    display: none;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid #333;
}

.file-info.hidden {
    display: none;
}

.file-name {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-close {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

h1 {
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.btn-primary {
    padding: 12px 28px;
    border: none;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    color: #000;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(255, 255, 255, 0.3);
}

.controls {
    padding: 20px 30px;
    background: #000;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.controls.hidden {
    display: none;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-btn {
    width: 50px;
    height: 50px;
    border: none;
    background: #fff;
    color: #000;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
    font-weight: 700;
}

.nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(255, 255, 255, 0.3);
}

.nav-btn:active {
    transform: scale(0.95);
}

.slider {
    flex: 1;
    height: 6px;
    border-radius: 10px;
    background: #333;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.3);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.5);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.3);
}

.viewer-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #000;
    position: relative;
    cursor: grab;
    overflow: hidden;
    touch-action: none;
}

.viewer-area.grabbing {
    cursor: grabbing;
}

.drop-zone {
    text-align: center;
    color: #666;
    font-size: 20px;
    font-weight: 500;
}

.drop-zone p {
    margin: 0;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    gap: 20px;
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    margin: 0;
}

.floating-controls {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.floating-controls.hidden {
    display: none;
}

.zoom-btn {
    width: 45px;
    height: 45px;
    border: none;
    background: #000;
    color: #fff;
    border-radius: 50%;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.zoom-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.zoom-btn:active {
    transform: scale(0.95);
}

#resetZoomBtn {
    width: auto;
    padding: 0 20px;
    border-radius: 30px;
    font-size: 14px;
}

#imageCanvas {
    width: 100%;
    height: 100%;
    display: none;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    pointer-events: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        position: fixed;
        overflow: hidden;
        touch-action: none;
    }

    header {
        padding: 15px;
        flex-direction: column;
        align-items: stretch;
        position: sticky;
        top: 0;
    }

    h1 {
        font-size: 22px;
        text-align: center;
    }

    .header-controls {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .header-buttons {
        width: 100%;
    }

    .btn-primary {
        flex: 1;
        padding: 12px 20px;
        font-size: 14px;
    }

    .file-info {
        width: 100%;
        justify-content: space-between;
    }

    .file-name {
        max-width: 200px;
    }

    .controls {
        padding: 15px;
        position: sticky;
        top: 0;
    }

    .slider-container {
        gap: 10px;
    }

    .nav-btn {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .viewer-area {
        padding: 10px;
        overflow: hidden;
        touch-action: none;
    }

    .drop-zone {
        font-size: 16px;
    }

    .floating-controls {
        top: 10px;
        padding: 8px 15px;
        gap: 8px;
    }

    .zoom-btn {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    #resetZoomBtn {
        padding: 0 15px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 20px;
    }

    .btn-primary {
        padding: 10px 16px;
        font-size: 13px;
    }

    .file-name {
        max-width: 150px;
        font-size: 13px;
    }

    .nav-btn {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    .zoom-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    #resetZoomBtn {
        padding: 0 12px;
        font-size: 11px;
    }
}

