
/* 
 * Font family: "Ubuntu Sans Mono", sans-serif 
 */

 /* Source for  CSS-Tricks Keyframes Guide: https://css-tricks.com/almanac/properties/a/animation/ 
    Custom Sliders: https://css-tricks.com/styling-cross-browser-compatible-range-inputs-css/*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none; /* Prevents text selection during gamneplay */
}

/* Set body to use crosshair cursor for aiming */
body {
    cursor: crosshair;
    font-family: "Ubuntu Sans Mono", sans-serif;
    background-color: #121212;
}

/* Main game contianer  that holds all game elements */
#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #ddbb25;
    background-size: cover;
    color: white;
}

/* Top bar with game title and stats */
#top-bar {
     display: flex;
    justify-content: space-between;
    align-items: center;
     padding: 10px 20px;
    background-color: rgba(0, 0, 0, 0.7);
    border-bottom: 3px solid #EEC23D;
     height: 10%;
    min-height: 60px;
}

/* Game title styling */
#game-title {
    font-size: 2.5em;
    color: #EEC23D;
    text-shadow: 2px 2px 0 #000;
}

/* Stats contianer  for score, timer, accuracy */
#stats {
    display: flex;
    gap: 20px;
}

/* Individual stat container styling */
#stats > div {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 8px 15px;
    border-radius: 5px;
    border: 2px solid #EEC23D;
}

/* Style for stat labels (SCORE, TIME, ACCURACY) */
.stat-label {
    font-weight: bold;
    margin-right: 5px;
}

/* Main game area where targets will appear */
#game-area {
    flex: 1;
    position: relative;
     margin: 20px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    background-color: r;
     background-size: cover;
    overflow: hidden;
     border-radius: 10px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Target styling - the clicckable elements that appear during gamneplay  */
.target {
    position: absolute;
  border-radius: 50%;
    background-image:  url("../img/bullseye.png");
     background-size: contain;
    cursor: pointer;
    transform: scale(0);
     animation: target-appear 0.3s forwards;
}


/* Got these from : https://css-tricks.com/almanac/properties/a/animation/  and we also learned as well.*/
/* Animation for targets appaering  */
@keyframes target-appear {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Styling for the points animation that appears when a target is hit */
.plus-one {
    position: absolute;
    font-size: 1.5em;
     font-weight: bold;
    color: #12ce34;
     text-shadow: 2px 2px 0 #000;
    animation: float-up 1s forwards;
    pointer-events: none; /* Prevent interaction with the animation */
     z-index: 100; /* Ensure it appears above targets */
}


/* Got these from : https://css-tricks.com/almanac/properties/a/animation/*/
/* Animation for the points floating up */
@keyframes float-up {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px);
    }
}

/* Upgrade section styling */
.upgrades {
    position: relative;
    display: flex;
    height: 15%;
    min-height: 100px;
    width: 100%;
    padding: 10px 20px;
    gap: 15px;
    background-color: rgba(0, 0, 0, 0.7);
    border-top: 3px solid #EEC23D;
}

/* Individual upgrade button styling */
.upgrade {
    font-family: "Ubuntu Sans Mono", sans-serif;
    display: flex;
    flex-direction: column;
     justify-content: center;
    align-items: center;
    position: relative;
     width: 100%;
    border: 3px solid #EEC23D;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
     padding: 10px;
    cursor: pointer;
     transition: all 0.2s;
    overflow: hidden;
}

/* Hover effect for upgrade buttons */
.upgrade:hover {
    background-color: rgba(238, 194, 61, 0.2);
     transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}

/* Upgrade labels styling */
.label {
    font-weight: bold;
    font-size: 1.2em;
    margin-bottom: 5px;
    position: relative;
    z-index: 2;
 }

/* Upgrade cost styling */
.cost {
    font-size: 0.9em;
    color: #FF9900;
    position: relative;
    z-index: 2;
 }

/* Upgrade level specifcation  styling */
.spec {
    font-size: 0.8em;
    color: #AAAAAA;
    position: relative;
    z-index: 2;
 }

/* Upgrade icons styling */
.upgrade-icon {
    position: absolute;
     width: 40px;
    height: 40px;
    right: 10px;
    top: 50%;
     transform: translateY(-50%);
    background-size: contain;
    background-repeat: no-repeat;
     background-position: center;
    opacity: 0.3;
    transition: opacity 0.3s;
}


