/* paleta https://coolors.co/c1dbe3-c7dfc5-f6feaa-fce694-373737 */
:root {
  --color-primary: #2563eb;
  --color-secondary: #f59e42;
  --color-accent: #10b981;
  --color-background: #f3f4f6;
  --color-surface: #ffffff;
  --color-muted: #6b7280;
  --color-error: #ef4444;
  font-size: 62.5%;
  interpolate-size: allow-keywords;
}

body {
  background-color: #f5f5f5;
  margin: 0;
  font-family: "Inter", sans-serif;
}

header {
  background-color: var(--color-primary);
  padding: 20px;
  color: white;
    
  h1 {
    font-size: 3rem;
    text-align: center;
  }

  a {
    height: 80px;
    width: 80px;
    font-size: 4rem;
    position: fixed;
    top: 18px;
    display: grid;
    place-content: center;
    line-height: 4rem;
    text-decoration: none;
  }

  .glow-on-hover {
      border: none;
      outline: none;
      color: #fff;
      background: #111;
      cursor: pointer;
      z-index: 0;
      border-radius: 10px;
  }
  
  .glow-on-hover:before {
      content: '';
      background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
      position: absolute;
      top: -2px;
      left:-2px;
      background-size: 400%;
      z-index: -1;
      filter: blur(5px);
      width: calc(100% + 4px);
      height: calc(100% + 4px);
      animation: glowing 20s linear infinite;
      opacity: 0;
      transition: opacity .3s ease-in-out;
      border-radius: 10px;
  }
  
  .glow-on-hover:active {
      color: #000
  }
  
  .glow-on-hover:active:after {
      background: transparent;
  }
  
  .glow-on-hover:hover:before {
      opacity: 1;
  }
  
  .glow-on-hover:after {
      z-index: -1;
      content: '';
      position: absolute;
      width: 100%;
      height: 100%;
      background: #111;
      left: 0;
      top: 0;
      border-radius: 10px;
  }
  
  @keyframes glowing {
      0% { background-position: 0 0; }
      50% { background-position: 400% 0; }
      100% { background-position: 0 0; }
  }
}


section {
  background-color: var(--color-surface);
  border: 1px solid var(--color-muted);
  border-radius: 10px;
  width: 80%;
  margin: 20px auto;
  overflow: hidden;
  height: 70px;
  transition: height 0.4s ease-in;

  h2 {
    cursor: pointer;
    font-size: 2.5rem;
    color: white;
    text-align: center;
    background-color: var(--color-muted);
    margin-top: 0;
    padding: 20px;
    border-radius: 8px 8px 0 0;
  }
}

section.open {
  height: auto;
}

h3 {
  font-size: 2rem;
  margin: 5px 0 2px;
}

p, pre {
  font-size: 2rem;
}

/* Controls */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 100px;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.btn-control {
  padding: 10px 20px;
  border: 2px solid var(--color-muted);
  background-color: white;
  color: var(--color-muted);
  border-radius: 5px;
  cursor: pointer;
  font-size: 1.4rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-control:hover {
  background-color: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.btn-control.active {
  background-color: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

/* Range Control Styling */
.controls fieldset {
  border: 2px solid var(--color-muted);
  border-radius: 8px;
  padding: 15px;
  background-color: white;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 250px;
}

.controls fieldset label {
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--color-muted);
  margin-bottom: 5px;
  text-align: center;
}

.controls fieldset input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #ddd;
  outline: none;
  appearance: none;
  transition: background 0.3s ease;
}

.controls fieldset input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.controls fieldset input[type="range"]::-webkit-slider-thumb:hover {
  background: var(--color-primary);
  transform: scale(1.1);
}

.controls fieldset input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.controls fieldset input[type="range"]::-moz-range-thumb:hover {
  background: var(--color-primary);
  transform: scale(1.1);
}

.controls fieldset .range-value {
  font-size: 1.2rem;
  color: var(--color-accent);
  font-weight: bold;
  text-align: center;
  margin-top: 5px;
}

/* Flex Containers */
.flex-container {
  background: var(--color-surface);
  border: 2px dashed var(--color-muted);
  margin: 20px 100px;
  padding: 20px;
  min-height: 300px;
  display: flex;
  transition: all 0.3s ease;
  border-radius: 8px;
}

.flex-container.tall {
  min-height: 400px;
}

.flex-container.narrow {
  width: 400px;
  max-width: 400px;
}

.flex-container.wrap {
  flex-wrap: wrap;
}

/* Flex Items */
.flex-item {
  background-color: var(--color-accent);
  color: white;
  padding: 20px;
  margin: 5px;
  border-radius: 5px;
  font-size: 1.6rem;
  font-weight: bold;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  transition: all 0.3s ease;
}

.flex-item.wide {
  width: 200px;
}

/* Order demonstration - different colors for each item */
.order-item-1 {
  background-color: #ef4444 !important; /* Red */
}

.order-item-2 {
  background-color: #3b82f6 !important; /* Blue */
}

.order-item-3 {
  background-color: #10b981 !important; /* Green */
}

.order-item-4 {
  background-color: #f59e0b !important; /* Orange */
}

/* Explanation and Code sections */
.explicacao {
  background-color: #99fada;
  border: 1px solid #10b981;
  margin: 0 100px;
  padding: 0 20px;
  border-radius: 5px;
}

.codigo {
  background-color: #373737;
  margin: 0px 100px;
  padding: 5px 20px;
  color: whitesmoke;
  border-radius: 5px;
}

.propriedade {
  color: #FCE694;
}

.seletor {
  color: #C7DFC5;
}

.valor {
  color: #F6FEAA;
}

.current-value {
  color: var(--color-accent);
  font-weight: bold;
}

/* Specific states for demonstrations */
[data-demo="flex-direction"][style*="flex-direction: row"] {
  flex-direction: row;
}

[data-demo="flex-direction"][style*="flex-direction: row-reverse"] {
  flex-direction: row-reverse;
}

[data-demo="flex-direction"][style*="flex-direction: column"] {
  flex-direction: column;
}

[data-demo="flex-direction"][style*="flex-direction: column-reverse"] {
  flex-direction: column-reverse;
}

[data-demo="flex-wrap"][style*="flex-wrap: nowrap"] {
  flex-wrap: nowrap;
}

[data-demo="flex-wrap"][style*="flex-wrap: wrap"] {
  flex-wrap: wrap;
}

[data-demo="flex-wrap"][style*="flex-wrap: wrap-reverse"] {
  flex-wrap: wrap-reverse;
}

[data-demo="flex-wrap"] .flex-item {
  min-width: 80px;
}