@import url('css/leaderboard.css');

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    /*padding-top: 1.1rem;*/
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.auth-container {
    width: 300px;
    margin: 50px auto;
    padding: 20px;
    border-radius: 10px;
    background-color: #1e1e2f;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

    .auth-container h2 {
        text-align: center;
        margin-bottom: 20px;
    }

.form-group {
    margin-bottom: 15px;
}

.form-control {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.btn-primary {
    background-color: #4CAF50;
    border: none;
    padding: 10px;
    width: 100%;
    border-radius: 5px;
    color: white;
    font-size: 16px;
}

    .btn-primary:hover {
        background-color: #45a049;
    }

.btn-secondary {
    background-color: #f44336;
    color: white;
    padding: 10px;
    display: block;
    text-align: center;
    border-radius: 5px;
    text-decoration: none;
    margin-top: 20px;
}

body.game-style {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center !important;    
    align-items: flex-start !important;
    height: 100vh;
    margin: 0;
    background-color: #1e293b; /* Dark blue background */
}

    /* Override du body.game-style pour la page game grid */
    body.game-style:has(.game-container) {
        align-items: center !important;
    }

/* Gem Grid + Cells */
.game-board {
    display: grid;
    gap: 10px;
    background-color: #0f172a; /* Slightly darker background */
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

.cell {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #94a3b8; /* Neutral color */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.3s ease;
}

.cell-taken {
    background: radial-gradient(circle at 30% 30%, #dcdcdc, #8b8b8b);
    border: 4px solid #666;
    position: relative;
    box-shadow: inset -4px -4px 10px rgba(0, 0, 0, 0.3), inset 4px 4px 10px rgba(255, 255, 255, 0.3), 0 4px 6px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease-in-out;
}

    .cell-taken::before, .cell-taken::after {
        content: '';
        position: absolute;
        width: 5px;
        height: 5px;
        background: #333;
        border-radius: 50%;
        box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.5);
    }

    .cell-taken::before {
        top: 30%;
        left: 30%;
    }

    .cell-taken::after {
        bottom: 30%;
        right: 30%;
    }


.cell-available {
    background-color: #4f5b6d; /* Light gray */
}

    .cell-available:hover {
        transform: scale(1.1);
        background-color: #3f4856; /* Slightly darker gray */
    }

.cell-disabled {
    background-color: #64748b; /* Greyed-out color */
    cursor: not-allowed;
}

    .cell-disabled:hover {
        transform: none;
    }

.cell-state-OwnedByPlayer {
    background: radial-gradient(circle at 30% 30%, #7dd3fc, #0ea5e9) !important;
    border-color: #0284c7;
}

.cell-state-OwnedByAi {
    background: radial-gradient(circle at 30% 30%, #86efac, #22c55e) !important;
    border-color: #16a34a;
}

.cell-winning {
    background-color: #f59e0b !important;
    animation: glow 1s infinite alternate;
}

.cell-state-Empty {
    position: relative;
    background-color: #1e293b; /* Fond sombre pour les cases vides */
    border-radius: 50%;
    border-radius: 30%;
    overflow: hidden;
}

    /* Superposition de la patch en tissu */
    .cell-state-Empty::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 135%;
        height: 100%;
        background-image: url('/_content/PwarkGame.BlazorLibrary/images/patch2.png');
        background-size: cover; /* L'image s'adapte à la taille de la case */
        background-repeat: no-repeat;
        background-position: center;
        overflow: visible;
        opacity: 0.9; /* Laisse entrevoir un peu de la case en dessous */
        z-index: 2; /* S'assure que l'image est bien au-dessus de la case */
    }

.cell {
    position: relative;
    z-index: 1;
}

.cell-state-ChangeOnContact {
    background-color: #334155; /* Gris neutre pour montrer l'inactivité */
    border: 5px dashed #475569; /* Bordure en pointillés pour indiquer qu'elle est bloquée */
    opacity: 0.6; /* Légère transparence pour la rendre moins visible */
}

/* Dernier contact avec le joueur */
.cell-state-ChangeOnContact_Ai {
    background-color: rgba(34, 197, 94, 0.5); /* Vert transparent pour correspondre au joueur */
    border: 2px solid #22c55e; /* Bordure verte pour accentuer l'état */
    opacity: 0.8;
    position: relative;
}

    .cell-state-ChangeOnContact_Ai::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 60%;
        height: 60%;
        border-radius: 50%;
        background-color: #22c55e; /* Cercle interne pour indiquer le dernier contact */
        opacity: 0.4;
    }

/* Dernier contact avec l'IA */
.cell-state-ChangeOnContact_Player {
    background-color: rgba(14, 165, 233, 0.5); /* Bleu transparent pour l'IA */
    border: 2px solid #0ea5e9; /* Bordure bleue */
    opacity: 0.8;
    position: relative;
}

    .cell-state-ChangeOnContact_Player::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 60%;
        height: 60%;
        border-radius: 50%;
        background-color: #0ea5e9; /* Cercle interne pour indiquer le dernier contact IA */
        opacity: 0.4;
    }

@keyframes glow {
    from {
        box-shadow: 0 0 10px yellow;
    }

    to {
        box-shadow: 0 0 20px orange;
    }
}

@keyframes dropIn {
    from {
        transform: translateY(-100px) scale(0.5);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.cell.player-1, .cell.player-2 {
    animation: dropIn 0.3s ease-out;
}

/* 🎯 Dernière cellule jouée - Effet de mise en évidence */
.cell-last-played-position {
    position: relative;
    border: 3px solid #a855f7 !important; /* Violet Fluorescent */
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.8);
    animation: lastMoveGlow 1.2s infinite alternate ease-in-out;
}

/* 🔄 Animation pour une lueur pulsante */
@keyframes lastMoveGlow {
    0% {
        box-shadow: 0 0 12px rgba(168, 85, 247, 0.8);
    }

    100% {
        box-shadow: 0 0 20px rgba(168, 85, 247, 1);
    }
}


.-cell-last-played-position.cell-state-OwnedByPlayer {
    position: relative;
    animation: lastMoveGlowBlue 1s infinite alternate ease-in-out;
    border: 3px solid #3b82f6 !important; /* Bleu vif */
    box-shadow: 0 0 10px rgba(250, 204, 21, 0.8);
}

/* 🔄 Effet d’animation pour un léger scintillement */
@keyframes lastMoveGlowBlue {
    0% {
        box-shadow: 0 0 12px rgba(59, 130, 246, 0.8);
    }

    100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 1);
    }
}

.-cell-last-played-position.cell-state-OwnedByAi {
    position: relative;
    border: 3px solid #22c55e !important; /* Vert Néon */
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.8);
    animation: lastMoveGlowGreen 1.2s infinite alternate ease-in-out;
}

