
/* HABITS list */

body ul.habits_list {
	padding: 0;	
	margin: 0;
	clear: both;
}

body.habits #main ul.habits_list, body.user-habits ul.habits_list {
    box-shadow: 2px 2px 15px 2px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.7);
    border-radius: 7px;
}

body.habits #main ul.habits_list li#header .name {
	border-radius: 5px 0 0 0;
	overflow: hidden;
}

body.habits #main ul.habits_list.game-deactive {
	margin-bottom: 0;
}

body.habits #main ul.habits_list.game-deactive li#header .name {
	border-radius: 5px 5px 0 0;
	overflow: hidden;
	margin-bottom: 0;
}

body.habits #main ul.habits_list.game-deactive + div.name {
	color: white;	
	padding-bottom: 20px !important;
	border-radius: 0 0 5px 5px;
	background: rgba(58, 89, 92, 0.4);
}

body.habits #main ul.habits_list.game-deactive + div.name a {
	color: #fac100;	
}

body.habits #main ul.habits_list li#header .help {
	border-radius: 0 5px 0 0;	
	overflow: hidden;
}

body.habits #main ul.habits_list li:last-of-type .help {
	border-radius: 0 0 5px 0;	
	overflow: hidden;	
}

body.habits #main ul.habits_list li:last-of-type .name {
	border-radius: 0 0 0 5px;
	overflow: hidden;	
}

ul.habits_list li {
	list-style: none;	
}

ul.habits_list li {
	display: grid;
	grid-template-columns: repeat(24, 1fr); /* Adjust based on the number of <td>s */
	grid-template-rows: 1fr;
	padding: 0;
}

ul.habits_list li:nth-of-type(odd) {
	background: rgba(0,0,0,0.02);	
}

ul.habits_list li:nth-of-type(even) {
	background: rgba(255,255,255,0.04);	
}

body.habits #main ul.habits_list li:nth-of-type(odd) {
	background: rgba(0,0,0,0.2);	
}

body.habits #main ul.habits_list li:nth-of-type(even) {
	background: rgba(35, 35, 35, 0.25);
}

/* GRID LAYOUT FOR HABIT TEMPLATE HEADER */

ul.habits_list li#header {
	padding: 0;
}

ul.habits_list li#header div:first-of-type {
	padding-left: 30px;
}

ul.habits_list li#header div {
	padding: 7px 0;	
	font-size: 15px;
	min-width: 0;
	background: rgba(250,193,0,0.8);
	color: black;
	font-weight: 400;
	font-family: museo, sans-serif;
}

ul.habits_list li#header .name {
	grid-area: 1 / 1 / 1 / 19;	
	font-weight: 600;
}

ul.habits_list li#header .score {
	grid-area: 1 / 19 / 1 / 22;
	justify-content: center;
	align-items: center;
	margin: 0;
	background: rgba(250,193,0,0.7);
}

ul.habits_list li#header .help {
	grid-area: 1 / 22 / 1 / 25;
	justify-content: center;
	align-items: center;
	min-width: 50px;
}

body[class*="habits"] ul.habits_list li#header .name {
	border-radius: 5px 0 0 0;
}

body[class*="habits"] ul.habits_list + ul.habits_list li#header .name {
	border-radius: 0;
}
	
body.habits ul.habits_list li#header .help {
	border-radius: 0 5px 0 0;
}

body.habits ul.habits_list + ul.habits_list li#header .help {
	border-radius: 0;
}

body.user-habits ul.habits_list li#header .score {
	border-radius: 0 5px 0 0;
}

body.user-habits ul.habits_list + ul.habits_list li#header .score {
	border-radius: 0;
}


/* GRID LAYOUT FOR HABITS */

ul.habits_list .name {
    grid-area: 1 / 1 / 1 / 13;	
}

ul.habits_list .name {
    padding-left: 28px;
}

body[class*="habits"] ul.habits_list .input {
    grid-area: 1 / 14 / 1 / 19;
	padding-right: 15px;
	justify-content: end;
}

