/* ===== WIDGET CORNER TRIGGERS ===== */

.widget-trigger {
  position: fixed;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
}
.widget-trigger.tl { top: 16px;    left: 16px;  }
.widget-trigger.tr { top: 16px;    right: 16px; }
.widget-trigger.bl { bottom: 16px; left: 16px;  }
.widget-trigger.br { bottom: 16px; right: 16px; }

/* Rounded-square icon button */
.widget-icon-btn {
  min-width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--blurple);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-family: Apfel Grotesk, Arial, sans-serif;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0 10px;
  transition: background 0.15s;
  box-shadow:
    0 3px 6px rgba(7, 16, 1, 0.28),
    0 5px 14px rgba(7, 16, 1, 0.15),
    inset 0 1px 4px rgba(255, 255, 255, 0.25),
    inset 0 -2px 5px rgba(0, 0, 0, 0.15);
}
.widget-icon-btn:hover {
  background: var(--black);
  transform: translateY(1px);
  box-shadow:
    0 2px 4px rgba(7, 16, 1, 0.25),
    0 3px 10px rgba(7, 16, 1, 0.12),
    inset 0 1px 3px rgba(255, 255, 255, 0.2),
    inset 0 -1px 3px rgba(0, 0, 0, 0.15);
}
.widget-icon-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 3px rgba(7,16,1,0.2), inset 0 1px 3px rgba(255,255,255,0.15);
}

/* Hover-reveal pill label — hidden until trigger is hovered */
.widget-pill-label {
  background: #fff;
  color: var(--blurple);
  border: 2px solid var(--blurple);
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  font-family: Apfel Grotesk, Arial, sans-serif;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow:
    0 3px 10px rgba(59, 55, 255, 0.18),
    inset 0 -3px 8px #B5e6ff;
}

/* Left-side triggers: pill slides in from left, appears to the right of icon */
.widget-trigger.tl .widget-pill-label,
.widget-trigger.bl .widget-pill-label {
  transform: translateX(-6px);
}
.widget-trigger.tl:hover .widget-pill-label,
.widget-trigger.bl:hover .widget-pill-label {
  opacity: 1;
  transform: translateX(0);
}

/* Right-side triggers: pill slides in from right, appears to the left of icon */
.widget-trigger.tr .widget-pill-label,
.widget-trigger.br .widget-pill-label {
  transform: translateX(6px);
}
.widget-trigger.tr:hover .widget-pill-label,
.widget-trigger.br:hover .widget-pill-label {
  opacity: 1;
  transform: translateX(0);
}

/* ===== WIDGET CARDS ===== */

.widget-card {
  position: fixed;
  z-index: 199;
  background: var(--blurple);
  color: #fff;
  border-radius: 14px;
  padding: 10px 16px 14px;
  width: 220px;
  font-family: Apfel Grotesk, Arial, sans-serif;
  font-size: 14px;
  cursor: default;
  box-sizing: border-box;
  box-shadow:
    0 8px 32px rgba(7, 16, 1, 0.28),
    0 2px 10px rgba(7, 16, 1, 0.12),
    inset 0 1px 4px rgba(255, 255, 255, 0.18),
    inset 0 -1px 4px rgba(0, 0, 0, 0.12);

  opacity: 0;
  pointer-events: none;
  transform: scale(0.7);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Override the global span rule (main.css sets span { color: blurple; }) */
.widget-card span {
  color: inherit;
  font-weight: inherit;
}
.widget-card.open {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
  z-index: 201; /* above triggers (z-index: 200) */
}
.widget-card.dragging { transition: none; }

/* Scale-up origin matches each card's default corner */
#card-currently  { transform-origin: top left;    top: 16px;    left: 16px;  width: 280px; }
#card-playing    { transform-origin: top right;   top: 16px;    right: 16px; width: 300px; }
#card-doomscroll { transform-origin: bottom left;  bottom: 16px; left: 16px; width: 270px; }
#card-weather    { transform-origin: bottom right; bottom: 16px; right: 16px; width: 230px; }

/* ===== DRAG DOTS (draggability indicator) ===== */

.widget-drag-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 8px;
  padding-top: 2px;
  cursor: grab;
}
.widget-drag-dots:active { cursor: grabbing; }
.widget-drag-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(7, 16, 1, 0.45);
  display: block;
}

/* ===== CARD HEADER (drag handle) ===== */

