/*
 * This CSS file contains styles for the Pokédex page.
 * It includes layout rules for the main container, ensuring a flexible and responsive design.
 * The file also defines styles for specific elements such as the battle panel and the open/close button for the aside menu.
 * These styles ensure a consistent and visually appealing user interface.
 */


.container {
    display: flex;
    flex-direction: row-reverse;

    .openCloseAside {
        position: fixed;
        z-index: 2;
        display: none;
        justify-content: center;
        align-items: center;
        color: white;
        background-color: #333;
        width: 50px;
        height: 50px;
        margin-top: 90px;
        border-radius: 8px 0px 0px 8px;
        transition: 0.5s;
    }

    #battle-panel {
        width: 250px;
        height: 100dvh;
        padding: 15px;
        background-color: #f7f7f7;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
        border-right: 1px solid #ccc;
        position: sticky;
        top: 0;
        height: 100vh;
        transition: 0.5s;
        background: linear-gradient(to right, #444, #222);
        border-left: 5px solid #f7d02c;
        padding-top: 60px;
        overflow-y: auto;
        z-index: 900;

        .user-info {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 15px;
            margin-bottom: 20px;
            padding: 10px;
            background: linear-gradient(to bottom, #444, #222);
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
            color: white;
            text-align: center;
            overflow: hidden;

            .user-avatar {
                width: 80px;
                height: 80px;
                object-fit: cover;
                border-radius: 50%;
                border: 3px solid #f7f7f7;
                margin-bottom: 10px;
            }

            .user-name {
                font-size: 18px;
                font-weight: bold;
                margin: 5px 0;
                text-wrap: wrap;
            }

            .user-email {
                font-size: 12px;
                width: 180px;
                overflow: hidden;
                text-overflow: ellipsis;
            }

            .user-pokemon {
                overflow: hidden;
                text-overflow: ellipsis;
                width: 180px;
            }

            .user-stats {
                font-size: 14px;
                margin: 0;
                color: #ccc;
            }

            .edit-button {
                padding: 12px 20px;
                background-color: #f7d02c;
                color: rgba(0, 0, 0, 0.76);
                border: none;
                border-radius: 8px;
                font-size: 16px;
                font-weight: bold;
                cursor: pointer;
                transition: all 0.3s ease;
                display: flex;
                align-items: center;
                gap: 10px;
            }

            .edit-button:hover {
                transform: scale(1.1);
            }
        }

        h2 {
            font-size: 20px;
            margin-bottom: 10px;
            color: white;
        }

        ul {
            display: grid;
            grid-template-areas:
                "slot1 slot1"
                "slot2 slot3"
                "slot4 slot5";
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            padding: 0;
            margin: 0;
        }

        li {
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 8px;
            border: 1px solid #ccc;
            border-radius: 4px;
            background-color: #f7f7f7;
            height: 100px;
            width: 100%;

            button {
                position: absolute;
                top: -10px;
                right: -10px;
                background-color: #e74c3c;
                color: white;
                border: none;
                padding: 4px 8px;
                border-radius: 4px;
                font-size: 12px;
                cursor: pointer;
                opacity: 0;
                z-index: 10;
                transform: scale(0);
                transition: transform 0.3s ease, opacity 0.3s ease;
            }

            button:hover {
                background-color: #c0392b;
            }

            img {
                width: 50px;
                height: 50px;
                object-fit: cover;
                margin-bottom: 5px;
                transition: transform 0.5s ease;
            }

            span {
                font-size: 14px;
                text-align: center;
                color: #333;
                font-weight: bold;
            }
        }

        li:hover img {
            transform: scale(1.5);
        }

        li:hover button {
            transform: scale(1);
            opacity: 1;
            visibility: visible;
        }

        li:nth-child(1) {
            grid-area: slot1;
        }

        li:nth-child(2) {
            grid-area: slot2;
        }

        li:nth-child(3) {
            grid-area: slot3;
        }

        li:nth-child(4) {
            grid-area: slot4;
        }

        li:nth-child(5) {
            grid-area: slot5;
        }

        .empty-slot {
            display: flex;
            align-items: center;
            justify-content: center;
            color: #999;
            font-size: 14px;
            height: 100px;
            background-color: #f7f7f7;
            border: 1px dashed #ccc;
            border-radius: 4px;
        }
    }
}

@media (max-width: 768px) {

    .openCloseAside {
        display: flex !important;
    }

    #battle-panel {
        margin-right: -250px;
        position: fixed !important;
        z-index: 2;
        padding-top: 80px !important;
    }

    .container-modal {
        width: 100% !important;
        height: calc(100dvh - 60px) !important;
        padding: 0px !important;
        margin-top: 33px;
        border-radius: 0px !important;
    }
}

