/* ==========================================================================
   IPDC 시민디자인단 실시간 인터랙티브 피드백 월 - 공통 스타일
   Design System: Modern Glassmorphic Dark UI + High-End Micro-Animations
   ========================================================================== */

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  /* Team Accent Colors */
  --team1-color: #06b6d4;
  --team1-glow: rgba(6, 182, 212, 0.35);
  --team1-bg: rgba(6, 182, 212, 0.1);

  --team2-color: #f59e0b;
  --team2-glow: rgba(245, 158, 11, 0.35);
  --team2-bg: rgba(245, 158, 11, 0.1);

  --team3-color: #a855f7;
  --team3-glow: rgba(168, 85, 247, 0.35);
  --team3-bg: rgba(168, 85, 247, 0.1);

  --team4-color: #f43f5e;
  --team4-glow: rgba(244, 63, 94, 0.35);
  --team4-bg: rgba(244, 63, 94, 0.1);

  /* Categories */
  --cat-cheer: #10b981;
  --cat-idea: #f59e0b;
  --cat-review: #3b82f6;
  --cat-question: #ec4899;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(6, 182, 212, 0.08) 0%, transparent 35%),
    radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 35%),
    radial-gradient(circle at 50% 50%, rgba(17, 24, 39, 0.95) 0%, var(--bg-primary) 100%);
  min-height: 100vh;
}

/* Glass Card */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

/* Header Styles */
.wall-header {
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #c084fc;
  letter-spacing: 0.5px;
}

.wall-title {
  font-size: 1.35rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 30%, #9ca3af 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Action Buttons */
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-glass);
  color: #e2e8f0;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.btn-action:active {
  transform: translateY(0);
}

/* Stat Counters */
.stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.stat-pill strong {
  color: #60a5fa;
  font-size: 1.1rem;
}

/* 4-Team Grid Layout */
.wall-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  padding: 1.25rem;
  height: calc(100vh - 76px);
  box-sizing: border-box;
}

@media (max-width: 1400px) {
  .wall-grid {
    grid-template-columns: repeat(2, 1fr);
    height: auto;
  }
}

@media (max-width: 768px) {
  .wall-grid {
    grid-template-columns: 1fr;
    height: auto;
  }
}

/* Team Column */
.team-column {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: var(--transition);
}

.team-column:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.team-column.team-1 { border-top: 4px solid var(--team1-color); }
.team-column.team-2 { border-top: 4px solid var(--team2-color); }
.team-column.team-3 { border-top: 4px solid var(--team3-color); }
.team-column.team-4 { border-top: 4px solid var(--team4-color); }

/* Team Header inside Column */
.team-header {
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-glass);
}

.team-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 4px 12px;
  border-radius: 999px;
}

.team-1 .team-badge { background: var(--team1-bg); color: var(--team1-color); border: 1px solid var(--team1-color); }
.team-2 .team-badge { background: var(--team2-bg); color: var(--team2-color); border: 1px solid var(--team2-color); }
.team-3 .team-badge { background: var(--team3-bg); color: var(--team3-color); border: 1px solid var(--team3-color); }
.team-4 .team-badge { background: var(--team4-bg); color: var(--team4-color); border: 1px solid var(--team4-color); }

/* ==========================================================================
   ★ 인터랙티브 세로 A1 판넬 뷰어 & 접기/펼치기 화면 모드 전환 시스템
   ========================================================================== */

/* 상단 3단계 뷰 모드 세그먼트 스위처 */
.view-mode-selector {
  display: flex;
  background: rgba(0, 0, 0, 0.5);
  border: 1.5px solid var(--border-glass);
  border-radius: 999px;
  padding: 3px;
  gap: 3px;
}

.mode-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.mode-tab-btn:hover:not(.active) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.mode-tab-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.95), rgba(168, 85, 247, 0.95));
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.45);
}

/* 조 컬럼 헤더 2줄 레이아웃 (뱃지 우측에 메인+서브 텍스트 칼 수직정렬) */
.team-col-header {
  padding: 0.65rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.02);
  gap: 8px;
}

.header-main-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.team-titles-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.team-main-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.25;
  white-space: nowrap;
}

