@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600&display=swap');

:root {
    --bg-color: #050505;
    --panel-bg: rgba(20, 20, 20, 0.85);
    --accent-color: #00d2ff;
    --text-color: #f0f0f0;
    --glass-border: rgba(255, 255, 255, 0.1);
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-color);
    font-family: 'Outfit', sans-serif;
    color: var(--text-color);
}

#container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    touch-action: none;
    /* v2.2: Disable browser touch gestures for custom 3D handlers */
}

#uploader-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100vh;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 30px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), visibility 0.4s;
    visibility: visible;
}

#uploader-panel.hidden {
    transform: translateX(100%);
    visibility: hidden;
    /* v2.1: Ensure it doesn't block interaction */
    pointer-events: none;
}

/* Ensure contents are clickable when visible */
#uploader-panel:not(.hidden) {
    pointer-events: auto;
}

#uploader-panel::-webkit-scrollbar {
    width: 6px;
}

#uploader-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Menu Toggle Tabs */
.menu-tab {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: var(--accent-color);
    border: none;
    border-radius: 50%;
    color: #000;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.4);
    margin: 0;
    padding: 0;
    pointer-events: auto;
    /* Always clickable */
}

#menu-toggle-in {
    position: absolute;
    top: 20px;
    right: 20px;
}

/* Mobile Bottom Bar (v2.0) */
#mobile-anim-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    /* Controlled by JS */
    flex-direction: column;
    gap: 10px;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(10px);
    padding: 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 900;
    width: max-content;
    max-width: 95vw;
}

.mobile-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.mobile-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 10px;
    border-radius: 20px;
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    width: auto;
    min-width: 80px;
    margin: 0;
}

.mobile-btn.active {
    background: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
}

.mobile-btn.reset-style {
    background: rgba(255, 100, 100, 0.15);
    border-color: rgba(255, 100, 100, 0.4);
}

h1 {
    font-size: 16px;
    /* v2.2: Reduced for narrower panel */
    font-weight: 600;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #fff, var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.input-group {
    margin-bottom: 15px;
}

label {
    display: block;
    font-size: 11px;
    /* v2.2: Reduced */
    font-weight: 400;
    margin-bottom: 6px;
    color: #aaa;
}

input[type="file"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 6px;
    border-radius: 6px;
    color: #fff;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="file"]:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
}

button {
    margin-top: 15px;
    padding: 12px;
    font-size: 13px;
    /* v2.2: Reduced */
    font-weight: 600;
    color: #000;
    background: var(--accent-color);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
    width: 100%;
}

#reset-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

#reset-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
}

#start-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
}

/* UPDATED ON: 2026-01-04 // REASON: Styling for new animation buttons */
.animation-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
}

.anim-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
}

.anim-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.anim-btn.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 210, 255, 0.5);
    filter: brightness(1.1);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
}

.controls-hint {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.6;
    border: 1px solid var(--glass-border);
}

.controls-hint p {
    margin: 0 0 10px 0;
    color: var(--accent-color);
}

.controls-hint ul {
    margin: 0;
    padding-left: 20px;
    color: #888;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 210, 255, 0.1);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #uploader-panel {
        width: 80%;
    }

    h1 {
        font-size: 20px;
        margin-right: 40px;
    }

    #mobile-anim-bar {
        display: flex;
    }

    /* Hide desktop-only elements inside panel if needed */
    .animation-buttons p {
        display: none;
    }
}