/* ===== BOX CUSTOMIZER PAGE STYLES ===== */
/* Version: 2.0 - Mobile Sticker Fix - 2025-10-28 */

.box-customizer-container {
    min-height: 100vh;
    padding: 7rem 2rem 4rem;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* ===== HEADER ===== */
.customizer-header {
    text-align: center;
    max-width: 1200px;
    width: 100%;
}

.customizer-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
    text-shadow: 
        0 0 10px var(--neon-green),
        0 0 20px var(--neon-purple),
        0 0 30px var(--neon-orange);
}

.customizer-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: var(--neon-teal);
    text-shadow: 0 0 10px var(--neon-teal);
    margin-bottom: 1rem;
}

/* ===== MAIN CONTENT AREA ===== */
.customizer-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== CANVAS WRAPPER ===== */
.canvas-wrapper {
    position: relative;
    background: rgba(10, 10, 10, 0.5);
    border: 3px solid var(--neon-purple);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 
        0 0 30px rgba(188, 19, 254, 0.4),
        inset 0 0 50px rgba(0, 0, 0, 0.5);
    min-height: 600px;
    display: flex;
    flex-direction: column;
}

#box-canvas {
    width: 100%;
    height: 600px;
    display: block;
    cursor: grab;
}

#box-canvas:active {
    cursor: grabbing;
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(57, 255, 20, 0.2);
    border-top: 4px solid var(--neon-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    margin-top: 1rem;
    color: var(--neon-green);
    font-size: 1.2rem;
    text-shadow: 0 0 10px var(--neon-green);
}

/* ===== CONTROLS HINT ===== */
.controls-hint {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem;
    border-radius: 10px;
    border: 2px solid var(--neon-teal);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 10;
}

.hint-item {
    color: var(--neon-teal);
    font-size: 0.9rem;
    text-shadow: 0 0 5px var(--neon-teal);
}

/* ===== CANVAS ACTIONS ===== */
.canvas-actions {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    z-index: 10;
}

.action-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(188, 19, 254, 0.3), rgba(57, 255, 20, 0.3));
    border: 2px solid var(--neon-green);
    border-radius: 25px;
    color: var(--neon-green);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.3);
    font-size: 0.9rem;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(57, 255, 20, 0.6);
    border-color: var(--neon-teal);
    color: var(--neon-teal);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn.active {
    background: linear-gradient(135deg, rgba(57, 255, 20, 0.4), rgba(0, 255, 255, 0.4));
    border-color: var(--neon-teal);
    color: var(--neon-teal);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.6);
}

#removeModeBtn.active {
    background: linear-gradient(135deg, rgba(255, 69, 0, 0.4), rgba(255, 0, 0, 0.4));
    border-color: #ff4500;
    color: #ff4500;
    box-shadow: 0 0 30px rgba(255, 69, 0, 0.6);
    animation: pulse-remove 1.5s ease-in-out infinite;
}

@keyframes pulse-remove {
    0%, 100% {
        box-shadow: 0 0 30px rgba(255, 69, 0, 0.6);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 69, 0, 0.9);
    }
}

/* ===== STICKER LIBRARY PANEL ===== */
.sticker-library-panel {
    background: rgba(10, 10, 10, 0.5);
    border: 3px solid var(--neon-purple);
    border-radius: 20px;
    padding: 1rem;
    box-shadow:
        0 0 30px rgba(188, 19, 254, 0.4),
        inset 0 0 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 800px;
    overflow-y: auto;
}

.panel-header {
    text-align: center;
}

.panel-header h2 {
    font-size: 1.5rem;
    color: var(--neon-green);
    text-shadow: 0 0 10px var(--neon-green);
    margin-bottom: 0.5rem;
}

.sticker-count {
    color: var(--neon-orange);
    font-size: 1rem;
    text-shadow: 0 0 5px var(--neon-orange);
}

/* ===== STICKER GRID ===== */
.sticker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    max-height: 550px !important;
    overflow-y: auto !important;
    overflow-x: hidden;
    padding: 0.5rem;
    scroll-behavior: smooth;
    /* background: rgba(0, 0, 0, 0.3);
    border-radius: 10px; */
}

.sticker-grid::-webkit-scrollbar {
    width: 10px;
}

.sticker-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    margin: 4px 0;
}

.sticker-grid::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--neon-purple), var(--neon-green));
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(188, 19, 254, 0.6);
    border: 2px solid rgba(0, 0, 0, 0.3);
}

.sticker-grid::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--neon-green), var(--neon-teal));
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.8);
}

