/* --- CUSTOMIZATION PAGE STYLES --- */
.customize-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    padding: 20px;
    background: radial-gradient(circle at center, #2a0a2e 0%, #0a0a12 100%);
    position: relative;
    overflow: hidden;
}

.customize-header {
    text-align: center;
    margin-bottom: 20px;
}

.customize-title {
    font-family: var(--font-heading);
    color: white;
    font-size: 24px;
    letter-spacing: 3px;
    text-shadow: 0 0 15px var(--neon-cyan);
}

/* Stage Area with Snake Preview */
.customize-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 20px;
}

/* Spotlights effect */
.customize-stage::before {
    content: '';
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(0, 242, 254, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 0%, rgba(255, 0, 127, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.big-snake-preview {
    transform: scale(1.5);
    transition: 0.3s;
}

/* Sidebar Categories */
.customize-sidebar {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

.category-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    padding: 12px 20px;
    border-radius: 10px;
    font-family: var(--font-heading);
    font-size: 12px;
    cursor: pointer;
    transition: 0.3s;
    text-align: right;
    min-width: 100px;
}

.category-btn.active {
    background: rgba(0, 255, 141, 0.2);
    border-color: #00ff8d;
    color: #00ff8d;
    box-shadow: 0 0 15px rgba(0, 255, 141, 0.2);
}

/* Bottom Item Grid */
.customize-footer-ui {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid #4a148c;
    /* Purple highlight like image */
    border-radius: 20px;
    padding: 15px;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.item-slot {
    width: 80px;
    height: 80px;
    background: #1a237e;
    /* Dark blue backdrop for items */
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.item-slot img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.item-slot.selected {
    border-color: #ffff00;
}

.item-slot.selected::after {
    content: '✓';
    position: absolute;
    bottom: 5px;
    right: 5px;
    color: #ffff00;
    font-size: 14px;
    font-weight: bold;
}

.item-slot:hover {
    transform: scale(1.05);
    background: #283593;
}

/* Action Buttons */
.action-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 15px;
}

.control-btn {
    padding: 12px 25px;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
    border: none;
}

.btn-back {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-save {
    background: linear-gradient(90deg, #00ff8d 0%, #00f2fe 100%);
    color: black;
    font-weight: bold;
    box-shadow: 0 0 20px rgba(0, 255, 141, 0.3);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 255, 141, 0.5);
}

/* --- ITEM MODAL --- */
.item-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.item-modal-content {
    background: #1a0a2e;
    border: 2px solid #4a148c;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    padding: 20px;
    box-shadow: 0 0 40px rgba(74, 20, 140, 0.4);
}

.modal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.modal-category-title {
    font-family: var(--font-heading);
    color: #00ff8d;
    font-size: 18px;
}

.close-modal-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.items-grid-scroll {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 15px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .customize-container {
        padding: 10px;
    }

    .customize-sidebar {
        position: relative;
        transform: none;
        right: 0;
        top: 0;
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
        width: 100%;
        margin-bottom: 10px;
    }

    .category-btn {
        min-width: 80px;
        text-align: center;
        padding: 8px 15px;
        font-size: 10px;
    }

    .big-snake-preview {
        transform: scale(1.0);
    }

    .big-snake-preview .segmented-preview {
        gap: 8px;
    }


    .item-slot {
        width: 65px;
        height: 65px;
    }

    .item-modal-content {
        width: 95%;
        max-width: none;
    }
}