ul.habits_list li .score {
	grid-area: 1 / 19 / 1 / 22;
	padding: 0 5px;
}

ul.habits_list .help {
   grid-area: 1 / 22 / 1 / 25;
}

ul.habits_list .description {
	display: none;	
}

ul.habits_list div {
	display: grid;	
	padding-top: 12px;
	padding-bottom: 12px;
}

ul.habits_list .input {
    grid-area: 1 / 13 / 1 / 19;	
}

ul.habits_list .score {
   grid-area: 1 / 19 / 1 / 22;
}

/* SCORE row */
ul.habits_list li.game-score {
	background: rgba(0,0,0,0.12);
	color: white;
	font-weight: 600;
	padding: 0;
	height: 50px;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

ul.habits_list li.game-score div.name {
    grid-area: 1 / 1 / 1 / 19;
    align-items: center;
}

ul.habits_list li.game-score div.day_score {
	grid-area: 1 / 19 / 1 / 25;
	text-align: center;
}


/* END GRID LAYOUT */

ul.habits_list .help i {
    display: flex;
    align-items: center;
	color: white;
	opacity: 0.2;
	font-size: 18px;
	transform: scale(0.9);
	transition: 0.3s all;
	cursor: pointer;
	justify-content: center;
}

ul.habits_list .help i:hover {
	opacity: 1;
	color: #fac100;
	transform: scale(1.05);
}

ul.habits_list li label {
	display: flex;
    color: RGBA(255, 255, 255, 0.85);
    place-items: center;
    font-family: museo, sans-serif;
}	

ul.habits_list li input[type="text"] {
	width: 100% !important;
    display: grid;
    height: 30px !important;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3) inset;
    border: none !important;
    border-radius: 3px !important;
    padding: 9px 5px 7px 5px !important;
    box-sizing: border-box !important;
    text-align: center;
	color: rgba(0,0,0,0.7);
	transition: 0.3s all;
	max-width: 70px;
}	

	
/* Stylable checkbox */
ul.habits_list li[data-habit-type="checkbox"] label + label {
	display: grid;
	height: 30px !important;
	width: 30px !important;
	margin: 0 !important;	
	opacity: 0.5;
	transition: 0.3s all;
	border-radius: 3px;
}

ul.habits_list li div.score {
	background: rgba(255,255,255,0.025);
}

ul.habits_list li div.score label {
	justify-content: center;
	opacity: 0.9;
}

ul.habits_list li div.score.animate-change label {
	animation: animate-score 0.5s;	
}

@keyframes animate-score {
	0% {
		transform: scale(1.8);
		color: #fac100;
		font-weight: 700
	}
	100% {
		transform: scale(1);
		color: white;
		font-weight: 100;
	}
}

ul.habits_list li.help {
	background: rgba(0,0,0,0.05);
	padding: 0 15px 0 15px;
	min-width: 50px;
}

ul.habits_list li input[type="text"]:focus {
	opacity: 1;	
}

ul.habits_list li input[type="text"]:not(:placeholder-shown), ul.habits_list li label[checked='checked'] .checkmark {
    background-color: #fac100;	
	opacity: 1;
}

ul.habits_list li input[type="text"]:not(:placeholder-shown), ul.habits_list li label[checked="checked"] {
	opacity: 1 !important;
}

ul.habits_list li input[type="text"]::placeholder {
	opacity: 0;
}

ul.habits_list li input[type="text"] {
	opacity: 0.5;	
}

ul.habits_list li input[type="text"]:hover {
	opacity: 1;	
}

ul.habits_list li input:focus {
	color: rgba(0,0,0,0.9);
}

ul.habits_list li[data-habit-type="count"] input[type="text"] {
	width: 36px !important;
}
	
ul.habits_list li input[type="checkbox"] {
	grid-area: 1 / 13 / 1 / 17;
	display: grid;
	height: 30px !important;
	width: 36px !important;
	margin: 0 !important;
}

ul.habits_list li[data-habit-type="checkbox"] label + label:focus {
	opacity: 1;
}

ul.habits_list li[data-habit-type="checkbox"] label + label:focus {
		
}