.sticker-item {
    aspect-ratio: 1 / 1;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
}

.sticker-item:hover {
    transform: scale(1.02);
    border-color: var(--neon-green);
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.5);
}

.sticker-item.selected {
    border-color: var(--neon-teal);
    box-shadow:
        0 0 25px rgba(0, 255, 255, 0.7),
        inset 0 0 20px rgba(0, 255, 255, 0.2);
    animation: selectedPulse 2s ease-in-out infinite;
}

@keyframes selectedPulse {
    0%, 100% {
        box-shadow:
            0 0 25px rgba(0, 255, 255, 0.7),
            inset 0 0 20px rgba(0, 255, 255, 0.2);
    }
    50% {
        box-shadow:
            0 0 35px rgba(0, 255, 255, 0.9),
            inset 0 0 30px rgba(0, 255, 255, 0.3);
    }
}

.sticker-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* ===== SELECTED STICKER INFO ===== */
.selected-sticker-info {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--neon-teal);
    border-radius: 15px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-label {
    color: var(--neon-teal);
    font-weight: 700;
    text-shadow: 0 0 5px var(--neon-teal);
}

.info-preview {
    width: 100%;
    aspect-ratio: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.info-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.info-placeholder {
    color: var(--text-dim);
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem;
}

.sticker-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sticker-controls label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: var(--neon-green);
    font-size: 0.9rem;
}

.sticker-controls input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
}

.sticker-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--neon-green);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.8);
}

.sticker-controls input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--neon-green);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.8);
    border: none;
}

/* ===== INFO PANEL ===== */
.info-panel {
    width: 100%;
    max-width: 1400px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.info-section {
    background: rgba(10, 10, 10, 0.5);
    border: 2px solid var(--neon-purple);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 0 20px rgba(188, 19, 254, 0.3);
}

.info-section h3 {
    color: var(--neon-orange);
    text-shadow: 0 0 10px var(--neon-orange);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.info-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-section li {
    color: var(--text-dim);
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
}

.info-section li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--neon-green);
    text-shadow: 0 0 5px var(--neon-green);
}

.info-section strong {
    color: var(--neon-teal);
    text-shadow: 0 0 5px var(--neon-teal);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid var(--neon-green);
    border-radius: 15px;
    padding: 1rem 1.5rem;
    color: var(--neon-green);
    font-weight: 700;
    box-shadow: 0 0 30px rgba(57, 255, 20, 0.6);
    z-index: 10000;
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    border-color: #ff0066;
    color: #ff0066;
    box-shadow: 0 0 30px rgba(255, 0, 102, 0.6);
}

.toast.success {
    border-color: var(--neon-green);
    color: var(--neon-green);
    box-shadow: 0 0 30px rgba(57, 255, 20, 0.6);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .customizer-content {
        grid-template-columns: 1fr;
    }
    
    .sticker-library-panel {
        max-height: 600px;
        overflow-y: auto;
    }
    
    .sticker-grid {
        grid-template-columns: repeat(5, 1fr);
        max-height: 350px;
        gap: 0.4rem;
    }
}

@media (max-width: 768px) {
    .box-customizer-container {
        padding: 6rem 1rem 2rem;
    }
    
    #box-canvas {
        height: 400px;
    }
    
    .canvas-actions {
        flex-direction: column;
        gap: 0.5rem;
        bottom: 0.5rem;
    }
    
    .action-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .controls-hint {
        font-size: 0.75rem;
        padding: 0.5rem;
    }
    
    .sticker-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        max-height: none !important;
        min-height: auto !important;
        gap: 0.5rem !important;
        background: rgba(0, 0, 0, 0.5) !important;
        padding: 0.75rem !important;
        overflow-y: visible !important;
    }
    
    .sticker-library-panel {
        max-height: none !important;
    }
    
    /* .sticker-item {
        padding-bottom: 100% !important;
        background: rgba(255, 255, 255, 0.3) !important;
        border: 3px solid rgba(57, 255, 20, 0.6) !important;
        box-shadow: 0 0 15px rgba(57, 255, 20, 0.4) !important;
    }
    
    .sticker-item:active {
        transform: scale(0.95) !important;
        background: rgba(57, 255, 20, 0.3) !important;
        border-color: var(--neon-teal) !important;
    } */
    
    .sticker-item img {
        padding: 6px !important;
    }
    
    .info-panel {
        grid-template-columns: 1fr;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(57, 255, 20, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(57, 255, 20, 0.8);
    }
}