/* Fonts */
/* Google fonts import */
@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap");

/* Pokemon Font by FontGet replica of the Pokemon Logo's custom typeface. 
   Accessed via fontbolt.com */
@font-face {
    font-family: "pokemon-logo-replica";
    src: url(../fonts/Pokemon.ttf);
}

/* Pokemon Font by Jackster Productions replica font of the original Pokemon
   Games for the Game Boy. 
   Accessed via fontspace.com */
@font-face {
    font-family: "pokemon-game-boy-replica";
    src: url(../fonts/PokemonGb-RAeo.ttf);
}


/* CSS Variables */
:root {
    --primary-font: "pokemon-logo-replica", Arial, sans-serif;
    --secondary-font: "pokemon-game-boy-replica", "Courier New", monospace;
    --general-font: "Roboto", Verdana, sans-serif;
    /* Pokemon Go brand color codes by brandcolorcode.com */
    --Yellow: #FFCB08;
    --Light-Blue: #3561AD;
    --Blue: #0B4DA2;
    --Dark-Blue: #07224E;
    --White: #FFFFFF;
    --Grey: #BCBDC0;
    --Red: #E21C25;
    /* Pokemon Unite */
    --Light-Yellow: #FFF3BF;
    /* Results Colors */
    --Winner-Green-Background: #28a745;
    --Winner-Green-Border: #1e7e34;
    /* Loser Red Background is --Red #E21C25 which is a Pokemon Go brand color */
    --Loser-Red-Border: #c82333;
    /* Draw Grey Background is --Grey #BCBDC0 which is a Pokemon Go brand color */
    --Draw-Grey-Border: #6c757d;
}

/* Global Styling */

/* Pokemon Logo Styling */
#game-title,
#homepage-header,
#readytoplay-header {
    font-family: var(--primary-font);
    color: var(--Yellow);
    /* Used fluentsupport.com for outline font coloring */
    -webkit-text-stroke: 1.2px var(--Blue);
}

/* Pokemon title logo */
#homepage-header,
#readytoplay-header {
    font-size: 2.5rem;
    margin-top: 250px;
    text-align: center;
    z-index: 2;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

main {
    padding-bottom: 10px;
}

/* Buttons */
/* General Button Styling */
#how-to-play,
#button-start-game,
#button-hell-yes,
#button-hell-no,
#start-button,
#next-reset-button,
#return-homebtn {
    display: inline-block;
    font-family: var(--secondary-font);
    background-color: var(--Yellow);
    color: var(--Blue);
    border: 2px solid var(--Blue);
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.2rem;
    padding: 25px 40px;
    margin: 20px;
    transition: transform 0.2s ease;
    width: 300px;
    height: 80px;
    box-sizing: border-box;
}

#how-to-play:hover,
#button-start-game:hover,
#button-hell-yes:hover,
#button-hell-no:hover,
#start-button:hover,
#next-reset-button:hover,
#return-homebtn:hover,
#continueGameBtn:hover,
#endGameBtn:hover {
    transform: scale(1.1);
    background-color: var(--Light-Yellow);
    cursor: pointer;
}

/* Button Styling */
#how-to-play,
#button-start-game,
#button-hell-yes,
#button-hell-no {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

#button-container-home-page,
#button-container-ready-to-play {
    align-items: center;
    display: flex;
    justify-content: center;
    flex-direction: column;
    z-index: 2;
    margin-top: 70px;
}

/* Home Page Background Image */
#home-page {
    /* Image of Pokemon Cards by Mick Haupt. Acessed via unsplash.com */
    background: url(../images/homepage-background-image.jpg) no-repeat center fixed;
    background-size: cover;
    min-height: 100vh;
}

/* Ready to play Background Image */
#ready-to-play-page {
    /* Image of Pokemon Cards by Giorgio Trovato. Acessed via unsplash.com */
    background: url(../images/readytoplay-image.jpg) no-repeat center fixed;
    background-size: cover;
    min-height: 100vh;
}

/* Black Semi-Transparent overlay homepage and ready to play page*/
#home-page,
#ready-to-play-page {
    position: relative;
    width: 100%;
    min-height: 100vh;
}