/* Custom checkbox style */
label.custom-checkbox input {
	display: none !important;
}

label.custom-checkbox .checkmark {
    display: inline-block;
    width: 36px;
    height: 30px;
    background-color: white;
    border-radius: 3px; /* Rounded corners */
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
	box-shadow: 1px 1px 3px 2px rgba(0,0,0,0.2) inset;
	opacity: 0.5;
	transition: 0.3s all;
}

label.custom-checkbox .checkmark:hover {
	opacity: 1;	
}

/* Add a checkmark when the checkbox is checked */
.custom-checkbox input[type="checkbox"]:checked + .checkmark {
    background-color: #fac100; /* Change to your desired color */
}

/* Add the checkmark indicator */
.custom-checkbox .checkmark::after {
	content: "";
    position: absolute;
    top: 7px;
    left: 14px;
    width: 5px;
    height: 10px;
    border: solid rgba(70, 70, 70);
    border-width: 0 4px 4px 0;
    transform: rotate(45deg) scale(0.8);
    transition: all 0.3s;
    text-align: center;
	opacity: 0;
}

.custom-checkbox input[type="checkbox"]:checked + .checkmark::after {
    opacity: 1 !important;
	animation: checkbox-in 0.3s 1;
	transform: rotate(45deg) scale(1);
}

.custom-checkbox input[type="checkbox"]:hover + .checkmark::after {
	opacity: 0.15;	
	transform: rotate(45deg) scale(1.05);
}

@keyframes checkbox-in {
	0% {
		transform: rotate(45deg) scale(1.8);
	}
	100% {
		transform: rotate(45deg) scale(1);
	}
}


/************* LEADERBOARD *************/

body.habits div.game {
	display: grid;
	grid-template-columns: repeat(32, 1fr); /* Adjust based on the number of <td>s */
	grid-template-rows: 1fr;
	margin-bottom: 40px;
}

body.habits div.game:last-of-type {
	margin-bottom: 0;	
}

div.game .armory-buttons {
	transform: scale(0.9);
}

div.game .armory-buttons p.has_anchor a {
	padding: 5px 20px;	
}

div#col1 {
	grid-area: 1 / 1 / 1 / 19;
}

div#col2 {
	grid-area: 1 / 19 / 1 / 33;
    background: rgba(0, 0, 0, 0.15);
    padding: 20px 20px 35px 20px;
    border-radius: 0 12px 12px 0;
	margin-top: 41px;
	margin-bottom: 6px;
}

div#col2 .ui, div.date_ui .ui {
    width: 100%;
    display: flex;
    color: rgba(255,255,255,0.5);
    padding: 0 0 0 4px;
    position: relative;
    justify-content: space-between;
}

div.date_ui .ui {
	display: block;
	width: 30%;
}

div#col2 .ui select, div.date_ui select {
    width: 100%;
    height: 30px;  
    border-radius: 4px;
    padding: 3px 12px;
    color: #aaa;
    background: rgba(0,0,0,0.25) !important;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.3) inset;
    border: none;
    margin: -2px 0 0 0;
}

div#col2 .ui::before, div.date_ui .ui::before {
	font-family: "Font Awesome 5 Free";
    content: "\f0d7";
    float: right;
    margin-left: 7px;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.2);
    top: 2px;
    line-height: 24px;
    background: rgba(0, 0, 0, 0.05);
    width: 24px;
    text-align: center;
    border-radius: 100%;
    transition: 0.4s all;
    cursor: pointer;
    height: 24px;
    position: absolute;
    right: 2px;
    font-weight: 900;
    pointer-events: none;
}

div#col2 .ui select option, div.date_ui select option {
    color: #555;   
    border-bottom: rgba(0,0,0,0.2);
    display: flex;
}

div#col2 h2 {
	font-family: "museo", sans-serif;
	font-size: 24px;
	color: white;
	font-weight: 500;
	text-align: center;
	margin: 0;
}

div.leaderboard {
	padding: 0;
}

div.leaderboard ul {
	padding: 0;	
	margin: 0 0 0;
	width: 100%;
}