@media (min-width: 768px) {
    #battle-panel {
        margin-right: 0px !important;
    }
}














main {
    flex: 1;
    padding: 20px;
}


.container-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: transparent;
    border-radius: 5px;
    width: 50%;
    height: 70%;
    text-align: center;
    border-radius: 20px;
    overflow: hidden;
    z-index: 9999;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    transition: transform 0.5s ease-in-out;

    .mask {
        width: 100%;
        height: 100%;
        position: relative;
        z-index: 999;

        iframe {
            width: 200%;
            height: 200%;
            transform: scale(0.5);
            transform-origin: 0 0;
            position: absolute;
            left: 0;
            top: 0;
            z-index: 99;
            border-radius: 20px;
            overflow: hidden;
        }
    }
}

.container-modal.open {
    transform: translate(-50%, -50%) scale(1) !important;
}


/* Popup */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.popup.show {
    display: flex;
    opacity: 1;
}

.popup-content {
    background: linear-gradient(to bottom, #444, #222);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    width: 350px;
    max-width: 90%;
    text-align: center;
    animation: scaleIn 0.5s ease-in-out;

    .popup-header {
        background-color: #f7d02c;
        color: black;
        border-radius: 12px 12px 0 0;
        padding: 10px 20px;
        margin: -20px -20px 20px -20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    
        h2 {
            margin: 0;
            font-size: 20px;
        }
        
        .close-button {
            background: none;
            border: none;
            color: black;
            font-size: 24px;
            cursor: pointer;
        }
    }

    #editForm {
        display: flex;
        flex-direction: column;
        align-content: center;
        justify-content: center;

        .preview-container {
            display: flex;
            justify-content: center;
            align-items: center;

            .preview-avatar {
                width: 100px;
                height: 100px;
                object-fit: cover;
                border-radius: 50%;
                border: 2px solid #ddd;
                box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
                cursor: pointer;
                transition: transform 0.3s ease, box-shadow 0.3s ease;
            }
            
            .preview-avatar:hover {
                transform: scale(1.1);
                box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
            }
        }

        label {
            display: block;
            margin: 15px 0 5px;
            text-align: left;
            font-size: 14px;
            color: white;
        }
        
        input[type="text"], input[type="email"] {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-size: 14px;
            transition: border-color 0.3s ease;
        }
        
        input:focus {
            border-color: #f7d02c;
            outline: none;
        }

        #error {
            margin-top: 10px;
            color: red;
        }
        
        .save-button {
            padding: 15px 30px;
            font-size: 1.3rem;
            font-weight: bold;
            color: #000000;
            background-color: #ffcb05;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            transition: transform 0.3s ease-in-out, background-color 0.3s;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
            overflow: hidden;
            position: relative;
            margin-top: 10px;
        }

        .save-button:hover {
            transform: scale(1.1);
            background-color: #ffd738;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
        }

        .save-button::after {
            content: "";
            position: absolute;
            top: 50%;
            left: 50%;
            width: 100px;
            height: 100px;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 50%;
            transform: translate(-50%, -50%) scale(0);
            transition: transform 0.3s ease-out;
            z-index: -1;
        }

        .save-button:hover::after {
            transform: translate(-50%, -50%) scale(1.5);
        }
        
    }

    .close-button:hover {
        color: #ff4081;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

.pokemon-list {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 70px;
}

.pokemon-img {
    width: 100px;
    height: 100px;
}

.pokemon-card {
    width: 250px;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 10px;
    opacity: 0;
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.15);
    transform: scale(0);
    transition: transform 0.5s ease, opacity 0.3s ease, box-shadow 0.6s ease, z-index 0s, height 0.5s ease, width 0.5s ease;

    .hp {
        width: 80px;
        background-color: #ffffff;
        text-align: center;
        padding: 8px 0;
        border-radius: 30px;
        margin-left: auto;
        font-weight: 400;

        span {
            font-size: 12px;
            letter-spacing: 0.4px;
            font-weight: 600;
        }
    }

    .poke-img {
        display: block;
        width: 100px;
        max-height: 200px;
        position: relative;
        margin: 20px auto;
    }

    .poke-name {
        text-align: center;
        font-weight: 600;
    }

    .types {
        display: flex;
        justify-content: space-around;
        margin: 20px 0 40px 0;

        span {
            font-size: 12px;
            letter-spacing: 0.4px;
            font-weight: 600;
            text-transform: capitalize;

            padding: 5px 20px;
            border-radius: 20px;
            color: #ffffff;
        }
    }

    .stats {
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: center;

        p {
            color: #404060;
        }
    }
}