.team-sub-title {
  font-size: 0.76rem;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.35;
  letter-spacing: -0.025em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-action-box {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* 개별 조 판넬 접기/펼치기 미니멀 아이콘 버튼 */
.btn-panel-icon {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: #cbd5e1;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  padding: 0;
}

.btn-panel-icon:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

.btn-panel-toggle {
  display: none;
}

/* ==========================================================================
   세로 A1 판넬 디스플레이 영역 (양옆 여백 없이 가로폭 100% 핏)
   ========================================================================== */
.panel-display-stage {
  position: relative;
  width: 100%;
  background: transparent;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.panel-display-stage img {
  width: 100%;
  height: auto;
  aspect-ratio: 1600 / 2265; /* A1 규격 비율 */
  object-fit: cover; /* 양옆 검은 여백 0px 완벽 밀착 */
  display: block;
  transition: transform 0.3s ease;
}

.panel-display-stage:hover img {
  transform: scale(1.015);
}

.panel-hover-hint {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.85;
  transition: opacity 0.2s ease;
  z-index: 5;
}

.panel-display-stage:hover .panel-hover-hint {
  opacity: 1;
}

/* 1. 균형 모드 (판넬 약 300px + 의견 넉넉) */
.wall-grid.mode-balanced .panel-display-stage {
  max-height: 300px;
}
.wall-grid.mode-balanced .panel-display-stage img {
  object-position: top center;
}

/* 2. 판넬 집중 모드 (가로 100% 꽉 채우는 대형 A1 규격 핏) */
.wall-grid.mode-panel-focus .panel-display-stage {
  max-height: calc(100vh - 350px);
}

/* 3. 피드백 집중 모드 (판넬 완전 접기: 높이 0으로 숨겨서 의견이 화면 전체를 100% 장악!) */
.wall-grid.mode-feed-focus .panel-display-stage {
  height: 0px !important;
  max-height: 0px !important;
  opacity: 0 !important;
  border-bottom: none !important;
  pointer-events: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* 개별 조 판넬 접힘 상태 (.panel-collapsed) */
.team-column.panel-collapsed .panel-display-stage {
  height: 0px !important;
  max-height: 0px !important;
  opacity: 0 !important;
  border-bottom: none !important;
  pointer-events: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* 특정 조 단독 발표/집중 필터 */
.wall-grid.filter-team-1 { grid-template-columns: 1fr !important; }
.wall-grid.filter-team-1 .team-column:not(.team-1) { display: none !important; }

.wall-grid.filter-team-2 { grid-template-columns: 1fr !important; }
.wall-grid.filter-team-2 .team-column:not(.team-2) { display: none !important; }

.wall-grid.filter-team-3 { grid-template-columns: 1fr !important; }
.wall-grid.filter-team-3 .team-column:not(.team-3) { display: none !important; }

.wall-grid.filter-team-4 { grid-template-columns: 1fr !important; }
.wall-grid.filter-team-4 .team-column:not(.team-4) { display: none !important; }

/* 단독 조 뷰일 때 레이아웃 최적화 */
.wall-grid[class*="filter-team-"] .panel-display-stage {
  max-height: calc(100vh - 240px);
}
.wall-grid[class*="filter-team-"].mode-feed-focus .panel-display-stage {
  height: 0px !important;
  max-height: 0px !important;
}
.wall-grid[class*="filter-team-"] .team-feed-container {
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 10px;
}

/* ==========================================================================
   실시간 피드백 스트림 영역 (정갈한 1줄 가로 100% 레이아웃)
   ========================================================================== */
.team-feed-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.7rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 7px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
  transition: all 0.3s ease;
}

.team-feed-container::-webkit-scrollbar {
  width: 4px;
}
.team-feed-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* 판넬 집중 모드일 때: 하단 여백 전체에 1줄씩 시원하고 정갈하게 정렬 */
.wall-grid.mode-panel-focus .team-feed-container {
  flex: 1;
  max-height: none;
  padding: 0.65rem 0.75rem;
  gap: 7px;
}

/* 피드백 집중 모드일 때: 화면 전체를 1줄씩 가득 채움 */
.wall-grid.mode-feed-focus .team-feed-container {
  padding: 0.85rem;
  gap: 8px;
}

/* 마이크로 피드백 카드 - 1줄 와이드 정갈한 카드 */
.feedback-card-micro {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid #6366f1;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-sizing: border-box;
}

.feedback-card-micro:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateX(2px);
  z-index: 2;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.feedback-card-micro.is-new {
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.6);
  animation: pulseNew 2.5s ease-out;
}

.feedback-card-micro.cat-cheer { border-left-color: #10b981; }
.feedback-card-micro.cat-idea { border-left-color: #f59e0b; }
.feedback-card-micro.cat-review { border-left-color: #3b82f6; }
.feedback-card-micro.cat-question { border-left-color: #ec4899; }

.micro-emoji {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}

.micro-content {
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.38;
  color: #f8fafc;
  word-break: break-word;
  letter-spacing: -0.01em;
  flex: 1;
}

/* Floating QR Widget on Wall */
.wall-qr-floating {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  background: rgba(10, 14, 23, 0.92);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7), 0 0 30px rgba(99, 102, 241, 0.25);
  display: flex;
  align-items: center;
  gap: 14px;
  animation: floatWidget 4s ease-in-out infinite;
}

.qr-box {
  background: #ffffff;
  padding: 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-info h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 2px;
}

.qr-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.qr-info .qr-url {
  font-family: monospace;
  font-size: 0.72rem;
  color: #60a5fa;
  margin-top: 4px;
}

/* Spotlight Spotlight Banner for New Incoming Feedback */
.spotlight-banner {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(-30px);
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(99, 102, 241, 0.6);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 40px rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-xl);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 480px;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.spotlight-banner.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.spotlight-emoji {
  font-size: 2.2rem;
  animation: bounceEmoji 1s infinite alternate;
}

.spotlight-text h5 {
  font-size: 0.85rem;
  color: #c084fc;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.spotlight-text p {
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffffff;
  max-width: 400px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Keyframes */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pulseNew {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.8); }
  50% { box-shadow: 0 0 30px 4px rgba(99, 102, 241, 0.5); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

@keyframes floatWidget {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes bounceEmoji {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-5px) scale(1.15); }
}

/* Modal for Image Preview */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}

.modal-content img {
  width: 100%;
  height: auto;
  max-height: 85vh;
  display: block;
}

.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