/* Ensures the content stays above the overlay */
#home-page>*,
#ready-to-play-page>* {
    position: relative;
    z-index: 2;
}

#home-page::before,
#ready-to-play-page::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2;
    /* Places the overlay below the content */
    pointer-events: none;
    /* Allows the mouse and buttons to work */
}


/* W3 Schools Modal Example */
/* Modal background */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    /* Stay in Place */
    z-index: 1000;
    /* Sit on top */
    /* Centering the modal CSS-TRICKS Chris Coyier */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    padding: 20px;
}

/* Modal Content */
.modal-content {
    font-family: var(--general-font);
    background-color: var(--White);
    padding: 50px 30px 30px;
    border: 4px solid var(--Yellow);
    border-radius: 8px;
    width: 800px;
    max-width: 90%;
    max-height: 85vh;
    margin: auto;
    text-align: left;
    position: relative;
    overflow-y: auto;
    /* Enables Scrolling */
}

/* W3schools Custom Scrollbar */

/* Width */
.modal-content::-webkit-scrollbar {
    width: 14px;
}

/* Track */
.modal-content::-webkit-scrollbar-track {
    background: var(--Dark-Blue);
    border-radius: 8px;
}

/* Handle */
.modal-content::-webkit-scrollbar-thumb {
    background-color: var(--Yellow);
    border-radius: 8px;
    border: 3px solid var(--Dark-Blue);
    background-clip: padding-box;
}

/* Modal Headings */
.modal-content h3 {
    font-family: var(--secondary-font);
    color: var(--Blue);
    font-size: 2rem;
    margin: 0 0 15px 0;
    text-align: center;
}

.modal-content h4 {
    font-family: var(--general-font);
    color: var(--Dark-Blue);
    font-size: 1.5rem;
    margin: 20px 0 10px 0;
    font-weight: bolder;
}

.modal-content h5 {
    font-family: var(--general-font);
    color: var(--Dark-Blue);
    font-size: 1.2rem;
    margin: 15px 0 10px 0;
}

.modal-content p,
ol,
ul {
    font-family: var(--general-font);
    color: var(--Dark-Blue);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

/* Modal Close Button */
.close {
    position: absolute;
    top: 5px;
    right: 15px;
    color: var(--Blue);
    font-size: 1.75rem;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: var(--Blue);
    text-decoration: none;
    cursor: pointer;
}


/* game.html */
/* Header Styling */
#game-header {
    background-color: var(--Light-Yellow);
    padding: 10px;
}

#game-header,
.col-12 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#home-button,
#dark-mode-toggle,
#help {
    background-color: transparent;
    border: none;
    color: var(--Light-Blue);
    font-size: 2rem;
}

#home-button:hover,
#dark-mode-toggle:hover,
#help:hover {
    color: var(--Dark-Blue);
    cursor: pointer;
    transform: scale(1.1);
}

#game-title {
    font-size: 3.5rem;
    margin: 0;
    flex: 1;
    text-align: center;
    text-decoration: none;

}

.right-buttons {
    display: flex;
    gap: 10px;
}

/* Game Container */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.cards-container .row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
}

.cards-container .col-12.col-md-6.col-lg-5 {
    flex: 0 0 auto;
    width: auto;
}

/* Card Section */
.card-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    text-align: center;
    margin-bottom: 2rem;
}

