@import url('https://fonts.googleapis.com/css2?family=Sixtyfour+Convergence&display=swap');

/********************************Index-Page************************/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

.page-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Make wrapper full height of the viewport */
    font-family: "Sixtyfour Convergence", sans-serif;
    justify-content: center;
    align-items: center;
}

.background-image {
    background-image: url("../images/pokemon-bg-1.jpg");
    background-size: cover; 
    max-width: 100%;
}

header, main {
    flex: 1; /* Fills the available space, pushing the footer down */
    }


.page-layout {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.pokemon-header {
    font-family: "Sixtyfour Convergence", sans-serif;
    font-size: 1.5rem;
    padding: 20px;
    text-align: center;
    background-color: #555;
    border: 2px solid black;
    border-radius: 10px;
    margin-top: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: #fefefe;
}

/********************************Social Media Icons************************/

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
      transform: translateY(0);
    }
    40% {
      transform: translateY(-10px);
    }
    60% {
      transform: translateY(-5px);
    }
  }

  .footer-icon img:hover {
    animation: bounce 0.6s ease;
  }
  
/********************************Model-Box************************/

.modal {
    display: none; 
    position: fixed; 
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 2px solid black;
    width: 40%; 
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 10px;
    box-sizing: unset;
    color: #555;
}
  
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}
  
.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#emailForm {
    display: flex;
    flex-direction: column;
}

#emailForm > label, input {
    margin: 5px;
}

#emailForm > button {
    margin: 10px;
    width: 50%;
}

/********************************Buttons************************/

.main-button a {
    text-decoration: none;
}

.main-button {
    margin: 20px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    color: #fff;
    background-color: #ff0000;
    border: 2px solid black;
    border-radius: 10px;
    box-shadow: 5px 5px 0px #000;
    transition: all 0.3s ease;
    padding: 10px;
}

.main-button:hover {
    background-color: #fff;
    color: #ff0000;
    border: 2px solid #ff0000;
    box-shadow: 5px 5px 0px #ff0000;
    cursor: pointer;
}

.main-button:active {
    background-color: #ffde00;
    box-shadow: none;
    transform: translateY(4px);
}

.button-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
}

.game-nav-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    list-style-type: none;
    padding: 0;
}

.game-option-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    list-style-type: none;
}

/********************************Page Header************************/

.page-header {
    font-size: 2rem;
    font-weight: 800;
    padding: 20px;
    text-align: center;
    background-color: #555;
    margin-left: 200px;
    margin-right: 200px;
    border: 2px solid black;
    border-radius: 10px;
}

/********************************Footer************************/

.margin-footer {
    background-color: #555; 
    color: #fff; 
    border: 2px solid black;
    border-radius: 10px;
    font-family: "Sixtyfour Convergence", sans-serif;
    margin-top: auto;
    padding: 10px 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    text-align: center;
    bottom: 0;
}


#footer-container {
    display: flex; 
    justify-content: space-between;
    align-content: center; 
    flex-wrap: wrap;
}

#footer-links ul {
    display: flex;
    list-style: none; /* Remove default bullets */
    justify-content: center;
    padding: 0;
}

#footer-links > li {
    gap: 10px; /* Add space between list items */
    padding: 0; /* Remove default padding of the <ul> */
    margin: 0; /* Remove default margin of the <ul> */
}

.footer-box {
    flex: 1; 
    min-width: 200px;
    font-size: 1em;
    text-align: center;
}

.footer-box h3 {
    padding: 10px;
}

#footer-links > a,
#footer > p > a {
    color: #fff; 
    margin-right: 10px;
}

#openEmailModal {
    text-decoration: none;
    color: #fefefe;
}

/********************************Memory Card Game************************/

#game-board {
    height: auto;
    width: 90%;
    max-width: 400px; /* Limit the width on larger screens */
    margin: 20px auto;
    background-color: #ff0000;
    border: 10px solid black;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    box-sizing: unset;
}

.card {
    height: 128px;
    width: 90px;
    margin: 2.5px;
    perspective: 1000px; /* Creates 3D perspective */
    position: relative;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: absolute;
    transition: transform 0.3s; /* Smooth flip transition */
    transform-style: preserve-3d; /* Preserves 3D space for flip */
}

.card.flipped .card-inner {
    transform: rotateY(180deg); /* Flip effect */
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden; /* Hides the back when flipping */
    background-size: cover;
    border-radius: 5px;
}

.card-front { 
    background-image: url('../images/back-card/pokemon-card-back-1.avif'); /* Back of the card */ 
    background-color: #333; /* Fallback color */ 
} 

.card-back { 
    background-size: cover; 
    backface-visibility: hidden; 
    transform: rotateY(180deg); /* Position for the front face */
}


.time-area {
    margin: 5px;
    background-color: #fff;
    padding: 5px;
    border: 2px solid black;
    border-radius: 10px;
    color: #555;
}