div.leaderboard li {
    list-style: none;
    display: flex;
    align-items: center;
    background: rgba(58, 89, 92, 0.5);
    border-radius: 6px;
	position: relative;
	margin: 0 0px 10px 0;
	transition: 0.3s all;
	flex-direction: column;
	overflow: hidden;
}

div.leaderboard li > div:first-child {
    justify-content: space-between;		
    padding: 6px 10px 6px 18px;	
	width: 100%;
	display: flex;
}

div.leaderboard .likedby {
	width: 100%;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 180, 0.5);
    font-size: 11.5px;
    text-align: left;
    padding: 3px 0 3px 16px;
}

div.leaderboard .likedby i {
	margin-right: 5px;
}

div.leaderboard li.is-self .like {
	pointer-events: none;
	filter: grayscale();
	overflow: hidden;

}

div.leaderboard li.is-self .like .count {
	color: white;
	margin: 5px 0 0 0;
}

div.leaderboard li .name {
	color: white;
	font-family: "museo", sans-serif;		
	font-size: 20px;
	margin: 0;
	display: flex;
	align-items: center;
	min-width: 70%;
}

div.leaderboard span.online, div.leaderboard span.offline {
	width: 10px;
	height: 10px;
	background: #15cf15;
	display: inline-flex;
	border-radius: 50%;
	margin-right: 10px;
	vertical-align: 2px;
}

div.leaderboard span.offline {
	background: #ff2828;	
}

div.leaderboard li.online .signal.red {
	display: none;	
}

div.leaderboard li.offline .signal.green {
	display: none;	
}

div.leaderboard li em {
	font-weight: 500;
	font-style: normal;
}

div.leaderboard li .like {
	text-align: center;
	width: 1px;
	opacity: 0;
	transition: 0.3s all;
}

div.leaderboard li:not(.is-self):hover .like {
	opacity: 1;
	width: 42px;
}

div.leaderboard li .circles {
	display: flex;
	width: 150px;
	justify-content: flex-end;
	align-items: center;
}

div.leaderboard li .like i {
	color: white;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    display: flex;
    border-radius: 20px;
    margin: 0 0 0 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.5);
    transition: 0.3s all;
}

div.leaderboard li .like:hover i {
	cursor: pointer;
	background: rgba(255,255,255,0.1);
}

div.leaderboard li .like i.liked {
	color: #fac100;
}

div.leaderboard li .score {
    color: white;
    font-weight: 400;
    font-size: 18px;
    margin-right: 0;
    background: rgba(0,0,0,0.5);
    width: 40px;
    text-align: center;
    border-radius: 20px;
    height: 40px;
    justify-content: center;
    display: inline-flex;
    align-items: center;
	border: 1px solid rgba(255,255,255,0.3);
	transform: scale(0.93);
	cursor: default;
}

div.leaderboard li .score[data-str-length='4'] {
	width: 50px;
}

div.leaderboard li .score[data-str-length='5'] {
	width: 60px;
}

div.leaderboard li .score[data-str-length='6'] {
	width: 70px;
}

div.leaderboard li:not([class*='is-self']):hover {
	background: rgba(58, 89, 92, 0.7);
	cursor: pointer;
}

div.leaderboard li:not([data-user-id]) {
	background: rgba(58, 89, 92, 0.5);
	cursor: default !important;
	transform: scale(1);
	justify-content: center;
}

div.leaderboard li:not([data-user-id]) span {
	color: rgba(255,255,255,0.5);
	font-family: "Fira Sans";
    font-size: 19px;
}

/********* FULL HABITS VIEW ************/

body.habits h1, body.user-habits h1, body.leaderboard h1 {
	font-family: "museo", sans-serif;
    text-align: center;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.22);
    display: table;
    width: auto;
    max-width: 400px;
    margin: 0 auto 8px;
    padding: 10px 20px;
    font-size: 21px;
    color: rgba(255, 255, 255, 0.5);
    border-radius: 5px;
}

