/* =====================================================
   SAATDURUM — STUDY STREAK & FREEZE SYSTEM STYLES v2.0
   Theme Studio & Liquid Glass Integrated — YKS Academic Discipline
   ===================================================== */

/* ── 1. PROFILE STREAK CARD ── */
.streak-profile-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
}

.streak-profile-card:hover {
  border-color: rgba(255, 140, 0, 0.4);
}

.streak-profile-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #ff7a00, #ff4500, #ffb300);
  opacity: 0.85;
}

.streak-card-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.streak-hero-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.streak-flame-badge {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.18), rgba(255, 69, 0, 0.08));
  border: 1px solid rgba(255, 120, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(255, 107, 0, 0.15);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.streak-flame-badge.active {
  background: linear-gradient(135deg, rgba(255, 120, 0, 0.25), rgba(255, 50, 0, 0.15));
  border-color: rgba(255, 140, 0, 0.6);
  animation: streakFlamePulse 2.4s infinite ease-in-out;
}

@keyframes streakFlamePulse {
  0%, 100% {
    box-shadow: 0 0 12px rgba(255, 110, 0, 0.2);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 110, 0, 0.45);
    transform: scale(1.04);
  }
}

.streak-flame-icon {
  font-size: 22px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(255, 80, 0, 0.4));
}

.streak-number {
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-mono, monospace);
  color: #ff9800;
  line-height: 1;
  margin-top: 1px;
}

.streak-hero-meta {
  flex: 1;
  min-width: 0;
}

.streak-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.streak-main-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-p);
  margin: 0;
  letter-spacing: -0.01em;
}

.streak-pills-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.streak-rest-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 20px;
  padding: 2px 8px;
  user-select: none;
}

.streak-freeze-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 20px;
  padding: 2px 8px;
  user-select: none;
}

.streak-motto {
  font-size: 12px;
  color: var(--text-s);
  margin: 4px 0 0;
  line-height: 1.4;
  font-weight: 500;
}

.streak-history-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-s);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.streak-history-btn:hover {
  color: var(--text-p);
  border-color: var(--accent);
  background: var(--bg-mid);
}

/* ── 2. TODAY REQUIREMENT PROGRESS BOX ── */
.streak-progress-box {
  background: var(--bg-mid);
  border: 1px solid var(--border-light, rgba(255, 255, 255, 0.06));
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 14px;
}

.streak-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
}

.streak-progress-lbl {
  color: var(--text-s);
}

.streak-progress-val {
  color: var(--text-p);
  font-weight: 700;
}

.streak-progress-track {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.streak-progress-bar {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #ff9800, #ff5722);
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.streak-progress-bar.completed {
  background: linear-gradient(90deg, #10b981, #059669);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* ── 3. WEEKLY 7-DAY STRIP ── */
.streak-weekly-strip-wrap {
  margin-bottom: 14px;
}

.streak-weekly-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.streak-week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  background: var(--bg-mid);
  border: 1px solid var(--border-light, rgba(255, 255, 255, 0.05));
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.streak-week-day:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.streak-week-day.is-today {
  border-color: rgba(255, 140, 0, 0.5);
  background: rgba(255, 140, 0, 0.06);
}

.streak-day-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-m);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.streak-day-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  transition: all 0.2s ease;
}

/* Qualified status */
.streak-week-day.qualified .streak-day-circle {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Rest status (Weekly Rest Day ☕) */
.streak-week-day.rest .streak-day-circle {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Frozen status */
.streak-week-day.frozen .streak-day-circle {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

/* In-progress status (Today) */
.streak-week-day.in_progress .streak-day-circle {
  background: rgba(255, 152, 0, 0.2);
  color: #ff9800;
  border: 1px dashed rgba(255, 152, 0, 0.6);
  animation: streakRotatePending 6s infinite linear;
}

/* Missed status */
.streak-week-day.missed .streak-day-circle {
  background: rgba(239, 68, 68, 0.08);
  color: var(--text-m);
  border: 1px solid rgba(239, 68, 68, 0.15);
  font-size: 10px;
  opacity: 0.7;
}

.streak-day-num {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-s);
  font-family: var(--font-mono, monospace);
}

/* ── 4. CARD FOOTER STATS ── */
.streak-footer-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light, rgba(255, 255, 255, 0.06));
}

.streak-fstat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.streak-fstat-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-m);
}

.streak-fstat-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-p);
}

.streak-fstat-val.text-success {
  color: #10b981;
}

.streak-fstat-val.text-accent {
  color: var(--accent);
}

