/* Globval layout using Grid CSS */
.grid-wrapper {
    display: grid;
    grid-template-areas:
        "header header"
        "aside main"
        "footer footer";
    grid-template-columns: min-content 1fr;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    background-color: var(--grid-wrapper-bg);
}

/* HEADER */
.logo {
    display: flex;
    align-items: center;
    font-family: Fugaz One;
    font-size: 50px;
    cursor: pointer;
    height: 100%;
    margin-left: 20px;
    width: 300px;
}

.page-index {
    text-align: center;
    justify-content: center;
    align-self: center;
    font-size: 25;
    margin-left: 85px;
    opacity: 80%;
}

.left-account-section {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
    margin-right: 20px;
    width: 300px;
}

.left-account-section .user-profile {
    display: flex;
    padding: 10px;
    justify-content: flex-start;
    width: auto;
    align-items: center;
    cursor: pointer;
    overflow: hidden;
}

.left-account-section .user-profile img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}


/* SideBar */
.sidebar-links {
    list-style: none;
    width: 50px;
    padding: 0;
    overflow-x: hidden;
    transition: all 0.4s ease;
}

aside:hover .sidebar-links {
    transition: all 0.4s ease;
    width: 170px;
}

.sidebar-links h4 {
    margin: 15px 0 5px;
    font-size: 1.2em;
    opacity: 0;
    width: auto;
    white-space: nowrap;
}

aside:hover .sidebar-links h4 {
    transition: all 0.4s ease;
    opacity: 1;
    width: auto;
    white-space: nowrap;
}

.sidebar-links li {
    margin: 10px 0;
}

.sidebar-links a {
    text-decoration: none;
    color: #000;
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.sidebar-links li a {

    display: flex;
    align-items: center;
    gap: 0 20px;
    padding: 15px 10px;
    white-space: nowrap;
    text-decoration: none;
    font-weight: 500;
}

.sidebar-links li a:hover {
    border-radius: 10px;
}


/* Main cards */
.main-grid {
    display: grid;
    grid-template-columns: repeat (4, 1fr);
    grid-template-rows: auto 1fr;
    gap: 10px;
    padding: 20px;
    margin-top: 100px;
}

#main-content,
#settings-section {
    display: grid;
    grid-template-columns: repeat (4, 1fr);
    gap: 10px;
    padding: 20px;
}

.gameMode {
    grid-column: span 4;
    border-radius: 5px;
    text-align: left;
    margin: 0;
}

.gameMode h3 {
    margin-bottom:  10px;
    margin-left: 25px;
    text-align: left;
    font-size: 45px;
    font-weight: 500;
}

.flex-container {
    display: flex;
    flex-direction: row;
    grid-column: span 4;
    gap: 20px;
    padding: 20px;
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex: 1 1 300px;
    max-height: 400px;
    overflow: hidden;
}

.centeredTextonImage {
    position: absolute;
    font-family: "Pixelify Sans", serif;
    z-index: 1;
    font-size: 50px;
    font-weight: 600;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.glow-on-hover {
    position: relative;
    z-index: 2;
    border: none;
    cursor: pointer;
    font-family: 'Alata', serif;
    font-size: 30px;
    text-align: center;
    color: var(--text-color);
    border-radius: 5px;
}


#localGameBtn,
#onlineGameBtn {
    position: absolute;
    z-index: 1;
    width: 220px;
    height: 50px;
    top: 80%;
}

.lottie-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.65;
    pointer-events: none;
    overflow: hidden;
    object-fit: cover;
}

/* Dark overlay for cards */
.lottie-card-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* Black overlay with 40% opacity */
    z-index: 1;
    pointer-events: none;
}

#muteButton {
    position: relative;
}

.tooltip-text {
    display: none;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    z-index: 10;
    opacity: 0.9;
    font-family: Poppins;
    pointer-events: none;
}

/* Add the arrow */
.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%; /* Position at the bottom of the tooltip box */
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}
/* Show tooltip only when button is hovered AND muted */
#muteButton:hover .tooltip-text,
#muteButton:focus .tooltip-text {
    display: block;
}


/* glowy button */
/* https://dev.to/webdeasy/top-20-css-buttons-animations-f41 */
.glow-on-hover:before {
    content: '';
    background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
    position: absolute;
    top: -2px;
    left: -2px;
    background-size: 400%;
    z-index: -1;
    filter: blur(5px);
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    animation: glowing 20s linear infinite;
    opacity: 0;
    transition: opacity .3s ease-in-out;
    border-radius: 5px;
}

.glow-on-hover:active {
    color: #000
}

.glow-on-hover:active:after {
    background: transparent;
}

.glow-on-hover:hover:before {
    opacity: 1;
}

.glow-on-hover:after {
    z-index: -1;
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--secondary-color);
    left: 0;
    top: 0;
    border-radius: 5px;
}

@keyframes glowing {
    0% {
        background-position: 0 0;
    }

    50% {
        background-position: 400% 0;
    }

    100% {
        background-position: 0 0;
    }
}

/* toggle switch */
/* ------------ VARIABLES ------------ */
.btn-light {
    display: flex;
    align-items: center;
    position: relative;
    background-color: var(--dark-mode);
    width: var(--btn-size);
    height: 50%;
    border-radius: 5px;
    padding: 2px;
    margin: 5px;
    box-shadow: inset 0 8px 60px var(--light-shadow),
        inset 0 8px 8px var(--light-shadow),
        inset 0 -4px 4px var(--light-shadow);
    cursor: pointer;
}

.btn:hover {
    background-color: var(--dark-bg-color);
}

.btn__indicator {
    background-color: var( --light-color);
    max-width: var(--indicator-size);
    max-height: var(--indicator-size);
    border-radius: 5px;
    position: relative;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .2);
    transition: transform .3s ease;
}

.btn__icon-container {
    max-width: 100%;
    max-height: 100%;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn__icon {
    color: var(--light-icon-color);
    font-size: 2rem;
}

/* -------------- ANIMATION ------------ */
.btn__icon.animated {
    animation: spin 0.5s;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* -------------- DARKMODE -------------- */
body.perso.darkmode {
    background-color: var(--dark-bg-color);
    color: var(--text-color);
}

.darkmode .btn:hover {
    color: #000;
    background-color: var(--background-color);
}

.darkmode .sidebar-links a {
    color: var(--text-color);
}

.darkmode .btn-light {
    box-shadow: inset 0 8px 60px var(--dark-shadow),
    inset 8px 0 8px var(--dark-shadow),
    inset 0 -4px 4px var(--dark-shadow);
}

.darkmode .btn__indicator {
    transform: translateX(var(--indicator-size));
    background-color: #171719;
    box-shadow: 0 8px 40px var(--dark-shadow);
}

.darkmode .btn__icon {
    color: var(--dark-icon-color);
}

.darkmode .btn-light {
    display: flex;
    align-items: center;
    position: relative;
    background-color: var(--background-color);
    width: var(--btn-size);
    height: 50%;
    border-radius: 5px;
    padding: 2px;
    margin: 5px;
    box-shadow: inset 0 8px 60px var(--light-shadow),
        inset 0 8px 8px var(--light-shadow),
        inset 0 -4px 4px var(--light-shadow);
    cursor: pointer;
}

/* -------------- RESPONSIVE DESIGN ------------ */
@media (max-width: 600px) {
    :root {
        --btn-size: 50px;
        --indicator-size: 5em;
    }

    .btn__icon {
        font-size: 1.5rem;
    }
}

.sidebar-links li a.active {
    border-left: 3px solid #F75A6A;
}