* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#gallery3d-container {
    width: 100%;
    height: 100vh;
    position: relative;
    background: #1a1a1a;
}

#canvas-container {
    width: 100%;
    height: 100%;
}

#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-content h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-status {
    color: #aaa;
    font-size: 1rem;
    margin-top: 1rem;
}

#controls-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.hamburger-menu {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 0;
    backdrop-filter: blur(10px);
    transition: background 0.3s, transform 0.2s;
    position: relative;
    z-index: 102;
}

.hamburger-menu:hover {
    background: rgba(102, 126, 234, 0.3);
    transform: scale(1.05);
}

.hamburger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.control-panel {
    background: rgba(0, 0, 0, 0.8);
    padding: 1.5rem;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: absolute;
    top: 60px;
    right: 0;
    min-width: 250px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    padding: 0 1.5rem;
}

.control-panel.open {
    max-height: 600px;
    opacity: 1;
    padding: 1.5rem;
}

.control-panel h3 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.control-panel p {
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.btn {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

.artwork-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 1.5rem 2rem;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    min-width: 300px;
    max-width: 500px;
    transition: opacity 0.3s, transform 0.3s;
}

.artwork-info.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}

.artwork-info h3 {
    color: white;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.artwork-info p {
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}

.repo-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    transition: color 0.2s;
}

.repo-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.info-actions {
    margin-top: 1rem;
}

.info-actions .btn {
    width: 100%;
    margin-bottom: 0;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    #controls-overlay {
        top: 10px;
        right: 10px;
    }

    .hamburger-menu {
        width: 45px;
        height: 45px;
    }

    .control-panel {
        min-width: calc(100vw - 40px);
        right: -10px;
    }

    .control-panel.open {
        padding: 1rem;
    }

    .control-panel h3 {
        font-size: 1rem;
    }

    .artwork-info {
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        min-width: auto;
    }

    .artwork-info.hidden {
        transform: translateY(20px);
    }
}

.pagination-controls {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pagination-info {
    color: #aaa;
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
    text-align: center;
}

canvas {
    display: block;
}
