/*   VARIABLES   */

:root {
    --top-Row-Container-Height-Percentage: 10%;
    --explosionDuration: 800;
    --explosionBombDuration: 800;
    --backgroundFadeDuration: 500;



/*    width and height*/
    --ball-width: 50px;
    --ball-height: 50px;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    overflow-x: hidden;
    overflow-y: hidden;
}

#completeContainer {
    height: 100vh;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
    background-image: url('./background.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

#gameLayoutRoot {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#layoutSidePanel {
    flex: 0 0 auto;
}

#layoutCenterPanel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
}

/*   Layout  */

#topRowContainer {
    height: var(--top-Row-Container-Height-Percentage);
    overflow: hidden;
    margin-left: 0;
    margin-right: 0;
    --bs-gutter-x: 0;
}



#nextBallSlider {
    width: var(--ball-width);
    height: var(--ball-height);
    line-height: var(--ball-height);
}


.ball {
    position: absolute;
    border-radius: 50%;
    text-align: center;
    vertical-align: middle;
    font-size: 2.5em;
    z-index: 100;
    width: var(--ball-width);
    height: var(--ball-height);
    line-height: var(--ball-height);
    font-weight: bold;
}





/*BUGFIX */
#highscoreContainer {
    margin-top: -2px;
    padding-top: 1px;
}

#levelAndBonusContainer, #highscoreContainer {
    /*background-color: aqua;*/
    color: white;
    font-size: 1.5rem;
    text-transform: uppercase;
}

#middleRowContainer {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    margin-left: 0;
    margin-right: 0;
    --bs-gutter-x: 0;
    display: flex;
}

#gameFieldViewport {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0 auto;
}

#gameFieldContainer {
    position: absolute;
    inset: 0;
    height: 100%;
    width: 100%;
}

#scoreValue, #highscoreValue, #bonusValue, #levelValue {
    display: inline
}


#nextBallSlider {
    position: absolute;
    background-color: red;
    font-size: larger;
    font-weight: bold;
    text-align: center;
    vertical-align: middle;
}

.calculatedWeights {
/*.css('background', 'rgba(255, 255, 255, .2)')*/
/*.css('position', 'absolute')*/
    position: absolute;
    background: rgba(255, 255, 255, 0.2);
    font-weight: bolder;
    font-size: 2rem;
    border-radius: 10px;
    height: 40px;
    line-height: 40px;
    width: 40px;
    vertical-align: middle;
    text-align: center;
}





.heart {
    --c: red;
    width: var(--ball-width);
    aspect-ratio: 1;
    border-image:
            radial-gradient(var(--c) 64%, transparent 36%) /* border-image-source */
            86.5%/ /* border-image-slice */
            50%; /* border-image-width */

    /* cutting bottom as triangle shape*/
    clip-path: polygon(-37.5% 0 ,50% 86%, 138% 0);
}

/* Fill center with circle */
.heart::after {
    content: "";
    display: block;
    width: calc(var(--ball-width) / 2);
    height: calc(var(--ball-width) / 2);
    background: var(--c);
    border-radius: 50%;
    position: absolute;
    top: calc(var(--ball-width) / 2);
    left: calc(var(--ball-width) / 2);
    transform: translate(-50%, -50%);
}


.bombExploding {
    transition: var(--backgroundFadeDuration);
    -webkit-animation: var(--explosionBombDuration);
    background-color: black !important;
}
@-webkit-keyframes explodingBombAnimation {
    0% {

        -webkit-transform: scale( 1 );-moz-transform: scale( 1 );-o-transform: scale( 0 );-ms-transform: scale( 1 );transform: rotate(50deg) scale( 1 );
    }

    20% {
        -webkit-transform: scale( 0.8 );-moz-transform: scale( 0.8 );-o-transform: scale( 0.8 );-ms-transform: scale( 0.8 );transform:rotate(50deg)  scale( 0.8 );
    }

    100% {
        -webkit-transform: scale( 1.2 );-moz-transform: scale( 3 );-o-transform: scale( 3 );-ms-transform: scale( 3 );transform:rotate(50deg)  scale( 3 );
    }
}

