/* style.cs: BYU IT&C 210a Boilerplate Stylesheet */

/* We use the Material Icons font in some of the styles. This brings in
the corresponding fonts from Google Fonts. */
@import url("https://fonts.googleapis.com/icon?family=Material+Icons");

/* The root rule is the foundation for the whole page. These settings _cascade_
to all elements unless they are overridden. */
:root {
	/* Change these variables according to your theme */
	--primary: #122c50; /*내비게이션*/
	--accent: #2f855a;
	--delete: #c53030;
	--primary-text: #ffffff;

	/* Window background and default font */
    background-color: #e5e7eb; /* 페이지 배경*/
    font-family: Verdana, Geneva, Tahoma, sans-serif;
}

/* These rules with element selectors apply to all elements of the corresonding names. In a sense, they
are automatically applied */

body {
    max-width: 55rem;			  /* Keeps the page from overflowing on wide monitors */
    margin: 0.5em auto;		      /* 0.5em is top and bottom margin. 'auto' for left and right centers the body on the page */
    border: 1px solid rgba(0,0,0,0.2);	/* Surround the content with a solid black border */
    border-radius: 5px;			  /* Round the corners of the body section */
    padding: 0.75rem;			  /* Padding goes between the borders and the internal content */
    background-color: white;	/* Contrast the body background from the page background */
}

h1 {
	font-family: "Arial Black", Arial, sans-serif;
	font-weight: bolder;
	color: var(--primary);
}

nav {
    color: var(--primary-text);				/* Nav bar is white on very dark gray, 상단 네비게이션 */ 
    background-color: var(--primary);
    padding: 0.75rem;			  /* Give the nav bar some internal padding, */
}

nav a {
    color: var(--primary-text);		/* Links in the nav bar are light blue instead of white, 상단 네비게이션 */
    text-decoration: none;
	font-weight:bold;		  /* Don't underline links in the nav bar */
}


.controls {
	display: flex;
	align-items: center;
	gap: 1.2rem;
	margin: 0.5rem 0 1rem 0;
}

.controls > div {
	display: flex;
	align-items: center;
}

/* These with class selectors take effect when you apply the corresponding class name on an element */

.tasklist {
    padding-left: 0;
    list-style-type: none;
    margin: 0;

    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 2px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}


.task {
	display: flex;
	align-items: center;
	gap: 0.8rem;
	padding: 1rem 1rem;
	border-bottom: 1px solid rgba(0,0,0,0.15);
	background-color: white;
}

.task:last-child {
	border-bottom: none; /* No border on the last item */
}

.task:hover {
	background-color: #f9fafb; /* Light gray background on hover */
}

.task-done {
	width: 2.4rem;
	display: flex;
	justify-content: center;
	align-items: center;
}

.task-done:checked{
	color: var(--accent); /* green checked */
}

.task-description {
	flex: 1;
	font-size: 1.35rem;
}

.task-description-done {
	text-decoration: line-through; 
	opacity: 0.7;
}

.task-date {
	width: 10em;
	text-align:right;
	font-size: 1.35rem;

	font-variant-numeric: tabular-nums;
}

.task-delete {
	width: 2.6rem;
	display: flex;
	justify-content: center;
	align-items: center;
	color: var(--delete);
	/* Add property to change delete icon color */
}

.material-icon {
	border: none; /* No border */
	background: none; /* Match the background of the parent */
	font-family: 'Material Icons'; /* Use the icon font */
	font-size: 1.1rem; /* Input doesn't automatically inherit font size. This brings it in. */
	cursor: pointer; /* Change the cursor to a pointer when hovering on this element */
	line-height: 1;
	padding: 0;
}


.input-description {
	width: 100%;
	box-sizing: border-box;
}
/* Add your custom class rules here */
.btn-create-task {
	background-color: var(--primary); /* Green background */
	color: var(--primary-text);       /* White text */
	border: 1px solid var(--primary);  /* Border matching the primary color */
	padding: 0.6rem 1rem;               /* Padding inside the button */
	border-radius: 10px;               /* Rounded corners */
	cursor: pointer;                  /* Pointer cursor on hover */
	font-weight: 700;                   /* Font size relative to surrounding text */
}

.btn-create-task:hover {
	filter: brightness(0.95);    /* Border color matches background on hover */
}

.form-create-task {
	margin-top: 1.2rem;               /* Space above the form */
	padding-top: 1rem;
	border-top: 1px solid rgba(0,0,0,0.15);            /* Space below the form */
}
/* Add rule for: */
/* "Create Task" button border, background, and text */

.task-table {
	width: 100%;
	border-collapse: collapse; /* Remove space between table cells */
	margin-top: 1rem;         /* Space above the table */
}