.widget-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  cursor: grab;
}
.widget-card-header:active,
.widget-card.dragging .widget-card-header { cursor: grabbing; }

.widget-card-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(252, 248, 216, 0.75); /* --white at 75% opacity */
}
.widget-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  padding: 2px;
  line-height: 1;
  font-family: Apfel Grotesk, Arial, sans-serif;
  flex-shrink: 0;
  transition: opacity 0.1s, transform 0.1s;
}
.widget-close:hover { opacity: 0.7; transform: translateY(1px) scale(0.92); }
.widget-close:active { opacity: 0.5; transform: translateY(2px) scale(0.85); }

/* ===== CURRENTLY CARD ===== */

.widget-list {
  list-style: disc;
  padding: 0 0 0 20px;
  margin: 0;
}
.widget-list li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 0;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}
.widget-list li:last-child { border-bottom: none; }
.wi-icon { flex-shrink: 0; font-size: 13px; }
.widget-list a {
  color: #fff;
  text-underline-offset: 2px;
}
.widget-list a:hover { opacity: 0.75; }

/* ===== NOW PLAYING CARD ===== */

.playing-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.playing-ctrl-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  padding: 4px;
  opacity: 0.8;
  line-height: 1;
  transition: transform 0.1s, opacity 0.1s;
  border-radius: 4px;
}
.playing-ctrl-btn:hover { opacity: 1; transform: translateY(1px); }
.playing-ctrl-btn:active { transform: translateY(2px); opacity: 0.6; }

.playing-info { flex: 1; min-width: 0; }
.playing-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
}
.playing-title a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(255, 255, 255, 0.35);
}
.playing-title a:hover { text-decoration-color: rgba(255, 255, 255, 0.85); }

/* Marquee — two identical spans animate as one seamless loop */
.playing-marquee {
  display: flex;
  width: max-content;
  animation: playing-marquee-scroll var(--marquee-duration, 8s) linear infinite;
}
.playing-marquee span {
  flex-shrink: 0;
  padding-right: 48px;
}
/* Pause animation when card is closed to save resources */
.widget-card:not(.open) .playing-marquee {
  animation-play-state: paused;
}

@keyframes playing-marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.playing-artist { font-size: 11px; opacity: 0.75; }

/* Decorative progress bar */
.playing-bar {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 10px;
}
.playing-bar-fill {
  height: 100%;
  width: 42%;
  background: var(--lime);
  border-radius: 3px;
}

/* ===== DOOMSCROLL CARD ===== */

/* Sky blue container wrapping both the suggestion and the button */
.doomscroll-content {
  background: var(--sky);
  border-radius: 8px;
  overflow: hidden;
}

.doomscroll-body {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 10px 10px;
}
.doomscroll-emoji {
  font-size: 26px;
  line-height: 1.3;
  flex-shrink: 0;
}
.doomscroll-text {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  color: #fff;
}

/* "generate" button — sits at the bottom of the sky container, divided by a subtle line */
.widget-btn-next {
  width: 100%;
  background: transparent;
  border: none;
  border-top: 1px solid rgba(7, 16, 1, 0.12);
  color: rgba(7, 16, 1, 0.55);
  font-family: Apfel Grotesk, Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 9px;
  cursor: pointer;
  transition: background 0.15s;
  box-sizing: border-box;
  display: block;
}
.widget-btn-next:hover { background: rgba(7, 16, 1, 0.08); }

/* ===== WEATHER CARD ===== */

.weather-content {
  display: flex;
  align-items: center;
  gap: 10px;
}
.weather-icon { font-size: 26px; line-height: 1; flex-shrink: 0; }
.weather-right { flex: 1; min-width: 0; text-align: right; }
.weather-temp {
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 3px;
}
.weather-sub-row {
  font-size: 10px;
  color: rgba(252, 248, 216, 0.7);
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  line-height: 1.4;
}
.weather-dot { opacity: 0.4; }

/* ===== MOBILE ===== */

@media (max-width: 600px) {
  .widget-icon-btn    { min-width: 30px; height: 30px; font-size: 12px; border-radius: 7px; }
  .widget-pill-label  { font-size: 11px; }
  .widget-card        { width: min(260px, calc(100vw - 32px)); }
  #card-playing       { width: min(300px, calc(100vw - 32px)); }
  #card-doomscroll    { width: min(270px, calc(100vw - 32px)); }
  .doomscroll-text    { font-size: 20px; }
  .widget-list li     { font-size: 14px; }
}
