/* Gaming Setup Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 100;
    backdrop-filter: blur(5px);
}

.modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.95), rgba(40, 40, 40, 0.95));
    border: 2px solid #e3fc02;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 0 30px rgba(227, 252, 2, 0.4), 0 0 60px rgba(0, 0, 0, 0.6);
    color: white;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(227, 252, 2, 0.3);
    padding-bottom: 15px;
}

.modal-title {
    font-size: 2em;
    font-weight: bold;
    text-transform: uppercase;
    color: #e3fc02;
    text-shadow: 0 0 10px rgba(227, 252, 2, 0.5);
    letter-spacing: 2px;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 0;
    color: white;
    cursor: pointer;
    transition: transform 0.3s, background-color 0.3s, color 0.3s;
    width: 40px;
    height: 40px;
    display: block;
    border-radius: 50%;
    background-color: rgba(227, 252, 2, 0.2);
    padding: 0;
    flex-shrink: 0;
    position: relative;
    /* Ensure rotation happens around the center */
    transform-origin: center center;
}

/* Replace the × character with a perfectly centered one using pseudo-element */
.close-modal::before {
    content: '×';
    font-size: 1.8rem;
    line-height: 1;
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-weight: 300;
    letter-spacing: 0;
    /* Absolutely position and center using margin: auto (no transform conflicts) */
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 1.8rem;
    height: 1.8rem;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.close-modal:hover {
    color: #e3fc02;
    transform: rotate(90deg);
    background-color: rgba(227, 252, 2, 0.3);
    /* Ensure rotation origin stays centered */
    transform-origin: center center;
}

.modal-content {
    margin-bottom: 20px;
}

.setup-category {
    margin-bottom: 30px;
}

.category-title {
    font-size: 1.4em;
    color: #e3fc02;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    position: relative;
    text-shadow: 0 0 5px rgba(227, 252, 2, 0.5);
}

.category-title::before {
    content: '>';
    margin-right: 10px;
    color: #e3fc02;
}

.category-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, #e3fc02, transparent);
}

.setup-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(40, 40, 40, 0.6);
    border-radius: 8px;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.setup-item:hover {
    background: rgba(50, 50, 50, 0.8);
    transform: translateX(5px);
    border-left-color: #e3fc02;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.setup-item:focus {
    outline: 2px solid #e3fc02;
    outline-offset: 2px;
}

.item-icon {
    width: 40px;
    height: 40px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(227, 252, 2, 0.2);
    border-radius: 50%;
    color: #e3fc02;
    transition: all 0.3s ease;
}

.item-icon i {
    font-size: 1.2em;
    transition: all 0.3s ease;
}

.item-details {
    flex-grow: 1;
}

.item-title {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 1.1em;
    color: white;
}

.item-description {
    font-size: 0.9em;
    color: #ccc;
    margin-bottom: 8px;
}

.item-buy {
    padding: 8px 15px;
    background: linear-gradient(135deg, #222, #333);
    border: 2px solid #e3fc02;
    border-radius: 5px;
    color: white;
    text-decoration: none;
    font-size: 0.9em;
    transition: all 0.3s;
    display: inline-block;
}

.item-buy:hover {
    background: #e3fc02;
    color: black;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.setup-item:hover .item-icon {
    background: rgba(227, 252, 2, 0.3);
    transform: scale(1.1);
}

.setup-item:hover .item-icon i {
    transform: scale(1.1);
}

/* Modal animations */
@keyframes modalFadeIn {
    from { opacity: 0; transform: translate(-50%, -60%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.modal-open {
    display: block;
}

.modal-container.animate {
    animation: modalFadeIn 0.3s forwards;
}

/* Circuit board background effect for modal */
.circuit-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(40, 40, 40, 0.95), rgba(20, 20, 20, 0.97)),
        repeating-linear-gradient(0deg, transparent, transparent 20px, rgba(227, 252, 2, 0.03) 20px, rgba(227, 252, 2, 0.03) 21px),
        repeating-linear-gradient(90deg, transparent, transparent 20px, rgba(227, 252, 2, 0.03) 20px, rgba(227, 252, 2, 0.03) 21px);
    z-index: -1;
    border-radius: 8px;
    pointer-events: none;
}

/* Mobile responsiveness for modal */
@media (max-width: 768px) {
    .modal-container {
        width: 85%;
        padding: 15px;
        max-height: 85vh;
        top: 10px;
        transform: translateX(-50%);
        margin-bottom: 10px;
        position: absolute;
        left: 50%;
    }
    
    .modal-open {
        display: flex;
        align-items: flex-start;
        padding: 10px 0;
        overflow-y: auto;
    }

    .modal-title {
        font-size: 1.4em;
        max-width: 70%;
    }
    
    .modal-header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    
    .close-modal {
        font-size: 0;
        width: 36px;
        height: 36px;
        display: block;
        position: relative;
        transform-origin: center center;
    }
    
    .close-modal::before {
        font-size: 1.6rem;
        width: 1.6rem;
        height: 1.6rem;
    }

    .setup-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .item-icon {
        margin-bottom: 10px;
    }
    
    /* Fix modal animation for mobile */
    @keyframes modalFadeIn {
        from { opacity: 0; transform: translateX(-50%); }
        to { opacity: 1; transform: translateX(-50%); }
    }
}