/* ── 5. STREAK DETAIL & MONTHLY CALENDAR MODAL ── */
.streak-detail-dialog {
  max-width: 520px;
  width: 95%;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.streak-detail-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.streak-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.streak-stats-row.four-cols {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 480px) {
  .streak-stats-row.four-cols {
    grid-template-columns: repeat(2, 1fr);
  }
}

.streak-stat-card {
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
}

.streak-stat-val {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-p);
}

.streak-stat-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-s);
  margin-top: 2px;
}

.streak-cal-section {
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.streak-cal-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.streak-cal-month-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-p);
  margin: 0;
}

.streak-cal-nav-btns {
  display: flex;
  gap: 4px;
}

.streak-cal-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.streak-cal-hdr-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-m);
  text-transform: uppercase;
}

.streak-cal-cells-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-s);
}

.cal-day-cell:hover:not(.empty) {
  border-color: var(--accent);
  background: var(--bg-hover);
  transform: scale(1.06);
  z-index: 2;
}

.cal-day-cell.empty {
  cursor: default;
  background: transparent;
}

.cal-day-cell.qualified {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #10b981;
}

.cal-day-cell.rest {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #f59e0b;
}

.cal-day-cell.frozen {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.cal-day-cell.in_progress {
  background: rgba(255, 152, 0, 0.15);
  border-color: rgba(255, 152, 0, 0.5);
  color: #ff9800;
}

.cal-day-cell.is-today {
  box-shadow: 0 0 0 2px var(--accent);
}

.cal-cell-icon {
  font-size: 9px;
  line-height: 1;
  margin-top: 1px;
}

.streak-cal-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light, rgba(255, 255, 255, 0.06));
  font-size: 11px;
  color: var(--text-s);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.qualified { background: #10b981; }
.legend-dot.rest { background: #f59e0b; }
.legend-dot.frozen { background: #38bdf8; }
.legend-dot.partial { background: #ef4444; }
.legend-dot.today { background: #ff9800; }

/* ── 6. HISTORICAL STREAKS LIST ── */
.streak-history-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.streak-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-p);
  margin: 0;
}

.streak-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.streak-hist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.streak-hist-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.streak-hist-flame {
  font-size: 14px;
}

.streak-hist-days {
  font-weight: 700;
  color: var(--text-p);
}

.streak-hist-date {
  color: var(--text-s);
  font-size: 11px;
  font-family: var(--font-mono, monospace);
}

.streak-hist-empty {
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: var(--text-m);
}

/* ── 7. CELEBRATION POPUP MODAL ── */
.streak-celeb-backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.streak-celeb-dialog {
  position: relative;
  max-width: 380px;
  width: 90%;
  background: var(--bg-card);
  border: 1px solid rgba(255, 140, 0, 0.4);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(255, 100, 0, 0.25);
  animation: streakPopIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

@keyframes streakPopIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.streak-celeb-glow {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 120, 0, 0.35) 0%, rgba(255, 80, 0, 0) 70%);
  pointer-events: none;
}

.streak-celeb-flame-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 140, 0, 0.3), rgba(255, 60, 0, 0.15));
  border: 1px solid rgba(255, 140, 0, 0.6);
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(255, 100, 0, 0.35);
  animation: streakFlameJump 0.6s infinite alternate ease-in-out;
}

@keyframes streakFlameJump {
  from { transform: translateY(0); }
  to { transform: translateY(-6px); }
}

.streak-celeb-flame-icon {
  font-size: 32px;
  line-height: 1;
}

.streak-celeb-badge-count {
  font-size: 13px;
  font-weight: 800;
  color: #ff9800;
  font-family: var(--font-mono, monospace);
  line-height: 1;
}

.streak-celeb-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-p);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.streak-celeb-desc {
  font-size: 13px;
  color: var(--text-s);
  margin: 0 0 20px;
  line-height: 1.5;
}

.streak-celeb-btn {
  width: 100%;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #ff8c00, #ff5722);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 87, 34, 0.35);
  transition: all 0.2s ease;
}

.streak-celeb-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 87, 34, 0.5);
}

/* ── 8. RESPONSIVE OPTIMIZATIONS ── */
@media (max-width: 480px) {
  .streak-profile-card {
    padding: 14px 14px;
  }
  .streak-flame-badge {
    width: 44px;
    height: 44px;
  }
  .streak-flame-icon {
    font-size: 18px;
  }
  .streak-main-title {
    font-size: 15px;
  }
  .streak-weekly-strip {
    gap: 4px;
  }
  .streak-week-day {
    padding: 6px 2px;
  }
  .streak-day-circle {
    width: 22px;
    height: 22px;
    font-size: 10px;
  }
}
