/* removing default margin and paddings */
html{
  margin: 0px;
  font-size: 1rem;
  color: rgb(36, 36, 36);
}
body {
  box-sizing: border-box;
  margin: 0px;
  width:100%;
  min-height: 100vh;
  overflow-x: hidden;
}
body,
img,
h1,
h2,
h3,
h4,
p {
  margin: 0px;
  padding: 0px;
}
/* converting box-sizzing to border-box so border and padding will be inside of box size.  */
body * {
  box-sizing: inherit;
}

/* making the main page as grid */
main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto;
  justify-items: center;
  height:100%;
  
  /* background-color: antiquewhite; */

}

/* making the clock minute,hour and second hand aligned */
.clock {
  overflow: hidden;
  padding:20px;
  display: grid;
  width: 100%;
  max-height: 100vh;
  align-items: center;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}
.clock .clock-part {
  grid-area: 1/2;
  width: 100%;
  max-height: 100%;
  object-fit: contain;
  /* background-color: rgba(0, 0, 255, 0.205); */
  border-radius: 50%;
}



/* making all hand to align at 12  */
#hour-hand {
  transform: rotate(-103deg);
}
#min-hand {
  transform: rotate(-14deg);
}
#sec-hand {
  transform: rotate(-14deg);
}

/* styles only for seting time for alarm */


#alarm-container {
  padding: 20px 10px;
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto 1fr;
  justify-items: center;
  width: 100%;
}

/* ********* styling the alarm setting section */
#set-alarm {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr ;
  grid-auto-flow: column;
  align-items: center;
  width: 100%;
  max-width: 300px;
}

/* hiding :defaults for number input */
input[type="number"] {
  -webkit-appearance: textfield;
  -moz-appearance: textfield;
  appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.number-input {
  /* border: 2px solid #ddd; */
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  width: min-content;
}

.number-input,
.number-input * {
  box-sizing: border-box;
}
.number-input button {
  outline: none;
  -webkit-appearance: none;
  background-color: transparent;
  border: none;
  align-items: center;
  justify-content: center;
  width: 1.5em;
  height: 1.5em;
  cursor: pointer;
  margin: 0;
  position: relative;
  font-size: 1em;
  overflow: hidden;
  border-radius: 50%;
}

/* hover and active action for plus and minus buttons */
.number-input button:hover {
  transform: scale(.8);
  /* box-shadow: 0 0 5px 5px rgba(96, 67, 100, 0.322); */
}
.number-input button:active {
  transform: none;
}

/* crating the plus and minus button */
.number-input button::after,
.number-input button:nth-child(2):before {
  content: "";
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  transform: translate(-.25em, -.9em);
  border-bottom: .15em solid magenta;
}
.number-input button:nth-child(2):after {
  transform: rotate(90deg) translate(-2em, -.53em);
}

.number-input input[type="number"] {
  font-family: sans-serif;
  max-width: 2em;
  border:none;
  /* border-width: 0 2px; */
  font-size: 1.5em;
  height: 1.5em;
  font-weight: bold;
  text-align: center;
  background-color: transparent;
}
.number-input :first-child{
  font-size: .8em;
  padding-bottom: 2px;
}
/* styling the set ** alarm button**  */
#set-alarm > button {
  justify-self: end;
  border: none;
  padding: 20px 5px;
  border-radius: 50%;
  background-color:transparent;
}

#set-alarm > button:hover {
  box-shadow: 0 0 3px 4px rgba(165, 163, 163, 0.486);
}
#set-alarm > button:active {
  box-shadow: none;
}


/* styling the ** LIST ** which shows all the alarms to user */
#alarm-list {
  height: 100vh;
  max-width: 300px;
  width: 100%;
}
.alarm {
  display: grid;
  grid-template-columns: auto auto auto 1fr;
  grid-auto-flow: column;
  gap: 10px;
  place-content: center center;
  width: 100%;
  height: 3em;

  box-shadow: 0 0 2px 2px rgba(245, 222, 179, 0.61);
  z-index: 10;
  margin-bottom: 10px;
  /* height: 2em; */
}
.alarm > span {
  display: grid;
  place-items: center center;
  padding: 10px;
}
.alarm > span:last-child {
  border: none;
  justify-self: end;
}
.alarm > span:last-child:hover {
  background-color: rgba(82, 81, 81, 0.637);
}
.alarm > span:last-child:active {
  background-color: transparent;
}

/* after alarm is over this class will be added make it noticibale */
.alarmed {

  background-color: red;
  /* animation-name: example;
  animation-duration: 4s;
  animation-iteration-count: infinite; */
  animation: color-change 2s linear 0s infinite alternate;
}
@keyframes color-change {
  from {background-color: rgba(255, 0, 0, 0.575);}
  to {background-color: rgba(228, 228, 190, 0.644);}
}



/* responsiveness for mobile compatible */
@media only screen and (orientation: portrait) {
  main {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
}