.task-table th,
.task-table td {
	padding: 0.6rem;
	border-bottom: 1px solid rgba(0,0,0,0.15); /* Light border below each cell */
}

.task-table th {
	background-color: #f3f4f6;
	text-align: left; /* Left-align header text */
}

.task-table td:last-child {
	text-align: center; /* Center-align the last column (actions) */
}

/* ===== checkbox-icon =============== */
/* These three rules apply the checkbox icon from the Material Icons font to a checkbox */

input.checkbox-icon {
	font-family: 'Material Icons';
    font-size: 1.1rem;
	line-height: 1;
	width: 1.2rem;
	height: 1.2rem;
	  /* Input doesn't automatically inherit font size. This brings it in. */
	appearance: none;    /* Hide the existing checkbox so that the new rendering will overlay it */
	cursor: pointer; 
	vertical-align: middle;    /* Change the cursor to a pointer when hovering on this element */
	color: rgba(0, 0, 0, 0.35);
}

input.checkbox-icon:before {
	content: 'check_box_outline_blank';
	display: inline-block;  /* Inline-block makes it take up rectangular space */
	color: rgba(0, 0, 0, 0.35);
}

input.checkbox-icon:checked:before {
	content: 'check_box';
	color: var(--accent);
}


/* ===== toggle-switch =============== */
/* This is pretty advanced CSS and is intended to be ready-to-use. Just
 * set an input of type checkbox to class 'toggle-switch' to make the
 * control look like a switch instead of a checkbox.
 * Example:
 *     <input type='checkbox' name='cb1' class='toggle-switch'/><label for='cb1'>Lights</label>
 *
 * Adapted from: https://codeconvey.com/convert-checkbox-to-toggle-button-css/
 * with important adjustments to make it senstive to the local font size.
 * and the addition of comments.
 */

/* Toggle Switch */
input.toggle-switch {
	vertical-align: middle;
    font-size: 1em;      /* Input doesn't automatically inherit font size. This brings it in. */
	appearance: none;    /* Hide the existing checkbox so that the new rendering will overlay it */
	position: relative;  /* Relative positioning holds this elements space and lets :before and :after pseudo-elements position relative to this */
	cursor: pointer;     /* Change the cursor to a pointer when hovering on this element */
	margin: 0em 0.2em;   /* No top and bottom margin. Make space to the left and right. Use 'em' units to keep space relative to local font size */
    width: 1.4em; 		 /* Set the element width and height relative to the font size. */
    height: 0.8em;
}

/* Use the :after pseudo-element to create an oval as the surface of the button. */
input.toggle-switch:after {
    vertical-align: middle;	/* Center this vertically */
	content: '';            /* Empty text content. But still required to establish the element */
	display: inline-block;  /* Inline-block makes it take up rectangular space */
    position: absolute;	    /* Absolute positioning without left and top locates this exactly on top of the input.toggle-switch */
	width: 1.4em;           /* Width and height of the oval */
	height: 0.6em;
	background-color: rgb(128,128,128); /* Light gray fill */
	border-radius: 0.3em;   /* Border radius of half the height makes this an oval instead of a rectangle */
}

/* Use the :before pseudo-element to create a circle as the toggle handle */
input.toggle-switch:before {
    vertical-align: middle; /* Center this vertically thereby aligning to the background oval */
	content: '';            /* Empty text content required to take up any space */
	display: inline-block;  /* Inline-block makes it take up rectangular space */
	position: absolute;		/* Absolute positioning without x and y locates this on top of the input.toggle-switch */
	width: 0.7em;           /* Width and height are the same making it take up a square space which will be round with the border-radius */
	height: 0.7em;
    z-index: 1;				/* Z-index of 1 positions this on top of the input.toggle-switch:after */
	left: 0;                /* Position at the left edge of the parent checkbox (it will shift right when activated) */
	top: -0.1em;            /* Center it vertically on the background oval - tweaked to position just right */
	border: 1px solid rgb(128,128,128); /* border is the same color as the background oval */
	border-radius: 0.6em;   /* Radious greater than 1/2 the height/width makes a circle */
	background-color: white;  /* Fill with white */
	box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6); /* Cast a shadow on the background */
	transition-duration: 0.3s; /* Animate turning on or off over 0.3 seconds */
}

/* Shift the handle to the right when turned on */
input.toggle-switch:checked:before {
	left: 0.7em;            /* When turned on, shift to the right */
	box-shadow: -1px 1px 3px rgba(0, 0, 0, 0.6); /* When turned on, cast the shadow the other direction */
}

/* Change the background color to green when turned on */
input.toggle-switch:checked:after {
	background-color: #16a085;
}
