@import url('https://fonts.googleapis.com/css2?family=Familjen+Grotesk&family=Noto+Sans+Symbols:wght@300&display=swap');

/* Global styles*/
body {
    margin: 0;
    font-weight: 300;
    color: #581296 ;
    background-color: #E1E0E0;
    text-align: center;
    font-family: 'Familjen Grotesk', 'Noto Sans', sans-serif;

}

/* global selectors */
* {
    transition: 0.2s ease-in-out;
    user-select: none;
}

html {
    min-height: 100%;
    position: relative;

}

.align {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* header */
header {
    width: 100%;
    height: 70px;
    text-align: center;
    position: relative;
    background-color: #E1E0E0;
}

.head {
    position: relative;
    width: 100%;
}

.logo {
    float: left;
    width: 10%;
    max-width: 70px;
    
}

.heading {
    position: fixed;
    top: 6%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 17px;
    max-width: 330px;
}

/* Rules and Option Boxes */
.rules-box, .option-box {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 80%;
    transform: translate(-50%, -50%);
    background-color: #E1E0E0;
    border: 2px solid #000;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    padding: 20px;
    max-width: 400px;
    line-height: 1.5;
    text-align: center;
    border-radius: 5px;
    z-index: 1;
}

/* .option-box specific styles when visible */
.option-box.hide {
    opacity: 0;
    pointer-events: none;
    display: none;
}

/* Hidden initially */
.rules-box {
    display: none; 
}

/* Show when needed */
.rules-box.show {
    z-index: 3; /* Ensure it's on top of other content */
    display: block; 
}



/* Win Box */
.won-text-box {
    position: relative;
    width: 99%;
    margin: 0 auto;
    font-size: 14px;
    border-radius: 3px;
}


.option-box,
.won-text-box {
    background: #40ED9F;
    text-align: center;
    border:solid #581296;  
}


.btn-start,
.option-box button,
.won-text-box button {
    position: relative;
    font-weight: bold;
    padding: 7px;
    cursor: pointer;
    border-radius: 3px;
    background: #581296;
    color: #40ED9F;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.button-container {
    display: flex; /* Used flexbox for alignment */
    justify-content: space-between; /* Space between buttons */
    margin-top: 10px; /* Add some space above the buttons */
}

/* Style adjustments for buttons */
.btn-replay,
.btn-exit {
    flex: 1; /* Allow buttons to grow */
    margin: 0 8px; /* Add horizontal margin to prevent button overlap */
    padding: 2px; /* Increase padding for better click area */
}

.btn-start {
    margin: 0 auto;

}

.play-X {
    float: left;

}

.play-O {
    float: right; 

}



/* Game Container */
#game-container {
    top: 55%;
    left: 50%;
    width: 300px;
    max-width: 96%;
    max-height: 96%;
    text-align: center;
    position: absolute;
    transform: translate(-50%, -50%);
    background-color: #E1E0E0;
    border: 0;
    display: none;
}

/* Show game container */
#game-container.show {
    transform: translate(-50%, -50%) scale(1);
    display: block;
}

/* Game Details */
.details{
    position: relative;
    margin: 0 auto;
    display: flex;
}


.turns-container {
    position: relative; /* Set the position to relative for lining up the slider */
    width: 160px;
    height: 60px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two columns for X and O */
    grid-template-rows: 1fr; /* One row */
}

.turns-container h3 {
    margin: 0 auto;
    grid-column-start: 1;
    grid-column-end: 3;

}

.turns-container .turn {
    border: 1.5px solid #581296 ;
    font-size: 23px;
    font-weight: 300;
}

.turns-container .turn:nth-child(even) {
    border-right: none;
}

/* slider with a transition for smooth movement */
.slider {
    position: absolute; /* Set to absolute for correct positioning */
    transition: left 0.3s ease, right 0.3s ease; 
    top: 50%;
    width: 50%;
    margin: 0 auto;
    height: 100%;
    background-color: #40ED9F;
    z-index: -1;
}

.playing-area{
    position: relative;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

#boxContainer {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    height: auto;
    width: 100%;
    border: 1px solid;
    margin: 0 auto;
    aspect-ratio: 1; /* this is for square grid */
}
.cellBox {
    width: 96%;
    display: flex;
    font-size: 5rem;
    line-height: 75px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: 2px solid #581296;
    background-color: #40ED9F;
    aspect-ratio: 1; /* to make sure each cell remains square */
    transition: background-color 0.3s;
}

/* changes the color for the hover, winning and draw cells */
.cellBox:hover, 
.win-cell, 
.draw-cell{
    color: #40ED9F;
    background-color: #581296;
}





/* design my list to have a bullet disc */
ul{
    list-style: disc;;
    text-align: left;
}

/* Visibility */
.hide {
    display: none;
}

.show {
    display: block;
}

/* Media queries  */
@media (min-width: 768px) {
    #game-container {
        max-width: 50%;
        height: auto;
    }

    .rules-box, .option-box {
        width: 50%;
    }
}

@media (min-width: 1024px) {
    #game-container {
        max-width: 30%;
    }
}