body.leaderboard h2 {
	font-size: 18px;	
	font-family: "museo", sans-serif;
	color: #777;
	text-align: center;
	font-weight: 300;
	margin-bottom: 50px;
}

body.habits h3 {
	font-size: 20px;	
}

div.habits_wrap {
	max-width: 980px;
	margin: 0 auto;
	width: 100%;
}

div.habits_wrap p#datenote {
    display: flex;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    margin: 20px auto 0;
    justify-content: center;
    font-style: italic;
    line-height: 1.3em;
    font-size: 15px;
}

div.habits_wrap p#devnote {
    display: flex;
    justify-content: center;
    color: white;
    opacity: 0.5;
    transition: 0.3s all;
    border: 1px dashed rgba(255, 255, 255, 0.5);
    padding: 12px 17px;
    width: auto;
    max-width: 200px;
    margin: 40px auto;
    border-radius: 7px;
	cursor: pointer;
	transform: scale(0.9);
}

div.habits_wrap p#devnote i {
	display: flex;
	align-items: center;
	margin-right: 6px;
	color: #fac100;
}

div.habits_wrap div.popup_trigger:hover p#devnote {
	opacity: 0.9;	
}

div.date_ui {
    margin: 5px auto 30px;
    width: 100%;
    display: flex;
	align-items: center;
    max-width: 420px;
    border: 1px dotted rgba(255, 255, 255, 0.2);
    padding: 0 12px;
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.3);
	justify-content: space-between;
}

div.date_ui h3 {
    font-size: 25px;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'museo';
    font-weight: 300;	
	text-align: center;
	margin: 18px 0;
	width: 70%;
	font-size: 20px !important;
}

div.date_ui p.date {
	margin: 0;
}

div.date_ui p.date .day {
	font-weight: 500;
}

div.choose_date {
	width: 138px;
    height: 37px;
    position: relative;
    margin: 0;
    grid-area: 1 / 10 / 1 / 13;
}

div.choose_date input {
	background: rgb(58, 89, 92, 0.5);
    text-align: center;
    border-radius: 4px;
    color: white;
    display: table;
    margin: 0;
    padding: 4px 20px 4px 13px;
    font-size: 15px;
    white-space: nowrap;
	height: 100%;
    box-shadow: 2px 2px 15px 0px rgba(0, 0, 0, 0.3) inset;
    border: 1px solid rgba(255, 255, 255, 0.1);
	cursor: text;
}

div.choose_date input::placeholder {
	color: rgba(255,255,255,0.4);
	text-align: left;
}

div.choose_date i {
	font-size: 15px;
    margin-left: 10px;
    position: absolute;
    top: 10px;
    color: rgba(255, 255, 255, 0.3);
    right: 12px;
}

div.date_ui span.next {
	padding: 0 0 0 10px;
	transition: 0.3s all;
	display: inline-flex;
	font-size: 20px;
}

div.date_ui span.prev {
	padding: 0 10px 0 0;
	transition: 0.3s all;
	display: inline-flex;
	font-size: 20px;
}

div.date_ui span.prev:hover, div.date_ui span.next:hover {
	transform: scale(0.9);
	color: #fac100;
	cursor: pointer;
}

/*----------- Habit scores -----------*/

div.habits_wrap .score {
	display: flex;
	justify-content: space-between;
}

body.habits div.habits_wrap .score {
	justify-content: center !important;	
}

div.habits_wrap .score span {
	display: inline-flex;	
	align-items: center;
	color: rgba(255,255,255,0.6);
	font-weight: bold;
}

/*
div.habits_wrap .day-score, div.habits_wrap .total-score {
	background: rgba(255,255,255,0.1);
	border: 1px solid rgba(255,255,255,0.2);
	display: flex;
	justify-content: center;
	padding: 5px 18px;
    margin: 0px 0 0 0;
    border-radius: 3px;
    max-width: 260px;
	flex-shrink: 1;
} */

div.habits_wrap .day-score span.number, div.habits_wrap .total-score span.number {
	font-size: 24px;	
	font-weight: 900;
	color: white;
	line-height: 1.3em;
}

