/* Güneş tarafı — panel içi animasyonlu şerit + compact chip */

.sun-exposure {
  --sun-amber: #e8950a;
  --sun-amber-bright: #fbbf24;
  --sun-amber-deep: #c27803;
  --sun-glow: color-mix(in srgb, var(--sun-amber-bright) 35%, transparent);
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  position: relative;
}

.sun-exposure[hidden] {
  display: none !important;
}

/* ── Job panel embedded strip ── */
.job-sun-exposure-host {
  margin: 0 0 10px;
}

.job-sun-exposure-host:has([hidden]) {
  margin: 0;
}

.sun-exposure--panel {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--sun-amber) 26%, var(--border));
  background: color-mix(in srgb, var(--surface-solid, var(--surface)) 88%, #fff7ed);
  overflow: hidden;
  opacity: 0;
  transform: translateY(6px);
}

.sun-exposure--panel.is-visible {
  animation: sun-panel-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes sun-panel-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.sun-exposure__wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background: radial-gradient(
    120% 140% at 50% 50%,
    var(--sun-glow),
    transparent 62%
  );
  transition: background-position 0.6s ease, opacity 0.4s ease;
}

.sun-exposure--panel.is-left .sun-exposure__wash {
  background: radial-gradient(
    90% 120% at 12% 50%,
    color-mix(in srgb, var(--sun-amber-bright) 42%, transparent),
    transparent 58%
  );
  animation: sun-wash-breathe 3.2s ease-in-out infinite;
}

.sun-exposure--panel.is-right .sun-exposure__wash {
  background: radial-gradient(
    90% 120% at 88% 50%,
    color-mix(in srgb, var(--sun-amber-bright) 42%, transparent),
    transparent 58%
  );
  animation: sun-wash-breathe 3.2s ease-in-out infinite;
}

.sun-exposure--panel.is-front .sun-exposure__wash,
.sun-exposure--panel.is-back .sun-exposure__wash {
  background: radial-gradient(
    80% 100% at 50% 40%,
    color-mix(in srgb, var(--sun-amber-bright) 36%, transparent),
    transparent 60%
  );
  animation: sun-wash-breathe 3.2s ease-in-out infinite;
}

@keyframes sun-wash-breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

/* Sliding sunbeam */
.sun-exposure__beam {
  position: absolute;
  top: -20%;
  bottom: -20%;
  width: 42%;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--sun-amber-bright) 28%, transparent),
    transparent
  );
  filter: blur(1px);
  transform: skewX(-12deg);
}

.sun-exposure--panel.is-left .sun-exposure__beam {
  left: -8%;
  opacity: 1;
  animation: sun-beam-drift-left 4.5s ease-in-out infinite;
}

.sun-exposure--panel.is-right .sun-exposure__beam {
  right: -8%;
  left: auto;
  opacity: 1;
  animation: sun-beam-drift-right 4.5s ease-in-out infinite;
}

@keyframes sun-beam-drift-left {
  0%, 100% { transform: skewX(-12deg) translateX(0); opacity: 0.35; }
  50% { transform: skewX(-12deg) translateX(10px); opacity: 0.7; }
}

@keyframes sun-beam-drift-right {
  0%, 100% { transform: skewX(-12deg) translateX(0); opacity: 0.35; }
  50% { transform: skewX(-12deg) translateX(-10px); opacity: 0.7; }
}

/* Orb */
.sun-exposure__orb {
  position: relative;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  z-index: 1;
}

.sun-exposure__orb-core {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fde68a, var(--sun-amber-bright) 45%, var(--sun-amber-deep));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--sun-amber-bright) 40%, transparent),
    0 0 12px var(--sun-glow);
  animation: sun-orb-pulse 2.4s ease-in-out infinite;
}

.sun-exposure__orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--sun-amber-bright) 45%, transparent);
  animation: sun-orb-spin 8s linear infinite;
  border-top-color: transparent;
  border-left-color: color-mix(in srgb, var(--sun-amber-bright) 70%, transparent);
}

.sun-exposure--panel.is-left .sun-exposure__orb {
  animation: sun-orb-nudge-left 3.6s ease-in-out infinite;
}

.sun-exposure--panel.is-right .sun-exposure__orb {
  animation: sun-orb-nudge-right 3.6s ease-in-out infinite;
}

@keyframes sun-orb-pulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.06); filter: brightness(1.08); }
}

@keyframes sun-orb-spin {
  to { transform: rotate(360deg); }
}

@keyframes sun-orb-nudge-left {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-3px); }
}

@keyframes sun-orb-nudge-right {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(3px); }
}

.sun-exposure__copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  z-index: 1;
}