.pokemon-card.visible {
    opacity: 1;
    transform: scale(1);
}

.pokemon-card.hidden {
    display: none;
}

.pokemon-card:hover {
    transform: scale(1.1);
    transition: transform 0.3s ease, box-shadow 0.6s ease, height 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.pokemon-card.expanded {
    position: fixed;
    z-index: 900!important;
    transition: all 0.5s ease-in-out;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.pokemon-card.collapsing {
    transition: all 0.5s ease-in-out;
}

.pokemon-card-placeholder {
    visibility: hidden;
    transition: all 0.5s ease;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 899;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
}

.overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.no-scroll {
    overflow: hidden;
}


/* Pokémon Popup Styles */
.pokemon-popup-game {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    animation: fadeInOverlay 0.8s forwards;
}

.pokemon-popup-game.hidden {
    display: none;
    visibility: hidden;
}

.popup-content-game {
    text-align: center;
    color: #fff;
    background: linear-gradient(145deg, #1f1f1f, #292929);
    padding: 2.5rem;
    border-radius: 25px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
    animation: popupBounce 0.9s ease-in-out;
    max-width: 650px;
    margin: auto;
}

.popup-content-game h1 {
    font-size: 3rem;
    font-weight: bold;
    color: #ffcb05;
    text-shadow: 0 0 10px #ffcb05, 0 0 20px #ffcb05;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.popup-message-game {
    font-size: 1.4rem;
    line-height: 2;
    color: #d1d5db;
    margin-bottom: 2.5rem;
}

.popup-message-game strong {
    color: #ffd700;
    font-weight: bold;
    text-shadow: 0 0 10px #ffd700;
}

.popup-message-game .highlight {
    color: #ffcb05;
    font-size: 1.5rem;
    text-shadow: 0 0 15px #ffcb05, 0 0 25px #ffcb05;
}

.restart-button-game {
    padding: 15px 30px;
    font-size: 1.3rem;
    font-weight: bold;
    color: #000000;
    background-color: #ffcb05;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease-in-out, background-color 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
}

.restart-button-game:hover {
    transform: scale(1.1);
    background-color: #ffd738;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.restart-button-game::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.3s ease-out;
    z-index: -1;
}

.restart-button-game:hover::after {
    transform: translate(-50%, -50%) scale(1.5);
}

/* Popup Animation */
@keyframes popupBounce {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fade Out Animation */
@keyframes fadeOutOverlay {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Apply Fade Out */
.pokemon-popup-game.closing {
    animation: fadeOutOverlay 0.5s forwards;
}

@keyframes fadeOutInside {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.5);
    }
}

/* Apply Fade Out */
.pokemon-popup-game.closing .popup-content-game {
    animation: fadeOutInside 0.5s forwards;
}




/* Fail Popup Specific Styles */
.popup-content-game.escape {
    background: linear-gradient(145deg, #3a3a3a, #2e2e2e);
    color: #ffffff;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.8);
}

.popup-content-game.escape h1 {
    font-size: 3rem;
    font-weight: bold;
    color: #f44336; /* Red text for failure */
    text-shadow: 0 0 10px #f44336, 0 0 20px #f44336;
    margin-bottom: 1rem;
    line-height: 1.2;
    animation: textShake 0.7s ease-in-out infinite alternate;
}

/* Failure Message Styles */
.popup-message-game.escape {
    font-size: 1.4rem;
    line-height: 2;
    color: #d1d5db;
}

.popup-message-game.escape strong {
    color: #ff6b6b;
    font-weight: bold;
    text-shadow: 0 0 10px #ff6b6b;
}

.popup-message-game.escape .highlight {
    color: #f44336;
    font-size: 1.5rem;
    text-shadow: 0 0 15px #f44336, 0 0 25px #f44336;
}

/* Try Again Button */
.restart-button-game.escape {
    color: #ffffff;
    background-color: #f44336;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease-in-out, background-color 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.restart-button-game.escape:hover {
    transform: scale(1.1);
    background-color: #d32f2f;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* Text Shake Animation for escape */
@keyframes textShake {
    0% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-3px);
    }
    50% {
        transform: translateX(3px);
    }
    75% {
        transform: translateX(-3px);
    }
    100% {
        transform: translateX(0);
    }
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.restart-button-game.team-full {
    padding: 15px 25px;
    font-size: 1.2rem;
}

.button-container-for-center {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

/* Optional: Add some padding around the button for aesthetics */
.button-container-for-center button {
    margin: 0 auto;
}