/* Session Feedback Modal - Premium Refinement */

/* Dimmed & Blurred Overlay */
#feedback-modal-overlay {
  z-index: 9999;
  backdrop-filter: blur(10px);
  background-color: rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feedback-modal {
  display: flex;
  flex-direction: column;
  gap: 1.5vh;
  text-align: center;
  padding: clamp(1.5rem, 4vh, 3rem) 2rem;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
  color: #fff;
  border-radius: 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  width: 95%;
  max-width: 480px;
  max-height: 95vh; /* 화면 높이를 넘어가지 않도록 제한 */
  
  transform: translateY(30px) scale(0.9);
  animation: modalPopEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Close Button (x) in top-right */
.feedback-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.6);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 20;
}

.feedback-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: scale(1.1);
}

@keyframes modalPopEntrance {
  0% { opacity: 0; transform: translateY(40px) scale(0.85); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Atmosphere States for Modal */
.feedback-modal {
  transition: background 0.6s ease, border-color 0.6s ease, box-shadow 0.6s ease, filter 0.6s ease;
}

/* 🔥 Best State: Warm Amber/Flow */
.feedback-modal.state-best {
  background: radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.2), #1e1b4b 70%), 
              linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 25px 50px -12px rgba(245, 158, 11, 0.2);
}

/* 🙂 Good State: Fresh Mint/Calm */
.feedback-modal.state-good {
  background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.15), #1e1b4b 70%), 
              linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 25px 50px -12px rgba(16, 185, 129, 0.15);
}

/* ☁️ Bad State: Foggy/Slate */
.feedback-modal.state-bad {
  background: #25262b;
  background-image: radial-gradient(circle at 50% 30%, rgba(148, 163, 184, 0.1), transparent 80%);
  border-color: rgba(148, 163, 184, 0.2);
  filter: grayscale(0.2) contrast(0.9);
}

.feedback-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.5;
}

.feedback-content-wrapper {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 1.2vh;
}

.feedback-emoji-decoration {
  font-size: clamp(2.5rem, 6vh, 4rem);
  margin-bottom: 0.25rem;
}