/********************************Pokemon Battleground************************/

/********************************Battle Arena************************/
.selection {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
}

.pokemon-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
    background-color: #fefefe;
    border: 1px solid black;
    border-radius: 10px;
    margin: 5px;
    padding: 5px;
    text-align: center;
    color: #555;
}

.pokemon-selection label {
    margin-bottom: 5px;
}

.pokemon-preview {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-top: 5px;
    display: none; /* Hidden by default */
}

.battle-arena {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
    background-color: hsl(0, 0%, 33%);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #ccc;
}

.pokemon-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 200px;
    margin: 10px;
}

.pokemon-box label {
    margin: 5px 0;
}

.pokemon-display {
    text-align: center;
}

.pokemon-display img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    margin-bottom: 10px;
}

.hp-bar-container {
    width: 100%;
    background-color: #ccc;
    border: 1px solid #999;
    border-radius: 5px;
    overflow: hidden;
}

.hp-bar {
    height: 20px;
    background-color: green;
    color: white;
    line-height: 20px;
    text-align: center;
    width: 100%;

}

.logs {
    width: 80%;
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
    border: 1px solid #ccc;
    padding: 10px;
    height: 200px;
    overflow-y: auto;
    padding: 20px;
    margin-bottom: 20px;
    margin-top: 20px;
    background-color: #555;
    border-radius: 10px;
}

button#battle-btn {
    padding: 10px 20px;
    font-size: 16px;
    margin-top: 20px;
}

/********************************Battleground Moves************************/

.moves-container {
    margin-top: 5px;
}

.move-button {
    background-color: #ffcc00;
    border: 2px solid #333;
    border-radius: 5px;
    color: #333;
    font-size: 14px;
    padding: 10px;
    cursor: pointer;
    margin: 5px;
    transition: transform 0.2s, background-color 0.2s;
    justify-content: center;
}

.move-button:hover {
    background-color: #ffaa00;
    transform: scale(1.05);
}

.move-button:disabled {
    background-color: #ddd;
    border-color: #999;
    color: #777;
    cursor: not-allowed;
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.move-button.animated {
    animation: slideIn 0.4s ease-in-out;
}

.pokeball-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-bottom: 10px;
    opacity: 0.7;
}

/********************************Media Queries - Responsiveness************************/

@media (max-width: 600px) {
    #index-pokemon-header {
        font-size: 1.2rem;
    }
    /* Battle Arena */
    .battle-arena {
        flex-direction: column;
        align-items: center;
    }
    .pokemon-box {
        width: 100%;
        max-width: 300px;
    }
    /* Footer */
    .margin-footer {
        margin: 5px;
    }
    .footer-box p {
        font-size: 1em;
    }
    .footer-box h3 h4 {
        font-size: 1.2em;
    }
    #footer p {
        font-size: 1em;
    }

    #help-title {
        font-size: 1em;
    }

    .modal-content > p {
        font-size: 0.8em
    }
}

@media (max-width: 500px) {
    #game-board {
        gap: 2px;
    }
    .card {
        height: 60px;
        width: 45px;
    }
}

@media (max-width: 400px) {
    #index-pokemon-header {
        font-size: 0.8rem;
    }
    #game-board {
        gap: 2px;
    }
    .card {
        height: 60px;
        width: 45px;
    }
    .page-header {
        font-size: 1.5em; /* Reduce header font size for small screens */
    }

    #timer,
    #best-time {
        font-size: 1em; /* Reduce the font size to better fit smaller screens */
    }
    /* Footer */
    .footer-box p {
        font-size: 0.6em;
    }
    .footer-box h3 h4 {
        font-size: 0.9em;
    }
    #footer p {
        font-size: 0.6em;
    }
    .margin-footer {
        margin: 5px;
    }

    #email-title{
        font-size: 1rem;
    }

    #emailForm > label, input {
        font-size: 0.7rem;
    }
}

@media (max-width: 300px) {
    #index-pokemon-header {
        font-size: 0.5rem;
    }
    #game-board {
        gap: 2px;
    }

    .card {
        height: 60px;
        width: 45px;
    }

    .page-header {
        font-size: 1.2em; 
    }

    #timer,
    #best-time {
        font-size: 0.9em;
    }

    .footer-box p {
        font-size: 0.5em;
    }
    .footer-box h3 h4 {
        font-size: 0.7em;
    }
    #footer p {
        font-size: 0.5em;
    }
    .margin-footer {
        margin: 5px;
    }

    /* Battle Arena */
    .pokemon-box {
        width: 150px;
        margin: 10px;
    }

    #user-pokemon-name {
        font-size: 16px;
    }

    #opponent-pokemon-name {
        font-size: 16px;
    }

    .move-button {
        padding: 5px;
        margin: 2px;
        font-size: 12px;
    }

}