.ballExploding {
    transition: var(--backgroundFadeDuration);
    -webkit-animation: var(--explosionDuration);
    background-color: black !important;
	font-size: 0px;

}
@-webkit-keyframes explodingAnimation {
 0% {

   -webkit-transform: scale( 1 );-moz-transform: scale( 1 );-o-transform: scale( 0 );-ms-transform: scale( 1 );transform: scale( 1 );
  }
   
   20% {
   -webkit-transform: scale( 0.8 );-moz-transform: scale( 0.8 );-o-transform: scale( 0.8 );-ms-transform: scale( 0.8 );transform:  scale( 0.8 );
  }
   
   100% {
   -webkit-transform: scale( 1.2 );-moz-transform: scale( 3 );-o-transform: scale( 3 );-ms-transform: scale( 3 );transform:  scale( 3 );
  }
}




.bomb {
    width: var(--ball-width);
    height: var(--ball-height);
    transform: rotate(50deg);
    background-color: red;
    border-radius: 100%;
}

.bomb .fuse {
    position: relative;
    left: calc(var(--ball-width) / 3);
    top: calc(var(--ball-width) / 8);
    width: calc(var(--ball-width) / 3);
    height: calc(var(--ball-width) / 2);
}





#weightsContainer {
    position: absolute;
    /*margin-left: -300px;*/
    width: 100%;
    left: 0px;
}





/*#highscoreContainer {*/
/*    height: 50px;*/
/*}*/




.gear {
    z-index: 100;
    width: 35px;
    height: 35px;
    background: #14213d;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gear-inner {
    width: 17px;
    height: 17px;
    background: #14213d;
    border-radius: 50%;
    background: #9a7d5c;
}

.bar {
    width: 70px;
    height: 12px;
    background: #14213d;
    border-radius: 7px;
    position: absolute;
    z-index: -1;
}
.bar:nth-child(2) {
    transform: rotate(60deg);
}
.bar:nth-child(3) {
    transform: rotate(120deg);
}




/*   Styles  */




.overlay {
    display: none;
    z-index: 100;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    /*background-color: #0dcaf0;*/
	background-image: url('./loadingScreen.png');
    background-size: cover;

}

#overlaySettingsContentWrapper {
    display: none;
    margin-top: 50px;

}

#overlaySettingsContentWrapper {
	width: 100%;
    display: block;
    height: 100%;
    background-image: linear-gradient( rgb(0 0 0) 0%, rgba(0, 0, 0, 1.0) 33%, rgba(0, 0, 0, 0.0) 42% );

}


#overlaySettings {
	width: 100%;
    height: 100%;
    background-color: black;
    background-image: url(./loadingScreen.png);
    background-size: 100% 65%;
    background-position: bottom;
    background-repeat: no-repeat;
}

#overlaySettingsContent, #overlayUiSettingsContent {
    padding: 30px;
    font-size: 1.5rem;
	border-radius: 20px;
	
	margin-left: 50px;
	margin-right: 50px;
	background-image: linear-gradient( rgba(13, 202, 240, 1.0) 0%, rgba(13, 202, 240, 0.7) 100% );
}

#overlaySettingsContent h1, #overlayUiSettingsContent h1 {
	text-decoration: underline 8px dashed cyan;
    margin-bottom: 15px;
}




#startGameButton {
    bottom: 20px;
    left: 5%;
    z-index: 20;
}

#settingsButton {
    bottom: 20px;
    left: 20%;
    z-index: 20;
}

#startPauseButton {
    bottom: 20px;
    left: 35%;
    z-index: 20;
}


#stepByStepButton {
    bottom: 20px;
    left: 50%;
    z-index: 20;
}


#gameEditorButton {
    bottom: 20px;
    left: 65%;
    z-index: 20;
}








.underlineBorder {
	border-bottom: 5px dashed cyan;
}


.customCloseButton {
    top: 5%;
    right: 5%;
	font-weight: bold;
    font-size: 2rem;
}


.customButtonsSmall {
    width: 70px;
    height: 30px;
    border-radius: 10%;
    background-color: gray;
    text-align: center;
    vertical-align: middle;
    line-height: 30px;
    margin-top: 10px;
    margin-bottom: 10px;
}

#closeButtonInSettingsOverlay {
    width: 150px;
    height: 70px;
    line-height: 70px;
	
    /*margin-bottom: 30px;*/
    font-size: 2rem;
    font-weight: bolder;
	margin-bottom: 100px;

}




#playGameButtonInSettingsOverlay {
    width: 150px;
    height: 70px;
    line-height: 70px;
    margin-top: 30px;
    margin-bottom: 10px;

    font-size: 2rem;
    font-weight: bolder;

}

/*   TODO:need to be reviewed  */