/* 🔄 Animation pour une lueur pulsante */
@keyframes lastMoveGlowGreen {
    0% {
        box-shadow: 0 0 12px rgba(34, 197, 94, 0.8);
    }

    100% {
        box-shadow: 0 0 20px rgba(34, 197, 94, 1);
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Ajoute une transparence */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background-color: #1e293b; /* Fond sombre pour s'harmoniser avec le jeu */
    color: #e2e8f0; /* Texte clair pour contraste */
    padding: 20px 40px;
    border: 2px solid #22c55e; /* Bordure verte lumineuse */
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3); /* Effet lumineux */
    margin: 30px auto;
    max-width: 500px;
    width: 90%;
    animation: fadeInModal 0.3s ease-out;
}

/* Bouton de fermeture amélioré */
.btn-close {
    background-color: #ef4444;
    color: white;
    padding: 10px 15px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    position: absolute;
    top :0px;
    right: 10px;
}


    .btn-close:hover {
        background-color: #dc2626;
        transform: translateY(-2px);
    }

/* Animation d'apparition de la modale */
@keyframes fadeInModal {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.victory-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Ajoute une transparence */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.victory-message {
    background-color: rgba(34, 197, 94, 0.1); /* Vert doux translucide */
    color: #e2e8f0; /* Texte clair */
    padding: 20px 40px;
    border: 2px solid #22c55e; /* Bordure verte lumineuse */
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4); /* Effet lumineux */
    animation: pulseGlow 2s infinite;
    margin: 30px auto;
    max-width: 400px;
}

    .victory-message h1 {
        font-size: 2rem;
        margin-bottom: 20px;
        color: #22c55e;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }

.replay-button {
    background-color: #22c55e;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(34, 197, 94, 0.4);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

    .replay-button:hover {
        background-color: #16a34a;
        transform: translateY(-2px);
    }

    .replay-button:active {
        background-color: #15803d;
        transform: scale(0.98);
    }

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
    }

    50% {
        box-shadow: 0 0 20px rgba(34, 197, 94, 0.8);
    }

    100% {
        box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
    }
}

/* Ajustement de la grille pour les petits écrans */
@media screen and (max-width: 768px) {
    .game-board {
        gap: 5px;
        padding: 10px;
    }

    .cell {
        width: 50px;
        height: 50px;
    }

    .cell-taken {
        border-width: 2px;
    }

    .cell-state-Empty::before {
        width: 120%;
    }
}

@media screen and (max-width: 480px) {
    .game-container {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .game-board {
        order: 1;
        
        gap: 3px !important;
        padding: 8px !important;
        padding: 8px !important;
    }

    .cell {
        width: 40px;
        height: 40px;
    }

    .cell-taken::before, .cell-taken::after {
        width: 7px;
        height: 7px;
    }

    .players-container {
        order: 2; /* Place les joueurs sous la grille */
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        align-items: normal;
        width: 100%;
        max-width: 100%;
        gap: 10px;
        margin-top: 10px;
    }

    .player-info {
        flex: 1;
        max-width: 45%;
        text-align: center;
    }
}

/* Réorganisation des informations des joueurs */
@media screen and (max-width: 768px) {
    .player-info-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-bottom: 10px;
    }

    .player-info {
        text-align: center;
        margin-bottom: 5px;
    }
}

/* Ajustement du message de victoire */
@media screen and (max-width: 480px) {
    .victory-message {
        max-width: 87%;
        font-size: 1rem;
        padding: 15px;
        margin-left: 5px;
    }

    .victory-message h1 {
        font-size: 1.5rem;
    }

    .replay-button {
        padding: 8px 16px;
        font-size: 14px;
    }
}

/* Ajustement général du layout */
@media screen and (max-width: 768px) {
    body.game-style {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }
}
