/* CSS Reset */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

a {
  color: inherit;
  display: inline-block;
}

button {
  background-color: transparent;
  border: none;
  cursor: pointer;
  border: 0;
}

ul,
ol {
  list-style: none;
}

html {
  font-size: 62.5%;
}

body {
  font-size: 1.6rem;
  font-family: "Courier New", Courier, monospace;
}

/* End CSS Reset */

.container {
  display: flex;
  justify-content: center;
  /* main axis (horizontally */
  align-items: center;
  /* cross axis (vertically) */
  min-height: 100vh;
  background-color: #e5e5f7;
  /* opacity: 0.8; */
  background-image: radial-gradient(#444cf7 0.75px, #e5e5f7 0.75px);
  background-size: 1.2rem 1.2rem;
}

.lights-control {
  display: flex;
  align-items: center; /* cross axis (vertically) */
  gap: 1rem;
  position: absolute;
  top: 2rem;
  z-index: 3;
}

.lights-label {
  width: 4.2rem;
  height: 2.2rem;
  border-radius: 1.5rem;
  background-color: black;
  cursor: pointer;
  transition: background-color 0.3s;
  padding: 0.3rem 0.4rem;
}

.lights-label:after {
  content: "";
  /* 
    Block-level elements are designed to structure the page vertically.
    it behaves like this:
    - Starts on a new line
    - Takes up the full available width of its parent (by default)
    - Respects width and height
    - Allows margin and padding on all sides


    display: inline;
    makes an element behave as an inline element, meaning it flows horizontally with the surrounding content rather than starting on a new line.
    - Width and height are ignored
    - vertical margin does not push other elements
   */
  display: block;
  width: 1.6rem;
  height: 1.6rem;
  background-color: white;
  border-radius: 50%;
}

.lights-input {
  display: none;
}

.lights-input:checked + .lights-label {
  background-color: white;
}

.lights-input:checked + .lights-label:after {
  background-color: green;
  transform: translateX(2.1rem);
  transition: background-color 0.3s;
}

.card {
  display: flex;
  flex-direction: column;
  border-radius: 1rem;
  min-width: 36.5rem;
  /* 
    overflow property controls what happens when the content inside an element is bigger than the element?s box (width/height).

    Think of it as: ?What should the browser do if content doesn?t fit??

    - visible
    - hidden
    - scroll
    - auto: Scrollbars appear only if needed
   */
  overflow: hidden;
  background-color: white;
  box-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.2);
}

.lights {
  /* display: none; */
  /* 
    instead of hard display, use animation by using opacity/visibility
   */
  opacity: 0;
  visibility: hidden;
  /*
    - all ? animate every property that can be animated
    - 0.3s ? animation lasts 0.3 seconds (300ms)
   */
  transition: all 0.3s;
  position: absolute; /* otherwise it considered an element for flex */
  /* left: 2.5rem; */
  z-index: 2; /* should be aboce the picture */

}

/* red bulbs */
.bulb-odd {
  /* 
    alternate: means start from 0%. after reaching 100% got back to 0% and so on
   */
  animation: party 0.5s infinite alternate;
}

/* yellow bulbs */
.bulb-even {
  /* 
    alternate-reverse: means start from 100%. after reaching 0% got back to 100% and so on
   */
  animation: party 0.5s infinite alternate-reverse;
}

@keyframes party {
  from {  /* same as 0% */
    fill: #FF1111;
  }
  to {    /* same as 100% */
    fill: #F3EA19
  }
}

.container:has(.lights-input:checked) .lights {
  /* display: block; */
  opacity: 1;
  visibility: visible;
}

.top {
  height: 10rem;
  background-color: #e5e5f7;
  opacity: 0.8;
  background-image: repeating-radial-gradient(circle at 0 0, transparent 0, #e5e5f7 1.5rem), repeating-linear-gradient(#444cf755, #444cf7);
}

.middle {
  margin: 0 auto; /* add margin from left & right so that the content is centered */
  text-align: center; /* center content */
  margin-top: -6rem;
  z-index: 1;
}

.pic {
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  border: 0.4rem solid white;
}

.title {
  font-size: 2.2rem;
}

.profession {
  font-size: 1.6rem;
}

.bottom {
  display: flex;
  margin-top: 3rem;
  border-top: 0.1rem solid #c4c4c4;
  /* justify-content: space-between; */
}

.column {
  flex: 1;
  padding: 1.8rem 1.5rem;
  text-align: center;
}

/* 
  The :nth-child() pseudo-class lets you select elements based on their position among siblings.
 */
.column:nth-child(2) {
  border-right: 0.1rem solid #c4c4c4;
  border-left: 0.1rem solid #c4c4c4;
}

.icon {
  width: 2rem;
  height: 2rem;
}

.username {
  font-size: 1.2rem;
}

/* 
  - A website is called "pixel perfect" if the actual oage is identical to the expected page

  - Image Editor: Figma
   - export image as svg

  - https://caniuse.com/
   - give info about support of browsers for CSS features such as 'has'
 */