﻿/* ============================================
   DAILY STREAK MODAL STYLES
   Mirror pattern dari lucky-spin.css
   Prefix ds- untuk hindari konflik
   ============================================ */

:root {
  --ds-overlay: rgba(0, 0, 0, 0.6);
  --ds-bg: #ffffff;
  --ds-bg-card: #f8f9ff;
  --ds-text: #1a1a2e;
  --ds-text-muted: #6b7280;
  --ds-gold: #facc15;
  --ds-gold-dark: #eab308;
  --ds-claimed-bg: #fef9c3;
  --ds-claimed-border: #facc15;
  --ds-current-bg: #fff7ed;
  --ds-current-border: #fb923c;
  --ds-upcoming-bg: #f3f4f6;
  --ds-upcoming-border: #e5e7eb;
  --ds-gift-bg: linear-gradient(135deg, #fef3c7 0%, #fde68a 50%, #facc15 100%);
  --ds-gift-border: #eab308;
  --ds-radius: clamp(14px, 3vw, 22px);
  --ds-day-size: clamp(44px, 9vmin, 64px);
  --ds-day-font: clamp(10px, 2.2vmin, 12px);
  --ds-transition: 0.3s;
}

/* Overlay */
.modal-daily-streak {
  position: fixed;
  inset: 0;
  background: var(--ds-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10002;
  opacity: 0;
  visibility: hidden;
  transition: all var(--ds-transition) cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 16px;
  box-sizing: border-box;
  overflow-y: auto;
}

.modal-daily-streak.show {
  opacity: 1;
  visibility: visible;
}

/* Content card */
.ds-content {
  background: var(--ds-bg);
  border-radius: var(--ds-radius);
  padding: clamp(16px, 3vw, 24px) clamp(14px, 3vw, 20px) clamp(14px, 3vw, 18px);
  width: 100%;
  max-width: min(720px, calc(100vw - 32px));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04);
  border: 2px solid #ffffff;
  transform: scale(0.92) translateY(12px);
  transition: transform var(--ds-transition) cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  text-align: center;
}

.modal-daily-streak.show .ds-content {
  transform: scale(1) translateY(0);
}

/* Close */
.ds-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: #374151;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ds-transition) ease, transform var(--ds-transition) ease;
  z-index: 2;
}

.ds-close:hover {
  background: rgba(0, 0, 0, 0.12);
  transform: scale(1.06);
}

/* Title */
.ds-title {
  font-family: 'Poppins', 'Vend Sans', sans-serif;
  font-size: clamp(14px, 3.8vw, 20px);
  font-weight: 700;
  color: var(--ds-text);
  margin: 4px 24px 16px;
  line-height: 1.3;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.ds-fire {
  font-size: 1.1em;
  vertical-align: middle;
}

/* Track - 7 days */
.ds-track {
  display: flex;
  gap: clamp(6px, 1.5vw, 10px);
  justify-content: space-between;
  align-items: flex-start;
  margin: 0 auto 16px;
  flex-wrap: nowrap;
}

.ds-day {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: clamp(8px, 1.5vw, 10px) clamp(4px, 1vw, 6px);
  border-radius: 14px;
  border: 2px solid var(--ds-upcoming-border);
  background: var(--ds-upcoming-bg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ds-day-icon {
  width: var(--ds-day-size);
  height: var(--ds-day-size);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(22px, 5vmin, 32px);
  line-height: 1;
  background: transparent;
  border: 1.5px solid #e5e7eb;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.ds-day-label {
  font-family: 'Poppins', sans-serif;
  font-size: var(--ds-day-font);
  font-weight: 600;
  color: var(--ds-text);
  line-height: 1;
}

.ds-day-reward {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(11px, 2.4vmin, 13px);
  font-weight: 700;
  color: var(--ds-text);
  line-height: 1;
}

/* States */
.ds-day--claimed {
  background: var(--ds-claimed-bg);
  border-color: var(--ds-claimed-border);
}

.ds-day--claimed .ds-day-icon {
  background: transparent;
  border-color: #fde68a;
}

.ds-day--current {
  background: var(--ds-upcoming-bg);
  border-color: var(--ds-upcoming-border);
  box-shadow: none;
  transform: none;
  animation: none;
  opacity: 0.9;
}

.ds-day--current .ds-day-icon {
  background: transparent;
  border-color: #e5e7eb;
  opacity: 0.85;
}

.ds-day--gift {
  background: var(--ds-gift-bg);
  border-color: var(--ds-gift-border);
  box-shadow: 0 4px 14px rgba(234, 179, 8, 0.28);
}

.ds-day--gift .ds-day-icon {
  background: transparent;
  border-color: #facc15;
  font-size: clamp(26px, 5.5vmin, 36px);
}

.ds-day--upcoming {
  opacity: 0.9;
}

.ds-day--upcoming .ds-day-icon {
  opacity: 0.85;
}

@keyframes ds-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(251,146,60,0.18), 0 4px 12px rgba(251,146,60,0.2); }
  50% { box-shadow: 0 0 0 4px rgba(251,146,60,0.28), 0 6px 16px rgba(251,146,60,0.3); }
}

/* Hint */
.ds-hint {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(11px, 2.8vw, 13px);
  font-weight: 500;
  color: var(--ds-text-muted);
  margin: 0;
  line-height: 1.4;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  border-radius: 10px;
  padding: 10px 12px;
}

@media (max-width: 600px) {
  .ds-track {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
  .ds-day {
    flex: 0 1 calc(25% - 6px);
    max-width: calc(25% - 6px);
    padding: 8px 4px;
    border-radius: 12px;
  }
    .ds-title {
        font-size: clamp(13px, 4vw, 16px);
        margin-bottom: 12px;
        padding-right: 1rem;
    }
  .ds-day-label {
    font-size: 10px;
  }
  .ds-day-reward {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  :root {
    --ds-day-size: clamp(40px, 11vmin, 52px);
  }
  .ds-track {
    gap: 1rem;
  }
  .ds-day {
    flex: 0 1 calc(25% - 5px);
    max-width: calc(25% - 5px);
    gap: 4px;
    padding: 6px 3px;
  }
  .ds-day-icon {
    border-radius: 10px;
  }
}

@media (max-width: 380px) {
  .ds-content {
    padding: 14px 10px 12px;
  }
  .ds-track {
    gap: 1rem;
  }
  .ds-day {
    flex: 0 1 calc(25% - 4px);
    max-width: calc(25% - 4px);
  }
  .ds-day-label {
    font-size: 9px;
  }
  .ds-day-reward {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ds-day--current {
    animation: none;
  }
  .modal-daily-streak,
  .ds-content {
    transition-duration: 0.1s;
  }
}