.sun-exposure__eyebrow {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--sun-amber-deep) 70%, var(--muted, var(--text-muted)));
}

.sun-exposure__label {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.sun-exposure__pct {
  z-index: 1;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted, var(--text-muted));
}

/* L——●——R track */
.sun-exposure__track {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  z-index: 1;
  flex-shrink: 0;
}

.sun-exposure__track-label {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--muted, var(--text-muted));
  opacity: 0.55;
  transition: color 0.3s ease, opacity 0.3s ease;
}

.sun-exposure--panel.is-left .sun-exposure__track-label--l,
.sun-exposure--panel.is-right .sun-exposure__track-label--r {
  opacity: 1;
  color: var(--sun-amber-deep);
}

.sun-exposure__track-rail {
  position: relative;
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 80%, transparent);
  overflow: visible;
}

.sun-exposure__track-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--sun-amber-bright);
  box-shadow: 0 0 0 3px var(--sun-glow);
  transition: left 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.sun-exposure--panel.is-left .sun-exposure__track-knob {
  left: 12%;
  animation: sun-knob-glow 2s ease-in-out infinite;
}

.sun-exposure--panel.is-right .sun-exposure__track-knob {
  left: 88%;
  animation: sun-knob-glow 2s ease-in-out infinite;
}

.sun-exposure--panel.is-front .sun-exposure__track-knob,
.sun-exposure--panel.is-back .sun-exposure__track-knob {
  left: 50%;
}

@keyframes sun-knob-glow {
  0%, 100% { box-shadow: 0 0 0 3px var(--sun-glow); }
  50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--sun-amber-bright) 28%, transparent); }
}

.sun-exposure--panel:hover,
.sun-exposure--panel:focus-visible {
  border-color: color-mix(in srgb, var(--sun-amber) 45%, var(--border));
  outline: none;
}

.sun-exposure--panel:focus-visible {
  box-shadow: 0 0 0 3px var(--sun-glow);
}

/* ── Planner compact ── */
.sun-exposure--compact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--sun-amber) 28%, var(--border));
  background: color-mix(in srgb, var(--sun-glow) 40%, var(--surface-solid, var(--surface)));
}

.sun-exposure__orb--mini {
  width: 16px;
  height: 16px;
}

.sun-exposure__orb--mini .sun-exposure__orb-core {
  inset: 2px;
  animation: sun-orb-pulse 2.4s ease-in-out infinite;
}

.sun-exposure--compact .sun-exposure__label {
  font-size: 0.75rem;
  font-weight: 750;
}

.sun-exposure--compact .sun-exposure__pct {
  font-size: 0.7rem;
}

.sun-exposure__sep {
  color: var(--muted, var(--text-muted));
  opacity: 0.7;
  font-size: 0.7rem;
}

.sun-exposure--compact.is-left {
  box-shadow: inset 3px 0 0 var(--sun-amber);
}

.sun-exposure--compact.is-right {
  box-shadow: inset -3px 0 0 var(--sun-amber);
}

.tl-sun-exposure {
  padding-left: 28px;
  margin: 0 0 4px;
}

.tl-sun-exposure .sun-exposure {
  margin-top: 0;
}

/* Info modal */
.sun-exposure-info-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sun-exposure-info-text {
  margin: 0 0 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted, var(--text-muted));
}

.sun-exposure-info-ok {
  font-weight: 700;
}

:root[data-theme="dark"] .sun-exposure--panel {
  background: color-mix(in srgb, rgba(251, 191, 36, 0.1) 55%, var(--surface-solid, var(--surface)));
  border-color: color-mix(in srgb, var(--sun-amber-bright) 28%, var(--border));
}

:root[data-theme="dark"] .sun-exposure__eyebrow {
  color: color-mix(in srgb, var(--sun-amber-bright) 75%, var(--muted, var(--text-muted)));
}

:root[data-theme="dark"] .sun-exposure--compact {
  background: color-mix(in srgb, rgba(251, 191, 36, 0.14) 60%, var(--surface-solid, var(--surface)));
}

@media (max-width: 380px) {
  .sun-exposure--panel {
    grid-template-columns: auto 1fr auto;
    gap: 8px 10px;
  }

  .sun-exposure--panel .sun-exposure__track {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sun-exposure--panel,
  .sun-exposure--panel.is-visible,
  .sun-exposure__wash,
  .sun-exposure__beam,
  .sun-exposure__orb,
  .sun-exposure__orb-core,
  .sun-exposure__orb-ring,
  .sun-exposure__track-knob {
    animation: none !important;
    transition: none !important;
  }

  .sun-exposure--panel.is-visible {
    opacity: 1;
    transform: none;
  }
}
