/* ============================================================================
   BASE LAYOUT
   ============================================================================ */

.html {
  background-color: var(--background);
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100svh;
  width: 100svw;
  margin: 0;
  background: url(../../assets/images/noise.png) repeat;
  background-color: var(--background);
}

/* ============================================================================
   CIRCLE COMPONENTS
   ============================================================================ */

.circle-border {
  position: absolute;
  height: var(--circle-size);
  width: var(--circle-size);
  max-height: var(--circle-max-size);
  max-width: var(--circle-max-size);
  border-radius: var(--border-radius-full);
  border: 1.5px var(--background) solid;
  pointer-events: none;
  z-index: 1;
}

.circle-container {
  position: relative;
  height: var(--circle-size);
  width: var(--circle-size);
  max-height: var(--circle-max-size);
  max-width: var(--circle-max-size);
  border-radius: var(--border-radius-full);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* ============================================================================
   SECTORS & ACTIVITIES
   ============================================================================ */

.sector {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  transform-origin: 50% 50%;
  clip-path: polygon(50% 0%, 50% 50%, 63.5% 0%);
  background-color: var(--empty-sector);
  contain: layout style;
  will-change: background-color;
}

.sector:hover {
  background-color: var(--background-hover);
}

.sector::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url(../../assets/images/noise-half.png) repeat;
  background-color: var(--background);
  mask-image: radial-gradient(circle, black 69%, transparent 69%);
}

.activity {
  position: absolute;
  top: 15%;
  width: 30%;
  font-size: var(--font-size-activity);
  line-height: var(--font-size-activity);
  font-weight: var(--font-weight-normal);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
  cursor: pointer;
}

.activity:focus {
  outline: none;
}

.first-half {
  text-align: right;
  transform: rotate(-85deg);
  left: 38%;
  padding: 0.5% 2.5% 6% 3%;
}

.second-half {
  text-align: left;
  transform: rotate(95deg);
  left: 38%;
  padding: 6% 2.5% 0.5% 3%;
}

/* ============================================================================
   CLOCK FACE
   ============================================================================ */

.clock-style {
  position: absolute;
  height: var(--circle-size);
  width: var(--circle-size);
  max-height: var(--circle-max-size);
  max-width: var(--circle-max-size);
  border-radius: var(--border-radius-full);
  z-index: 1;
  pointer-events: none;
}

.time {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  gap: 0.33%;
  margin-top: -0.5%;
  height: 101%;
  width: 1px;
  position: absolute;
  top: 0;
  left: 50%;
}

.hour {
  color: var(--text-secondary);
  font-size: var(--font-size-hour);
  line-height: 16px;
  text-align: center;
  width: 16px;
  height: 16px;
  background-color: var(--background);
  font-weight: var(--font-weight-normal);
}

.upside-down {
  transform: rotate(180deg);
}

.line {
  width: 1px;
  height: 100%;
  flex: 1;
  background-color: var(--border);
}

.tick {
  width: 3px;
  height: 2.25%;
  background-color: var(--background);
}

/* ============================================================================
   HOUR HAND
   ============================================================================ */

.hour-hand {
  position: absolute;
  width: var(--hour-hand-width);
  max-width: var(--hour-hand-max-width);
  height: 1.5px;
  background-color: var(--accent);
  top: var(--center-position);
  left: 50%;
  transform: rotate(-90deg);
  transform-origin: 0% 50%;
  transition: transform 2s ease-out;
  z-index: 2;
  border-radius: var(--border-radius-small);
  display: flex;
  justify-content: flex-end;
  color: var(--accent);
  contain: layout style;
  will-change: transform;
}

#hand-line {
  width: 1.5px;
  height: 11.5px;
  margin-top: -5px;
  margin-right: 6%;
  border-radius: var(--border-radius-small);
  background-color: var(--accent);
}

#center {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--border-radius-full);
  background-color: var(--background);
  top: var(--center-position);
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid var(--border);
  z-index: 3;
  text-align: center;
  color: var(--background-hover);
  font-size: 16px;
  font-weight: var(--font-weight-light);
  box-sizing: border-box;
  cursor: pointer;
}

/* ============================================================================
   DAY SELECTORS
   ============================================================================ */

.selectors {
  position: absolute;
  top: 3%;
  left: 50%;
  transform: translate(-50%, 0);
  display: flex;
  flex-direction: row;
  gap: 2px;
  padding: var(--gap-tiny);
  border-radius: var(--gap-large);
  background-color: var(--empty-sector);
}

.selector {
  border-radius: var(--border-radius-full);
  height: var(--selector-size);
  width: var(--selector-size);
  line-height: var(--selector-size);
  color: var(--text-secondary);
  text-align: center;
  cursor: pointer;
  font-size: var(--font-size-selector);
}

.selected {
  border-radius: var(--border-radius-full);
  background-color: var(--accent);
  color: var(--background);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

/* Tablet breakpoint */
@media (width < 768px) and (width >= 560px) {
  :root {
    --font-size-activity: 15px;
    --font-size-hour: 10px;
    --selector-size: 24px;
  }

  .selectors {
    top: 20px;
    left: 10px;
  }
}

/* Mobile breakpoint */
@media (width < 560px) {
  :root {
    --font-size-activity: 13px;
    --font-size-hour: 9px;
    --font-size-selector: 12px;
    --selector-size: 24px;
    --gap-small: 6px;
    --gap-medium: 8px;
    --gap-large: 20px;
  }

  .activity {
    padding: 0.3% 2% 4% 2.5% !important;
  }

  .first-half {
    padding: 0.3% 2% 4% 2.5%;
  }

  .second-half {
    padding: 4% 2% 0.3% 2.5%;
  }
}

/* Large screen optimization */
@media (width > 1200px) {
  :root {
    --circle-size: 80vw;
    --hour-hand-width: 40vw;
  }
}

/* Ultra-wide screens */
@media (width > 1600px) {
  :root {
    --circle-size: 60vw;
    --hour-hand-width: 30vw;
  }
}