.feedback-title {
  font-size: clamp(1.4rem, 4vh, 2.2rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
}

/* Mobile Responsive Adjustments */
@media (max-width: 480px) {
  .feedback-modal {
    padding: 2vh 1.5rem;
  }
  .feedback-title {
    font-size: 1.6rem; /* 모바일에서 텍스트 크기 축소 */
  }
  .emoji-btn {
    width: 84px;
    height: 84px;
  }
  .emoji-icon {
    font-size: 2.22rem;
  }
}

.feedback-task-name {
  font-size: clamp(0.9rem, 2vh, 1.1rem);
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.feedback-summary-container {
  margin-top: 1vh;
  margin-bottom: 1.5vh;
}

.feedback-total-time {
  font-size: clamp(1.2rem, 3vh, 1.6rem);
  font-weight: 900;
  color: #fff;
}

.feedback-session-count {
  font-size: clamp(0.75rem, 1.5vh, 0.9rem);
  color: rgba(255, 255, 255, 0.6);
  margin-top: 2px;
}

.feedback-session-list {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 10px;
  max-height: 12vh; /* 높이에 비례하여 리스트 영역 제한 */
  overflow-y: auto;
  text-align: left;
  margin-bottom: 0.5vh;
}

/* 🎨 다크 모드 맞춤형 세련된 스크롤바 */
.feedback-session-list::-webkit-scrollbar {
  width: 6px;
}

.feedback-session-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.feedback-session-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.feedback-session-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.session-history-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
}

.session-history-item.is-current {
  color: #60a5fa;
  font-weight: 800;
}

.feedback-question {
  font-size: clamp(1rem, 2vh, 1.2rem);
  font-weight: 700;
  color: #fff;
  margin: 0.5vh 0;
}

/* Emoji Rating Component - Modal */
.emoji-rating-container {
  display: flex;
  justify-content: center;
  gap: clamp(0.5rem, 3vw, 1.5rem);
}

.emoji-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: clamp(72px, 12vh, 96px);
  height: clamp(72px, 12vh, 96px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.emoji-icon {
  font-size: clamp(1.8rem, 4.5vh, 2.8rem);
  filter: grayscale(0.5) opacity(0.7);
  transition: all 0.3s ease;
}

.emoji-label {
  font-size: clamp(0.65rem, 1.2vh, 0.75rem);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 2px;
}

/* Selected State in Modal */
.emoji-btn.selected {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.emoji-btn.selected .emoji-icon {
  filter: grayscale(0) opacity(1) drop-shadow(0 0 8px rgba(255,255,255,0.5));
  transform: scale(1.1);
}

.emoji-btn.selected .emoji-label {
  color: #fff;
}

/* Color specific highlights for selected buttons */
.emoji-btn.selected[data-rating="focus"] { border-color: #ef4444; color: #ef4444; box-shadow: 0 0 20px rgba(239, 68, 68, 0.3); }
.emoji-btn.selected[data-rating="normal"] { border-color: #f59e0b; color: #f59e0b; box-shadow: 0 0 20px rgba(245, 158, 11, 0.3); }
.emoji-btn.selected[data-rating="distracted"] { border-color: #9ca3af; color: #9ca3af; box-shadow: 0 0 20px rgba(156, 163, 175, 0.3); }


/* DASHBOARD LIST ITEM STATES - "Ambient Emotion" */

/* Common completed style adjustments */
.timeline-event.completed, .unscheduled-session-chip.completed {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, background 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
}

/* 1. 🔥 최고였어요 (Best State) */
.rating-focus {
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.15) !important;
}

.rating-focus:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: rgba(239, 68, 68, 0.8) !important;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4) !important;
  animation: pulseGlow 1.5s infinite alternate !important;
}

@keyframes pulseGlow {
  from { box-shadow: 0 0 8px rgba(239, 68, 68, 0.3); }
  to { box-shadow: 0 0 18px rgba(239, 68, 68, 0.6); }
}

/* 2. 🙂 해냈어요 (Good State) */
.rating-normal {
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.rating-normal:hover {
  transform: scale(1.02);
}

.rating-normal:hover .event-icon, 
.rating-normal:hover .unscheduled-chip-icon {
  animation: nodEmoji 0.6s ease-in-out infinite;
}

@keyframes nodEmoji {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(5deg); }
}

/* 3. ☁️ 좀 아쉬웠어요 (Bad State) */
.rating-distracted {
  opacity: 0.7;
  filter: grayscale(0.8);
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.rating-distracted:hover {
  opacity: 1;
  filter: grayscale(0.2);
  animation: tinyShake 0.4s ease-in-out infinite;
}

@keyframes tinyShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

/* 4. ⚪ 평가 안 함 (Neutral State) */
.timeline-event.completed:not([class*='rating-']),
.unscheduled-session-chip.completed:not([class*='rating-']) {
  border: 1px solid rgba(156, 163, 175, 0.3) !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

.timeline-event.completed:not([class*='rating-']):hover,
.unscheduled-session-chip.completed:not([class*='rating-']):hover {
  background: rgba(255, 255, 255, 0.12) !important;
  cursor: pointer;
}

/* Session Detail Modal Action Buttons - Disabled State */
.session-action-btn:disabled {
  opacity: 0.35 !important;
  filter: grayscale(1) !important;
  cursor: not-allowed !important;
  pointer-events: none;
}

/* ===== Reading Page Input (Feedback Modal) ===== */
.reading-page-input-container {
  margin-top: 1vh;
  padding: 0.8vh 1rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.reading-page-input-container .feedback-input-label {
  display: block;
  color: rgba(255, 255, 255, 0.85);
  font-size: clamp(0.85rem, 1.5vh, 0.95rem);
  font-weight: 600;
  margin-bottom: 0.5vh;
  text-align: center;
}

.reading-page-input-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.reading-page-number-input {
  width: 80px !important;
  padding: 10px 12px;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: #fff;
  outline: none;
  transition: all 0.2s ease;
  -moz-appearance: textfield;
  appearance: textfield;
}

.reading-page-number-input::-webkit-outer-spin-button,
.reading-page-number-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.reading-page-number-input:focus {
  border-color: rgba(99, 102, 241, 0.6);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.reading-page-number-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.reading-page-suffix {
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
}

.reading-page-save-btn {
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.reading-page-save-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.reading-page-save-btn:active {
  transform: translateY(0);
}

.reading-page-save-btn:disabled {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.5);
  cursor: default;
  box-shadow: none;
  transform: none;
}