div.habits_wrap .day-score span.label, div.habits_wrap .total-score span.label {
	color: rgba(255,255,255,0.6);
	font-size: 18px;	
	font-weight: 300;
	margin: 0 0 0 6px;
}

.day-score .animate.number, .total-score .animate.number {
	animation: updateScore 0.6s ease-in;
}

div.habits_wrap .score {
	justify-content: center;
}

div.habits_wrap .day-score {
	justify-content: center;
	grid-area: 1 / 19 / 1 / 33;
	background: rgba(0,0,0,0.11);
	align-items: center;
	font-size: 21px;
	border-left: 1px solid rgba(255,255,255,0.05);
}

div.habits_wrap .game-score > div {
	padding-top: 7px;
	padding-bottom: 7px;
}
	
@keyframes updateScore {
	0% {
		transform: scale(1.25);
		color: #fac100;
	}
	100% {
		transform: scale(1); /* Scale back to normal */
		color: white;
	}
}


/*---------- Calendar icon ----------*/

div.habits_wrap h2 a i {
	color: white;
	transition: 0.3s all;
}

div.habits_wrap h2 a:hover i {
	color: #fac100;
	transform: scale(0.96);
}

/*---------- Datepicker ----------*/

div.ui-datepicker td.highlight {
	position: relative;
}

div.ui-datepicker td.highlight::before {
	content: "\2022";
	position: absolute;
	bottom: -5px;
	left: 5px;
	color: rgba(58,89,92,0.4);
}

div.ui-datepicker td.selected a {
	background-color: rgba(58,89,92,0.25);	
	font-weight: bold;
}

/*---------- User habits UI ----------*/

body.user-habits ul.habits_list li input, body.user-habits ul.habits_list li span, body.user-habits ul.habits_list  .checkmark {
	cursor: default !important;
}

body.user-habits ul.habits_list li:not([data-stored-score]):not([data-stored-score=0]) input[type="text"]:hover {
	opacity: 0.5 !important;	
}

body.user-habits .habits_wrap {
	max-width: 700px;	
}

body.user-habits h1 {
	line-height: 1.4em !important;
	margin-bottom: 3px;	
}

body.user-habits h2 {
	font-family: "museo", sans-serif;
	text-align: center;
	color: white;
	margin-bottom: 30px;
	font-weight: 500;
}

body.user-habits ul.habits_list li .score {
	grid-area: 1 / 19 / 1 / 25 !important;
}

body.user-habits ul.habits_list li .help {
	display: none;
}

body.user-habits .score span.number {
	color: #fac100 !important;
}

body.user-habits span.period {
	margin: 0 8px 0 0;	
}

body.user-habits ul.habits_list li input {
	background: transparent !important;
	color: white !important;
	box-shadow: none !important;
}

body.user-habits ul.habits_list li input[type="checkbox"]:not([checked]) + .checkmark {
	background: transparent !important;
	box-shadow: none;
}

body.user-habits ul.habits_list li input[type="checkbox"][checked] + .checkmark {
	background: transparent;
	box-shadow: none;
}

body.user-habits ul.habits_list li input[type="checkbox"][checked] + .checkmark::after {
	border-color: white;
}

body.user-habits ul.habits_list li input[type="text"] {
	text-align: right;
	padding-right: 9px !important;
}

body.user-habits #armory-buttons {
	display: flex;
    justify-content: center;
	margin: 25px 0 0 0;
	width: auto;
	flex-grow: 0;
}

body.user-habits #armory-buttons p {
	margin: 0;	
	transition: 0.3s all;
}

body.user-habits #armory-buttons p.has_anchor a {
	background: #3a595c;
	padding: 6px 20px;	
	display: block;
	border-radius: 6px;
}

body.user-habits #armory-buttons p:hover {
	transform: scale(0.96);
}

body.user-habits #armory-buttons p a:hover {
	text-decoration: none;	
	color: white;
}

/*----------------- Leaderboard --------------------*/

body.leaderboard div.leaderboard ul {
	margin-top: 10px;
}

body.leaderboard div span.prev {
	padding-left: 0;
}