/* Upgrade button hover effects inspired by Chris Clicker Game */

/* Upgrade icon hover effect */
.upgrade:hover .upgrade-icon {
    opacity: 1;
}

/* Specific icons for each upgrade */

#upgrade-one-icon {
    background-image: url("../img/up-arrow.png");
}

#upgrade-two-icon {
    background-image: url("../img/up-arrow.png");
}

#upgrade-three-icon {
    background-image: url("../img/up-arrow.png");
}

/* Score subtraction animation when purchasing upgrades */
.score-subtraction {
    font-family: "Ubuntu Sans Mono", sans-serif;
    color: #ff0000;
     font-size: 1.5em;
    position: absolute;
     opacity: 0;
    text-shadow: 1px 1px 0 #000;
    animation: fade-in-up 1s forwards;
    z-index: 10;
}

/* Score subtraction animation adapted from Chris Clicker Game */
/* Got these from : https://css-tricks.com/almanac/properties/a/animation/*/
/* Animation for score subtraction */
@keyframes fade-in-up {
    0%, 10% {
        opacity: 1;
    }
    100% {
        transform: translateY(-30px);
        opacity: 0;
    }
}

/* Start panel styling - shown before game starts */
#start-panel {
    position: absolute;
    top: 0;
    left: 0;
     width: 100%;
    height: 100%;
    display: flex;
     flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.8);
     z-index: 100;
    padding: 20px;
}

#start-panel h2 {
    font-size: 3em;
    color: #EEC23D;
    margin-bottom: 20px;
    text-shadow: 3px 3px 0 #000;
}

#start-panel p {
    font-size: 1.2em;
    margin-bottom: 30px;
    text-align: center;
    max-width: 600px;
}

/* Timer settings styling */
#timer-settings, #end-timer-settings {
    margin: 20px 0;
    width: 80%;
    max-width: 400px;
    text-align: center;
}


/*Source https://css-tricks.com/styling-cross-browser-compatible-range-inputs-css/ */
/* Slider styling */
#time-slider, #end-time-slider {
    width: 100%;
    height: 10px;
    -webkit-appearance: none;
     appearance: none;
    background: #444;
    border-radius: 5px;
    outline: none;
     margin-top: 10px;
}

/*Source https://css-tricks.com/styling-cross-browser-compatible-range-inputs-css/ */
/* Slider thumb styling */
#time-slider::-webkit-slider-thumb, #end-time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
     height: 20px;
    border-radius: 50%;
    background: #EEC23D;
    cursor: pointer;
    border: 2px solid #000;
}

/* Start button styling */
#start-button, #replay-button {
    padding: 15px 30px;
    font-size: 1.5em;
     background-color: #EEC23D;
    color: #000;
    border: none;
    border-radius: 5px;
    cursor: pointer;
     font-family: "Ubuntu Sans Mono", sans-serif;
    font-weight: bold;
    transition: all 0.2s;
    margin-top: 20px;
}

#start-button:hover, #replay-button:hover {
    background-color: #FFD700;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Game over panel styling - shown after game ends */
#game-over-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
     height: 100%;
    display: flex;
     flex-direction: column;
    justify-content: center;
    align-items: center;
     background-color: rgba(0, 0, 0, 0.8);
    z-index: 100;
    padding: 20px;
}

#game-over-panel h2 {
    font-size: 3em;
    color: #EEC23D;
    margin-bottom: 30px;
    text-shadow: 3px 3px 0 #000;
}

/* Final stats container styling */
#final-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
     margin-bottom: 30px;
    width: 80%;
    max-width: 500px;
}

.final-stat {
     background-color: rgba(0, 0, 0, 0.5);
    padding: 10px 15px;
    border-radius: 5px;
    border: 2px solid #EEC23D;
    text-align: center;
}
/* https://www.w3schools.com/css/css_rwd_mediaqueries.asp */
/* Making the site responsive */
@media (max-width: 768px) {
    #top-bar {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }
    
    #game-title {
        font-size: 2em;
        margin-bottom: 10px;
    }
    
    #stats {
        width: 100%;
        justify-content: space-between;
    }
    
    .upgrades {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }
    
    .upgrade {
        margin-bottom: 10px;
    }
    
    #final-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    #stats {
        flex-direction: column;
        gap: 5px;
    }
    
    #stats > div {
        width: 100%;
        text-align: center;
    }
}