/* Pokemon Card Styling */
.card {
    height: 500px;
    width: 300px;
    position: relative;
    margin-bottom: 20px;
    border: 20px solid var(--Yellow);
    border-radius: 8px;
    background-color: var(--Light-Blue);
    padding: 10px;
    perspective: 1000px;
    /* Enables 3D effect */
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    transform: rotateY(0deg);
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-front {
    background-color: var(--White);
    z-index: 2;
    transform: rotateY(180deg);
}

.card-back {
    background: linear-gradient(45deg, var(--Light-Blue), var(--Dark-Blue));
    transform: rotateY(0deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.card-back-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 20px;
}

.card-back-text {
    font-family: var(--secondary-font);
    font-size: 1.2rem;
    color: var(--White);
    font-weight: bold;
    text-align: center;
    margin-top: 10px;
}

.pokemon-image {
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pokemon-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pokemon-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 2px;
    gap: 5px;
    overflow-y: auto;
}

.pokemon-name {
    font-family: var(--general-font);
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--Dark-Blue);
    margin: 8px 0;
    text-align: center;
}

.stat-btn {
    font-family: var(--general-font);
    color: var(--Blue);
    font-size: 0.8rem;
    padding: 5px 8px;
    margin: 2px 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 2px solid var(--Blue);
    border-radius: 6px;
    background-color: var(--Yellow);
    cursor: pointer;
    transition: all 0.2s ease;
}

.stat-btn:hover {
    background-color: var(--Light-Yellow);
}

.stat-btn.selected {
    background-color: var(--Yellow);
    color: var(--Dark-Blue);
    border-color: var(--Dark-Blue);
}

.stat-btn.winner {
    background-color: var(--Winner-Green-Background);
    color: var(--White);
    border-color: var(--Winner-Green-Border);
}

.stat-btn.loser {
    background-color: var(--Red);
    color: var(--White);
    border-color: var(--Loser-Red-Border);
}

.stat-btn.draw {
    background-color: var(--Grey);
    color: var(--White);
    border-color: var(--Draw-Grey-Border);
}

.card-section,
h3 {
    font-family: var(--general-font);
    font-size: 1.8rem;
    color: var(--Dark-Blue);
    margin: 15px 0 10px 0;
    text-align: center;
}

.card-section .score {
    font-family: var(--general-font);
    font-size: 1.4rem;
    color: var(--Blue);
    font-weight: bold;
    text-align: center;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 20px;
}

/* Footer */
#game-footer {
    background-color: var(--Light-Yellow);
    padding: 30px;
    text-align: center;
}

.social-media i {
    color: var(--Red);
    font-size: 2rem;
    padding: 1rem 3rem;
}

.social-media a {
    background: none;
    border: none;
    text-decoration: none;
}

#twitch-button {
    background: transparent;
    border: none;
}


/* 5 Round Popup Styles */
#gameResultsTitle {
    font-family: var(--secondary-font);
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-align: center;
}

#gameResultsTitle.winner {
    color: var(--Winner-Green-Background);
}

#gameResultsTitle.loser {
    color: var(--Red);
}

#gameResultsTitle.draw {
    color: var(--Grey);
}

#game-result-text {
    font-family: var(--general-font);
    color: var(--Dark-Blue);
    margin-bottom: 20px;
    text-align: center;
    font-size: 2rem;
}

.game-results-buttons {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

#continueGameBtn,
#endGameBtn {
    display: inline-block;
    font-family: var(--secondary-font);
    background-color: var(--Yellow);
    color: var(--Blue);
    border: 2px solid var(--Blue);
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.2rem;
    padding: 20px 40px;
    margin: 10px;
    transition: transform 0.2s ease;
    width: 250px;
    height: 60px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
    line-height: 1.2;
}

/* 404.html */
#error-page {
    background-color: var(--Dark-Blue);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.error-container {
    background-color: var(--White);
    border-radius: 25px;
    padding: 30px;
    max-width: 1000px;
    width: 100%;
    margin: 20px;
    box-sizing: border-box
}

#error-code {
    font-family: var(--secondary-font);
    font-size: 4.4rem;
    text-align: center;
    color: var(--Blue);
    margin: 10px 0;
}

.error-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-top: 10px;
    text-align: center;
    flex-wrap: wrap;
}

.error-image {
    flex: 0 0 auto;
    max-width: 100%;
}

.error-image img {
    max-width: 400px;
    width: 100%;
    height: auto;
}

.error-text {
    flex: 1;
}

#error-message {
    font-family: var(--general-font);
    font-size: 1.8rem;
    margin: 10px 0;
    color: var(--Dark-Blue);

}

.error-text p {
    font-family: var(--general-font);
    font-size: 1.2rem;
    color: var(--Dark-Blue);
}