#leftSinglePlayerModeContainer,
#rightSinglePlayerModeContainer {
    background-color: lightcoral;
}




#leftButton {
    bottom: 10%;
    right: 10px;
}

#rightButton {
    bottom: 5%;
    right: 10px;
}


.customButtons {
    position: fixed;
    width: 120px;
    height: 50px;
    border-radius: 10%;
    background-color: gray;
    text-align: center;
    vertical-align: middle;
    line-height: 50px;
    user-select: none;
}


#button {
    position: fixed;
    bottom: 200px;
    right: 500px;
}

.customButtons:hover, .customButtonsSmall:hover{
    cursor: pointer;
}

.customButtons.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Settings overlay responsiveness */
#overlaySettingsContentWrapper {
    margin-top: 0;
    padding: clamp(10px, 2.5vh, 26px) clamp(8px, 3vw, 28px);
    overflow-y: auto;
}

#overlaySettingsContent, #overlayUiSettingsContent {
    margin-left: auto;
    margin-right: auto;
    width: min(980px, 100%);
    max-height: calc(100vh - 170px);
    overflow-y: auto;
    font-size: clamp(1rem, 2.2vw, 1.5rem);
    padding: clamp(14px, 2.2vw, 30px);
}

#overlaySettingsCloseButtonContent .row,
#overlaySettingsPlayButtonContent .row,
#overlayUiSettingsCloseButtonContent .row,
#overlayUiSettingsPlayButtonContent .row {
    --bs-gutter-x: 0;
}

#overlaySettingsCloseButtonContent .col-10.offset-1,
#overlaySettingsPlayButtonContent .col-10.offset-1,
#overlayUiSettingsCloseButtonContent .col-10.offset-1,
#overlayUiSettingsPlayButtonContent .col-10.offset-1 {
    width: 100%;
    margin-left: 0;
}

#closeButtonInSettingsOverlay, #playGameButtonInSettingsOverlay {
    width: clamp(96px, 20vw, 150px);
    height: clamp(44px, 8vh, 70px);
    line-height: clamp(44px, 8vh, 70px);
    font-size: clamp(1.1rem, 2.6vw, 2rem);
    margin-bottom: clamp(8px, 2vh, 24px);
}

#overlaySettings .underlineBorder .col-8.offset-1,
#overlayUiSettings .underlineBorder .col-8.offset-1 {
    width: 70%;
    margin-left: 0;
}

#overlaySettings .underlineBorder .col-2,
#overlayUiSettings .underlineBorder .col-2 {
    width: 30%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

#overlaySettings .customButtonsSmall,
#overlayUiSettings .customButtonsSmall {
    width: clamp(56px, 14vw, 86px);
    height: clamp(30px, 5.2vh, 44px);
    line-height: clamp(30px, 5.2vh, 44px);
    margin-top: 6px;
    margin-bottom: 6px;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
}

#savePasswordInput {
    width: 100%;
    min-width: 0;
}

@media (max-width: 860px) {
    #overlaySettingsContent h1, #overlayUiSettingsContent h1 {
        text-decoration-thickness: 4px;
    }

    #overlaySettings .underlineBorder .col-8.offset-1,
    #overlayUiSettings .underlineBorder .col-8.offset-1 {
        width: 64%;
    }

    #overlaySettings .underlineBorder .col-2,
    #overlayUiSettings .underlineBorder .col-2 {
        width: 36%;
    }
}

@media (max-width: 560px) {
    #overlaySettingsContent, #overlayUiSettingsContent {
        border-radius: 12px;
        max-height: calc(100vh - 132px);
    }

    #overlaySettings .underlineBorder .col-8.offset-1,
    #overlayUiSettings .underlineBorder .col-8.offset-1 {
        width: 60%;
    }

    #overlaySettings .underlineBorder .col-2,
    #overlayUiSettings .underlineBorder .col-2 {
        width: 40%;
    }
}

/* Tab styling */
.settings-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(13, 202, 240, 0.5);
    padding-bottom: 10px;
}

.tab-button {
    padding: 10px 20px;
    border: none;
    background-color: rgba(128, 128, 128, 0.5);
    color: white;
    font-size: 1.2rem;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.tab-button:hover {
    background-color: rgba(128, 128, 128, 0.7);
}

.tab-button.active {
    background-color: rgba(13, 202, 240, 0.8);
    color: white;
    font-weight: bold;
}

.tab-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}