/* Media Queries */

/* For Extra small devices (phones, 600px and down) */
@media only screen and (max-width: 600px) {

    /* Pokemon style title */
    #homepage-header {
        font-size: 1.5rem;
        padding: 15px;
        -webkit-text-stroke: 0.8px var(--Blue);
    }

    /* Buttons */
    #button-start-game,
    #how-to-play,
    #button-hell-yes,
    #button-hell-no,
    #start-button,
    #next-reset-button {
        font-size: 1rem;
        padding: 10px;
        width: 200px;
        height: 60px;
    }

    /* Button container */
    #button-container-home-page {
        margin-top: 50px;
    }

    /* Modal */
    .modal {
        padding: 5px;
    }

    .modal-content {
        padding: 35px 10px 10px;
        max-height: 90vh;
        width: 90%;
        border-width: 4px;
        font-size: 1rem;
    }

    .modal-content h3 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .modal-content h4 {
        font-size: 1.2rem;
        margin: 15px 0 8px 0;
    }

    .modal-content h5 {
        font-size: 1rem;
        margin: 10px 0 8px 0;
    }

    .modal-content p,
    ol,
    ul {
        font-size: 0.95rem;
        margin-left: 10px;
        padding-left: 8px;
    }

    /* Game Results Modal */
    #gameResultsModal .modal-content {
        padding: 35px 20px 25px;
        max-height: 90vh;
        width: 95%;
    }

    #gameResultsTitle {
        font-size: 1.75rem;
        margin-bottom: 12px;
    }

    #game-result-text {
        font-size: 1.3rem;
        margin-bottom: 12px;
        padding: 0 8px;
    }

    #game-result-text p {
        font-size: 1rem;
        margin: 10px 0;
    }

    /* Game Results Modal Buttons  */
    .game-results-buttons {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    #continueGameBtn,
    #endGameBtn {
        font-size: 1.2rem;
        padding: 10px 15px;
        width: 100%;
        max-width: 250px;
        height: auto;
        min-height: 60px;
        margin: 8px auto;
    }

    /* 404 Page */

    #error-page {
        padding: 10px;
        min-height: 100vh;
    }

    #error-container {
        padding: 20px 15px;
        margin: 10px;
    }


    #error-code {
        font-size: 3.1rem;
    }

    .error-content {
        flex-direction: column;
        gap: 20px;
    }

    .error-image {
        max-width: 300px;
    }

    .error-message {
        font-size: 1.5rem;
    }

    .error-text p {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    #return-homebtn {
        font-size: 1rem;
        padding: 10px 20px;
        margin-top: 15px;
        max-width: 250px;
        max-height: 100px;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

/* For Small to Medium Devices (601px - 768px)*/
@media only screen and (min-width:601px) and (max-width:768px) {

    /* Game Results Modal */
    #gameResultsModal .modal-content {
        padding: 25px 20px 20px;
        max-height: 85vh;
        width: 90%;
    }

    #gameResultsTitle {
        font-size: 2rem;
        margin-bottom: 12px;
    }

    #game-result-text {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }

    #game-result-text p {
        font-size: 1.1rem;
        margin: 8px 0;
    }

    /* Game Results Modal Buttons */
    .game-results-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }

    #continueGameBtn,
    #endGameBtn {
        font-size: 1.1rem;
        padding: 12px 20px;
        width: 180px;
        height: 50px;
    }

}

/* For Medium devices (Landscape tablets, 768px and up) */
@media only screen and (max-width: 768px) {

    /* Modal */
    .modal {
        padding: 10px;
    }

    .modal-content {
        padding: 40px 20px 20px;
        max-height: 90vh;
        width: 95%;
        margin: auto;
    }

    .modal-content h3 {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }

    .modal-content h4 {
        font-size: 1.4rem;
        margin: 18px 0 10px 0;
    }

    .modal-content h5 {
        font-size: 1.1rem;
        margin: 12px 0 8px 0;
    }

    .modal-content p,
    ol,
    ul {
        font-size: 1rem;
        margin-left: 10px;
        padding-left: 8px;
    }
}