/* 
  Hub Premium Design System - Compact Popup Mode
  Author: 서현서
*/

:root {
  --bg-color: #0c0d12;
  --panel-bg: rgba(255, 255, 255, 0.04);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text-primary: #ffffff;
  --text-secondary: #b0b3bf;
  --accent-primary: #a38cf4;
  --accent-secondary: #7bb9ff;
  --success: #a7e3bf;
  --danger: #ff8c8c;
  --radius-xl: 32px;
  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow-premium: 0 40px 100px rgba(0, 0, 0, 0.65);
  --font-main: 'Inter', 'Noto Sans KR', system-ui, -apple-system, sans-serif;
  --transition-smooth: 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --max-width: 580px;
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-color);
}

body {
  margin: 0;
  padding: 0;
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden; /* Lock background scroll */
}

/* Background & Backdrop */
.bg-blur {
  position: fixed;
  inset: 0;
  background: url('hub-bg.png') center/cover no-repeat;
  filter: saturate(1.2) brightness(0.5) blur(3px);
  z-index: -1;
}

.bg-blur::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(12, 13, 18, 0.6), rgba(12, 13, 18, 0.9));
}

/* Compact Popup App Container */
.app {
  width: min(calc(100% - 24px), var(--max-width));
  max-height: 90vh; /* Constraints height to 90% of viewport */
  margin: 0 auto;
  display: grid;
  gap: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 4px 24px;
  scrollbar-width: none; /* Hide scrollbar Firefox */
  -ms-overflow-style: none; /* Hide scrollbar IE */
  animation: popup-entrance 800ms cubic-bezier(0.2, 0.9, 0.3, 1.05) forwards;
  z-index: 10;
}

.app::-webkit-scrollbar {
  display: none; /* Hide scrollbar Chrome/Safari */
}

@keyframes popup-entrance {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.glass {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  box-shadow: var(--shadow-premium);
}

/* Hero Section - Compact */
.hero {
  padding: 24px;
  display: grid;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.dot {
  width: 5px;
  height: 5px;
  background: var(--accent-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-primary);
}

.profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar-container {
  position: relative;
  flex-shrink: 0;
}

.avatar {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  z-index: 2;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.3);
}

.avatar-glow {
  position: absolute;
  inset: -6px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  filter: blur(14px);
  opacity: 0.35;
}

.hero-text h1 {
  margin: 0 0 4px;
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  background: linear-gradient(to right, #fff, #b7c1ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lead {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Card Design - More compact */
.section-label {
  padding: 8px 8px 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  text-transform: uppercase;
}

.card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-smooth);
}

.card:hover, .card:focus-within {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.card summary {
  list-style: none;
  cursor: pointer;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card summary::-webkit-details-marker { display: none; }

.card-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-box {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.card-desc {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.chevron {
  width: 24px;
  height: 24px;
  color: var(--text-secondary);
  transition: transform 400ms ease;
}

/* Expand content */
.expand-content {
  padding: 0 16px 16px;
}

.expand-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 10px;
}

.preview-card {
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.preview-card h3 {
  margin: 0;
  font-size: 0.95rem;
  color: #fff;
}

.preview-card p {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tags {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 10px;
}

.action-panel {
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-title {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.check-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
}

.check-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.check-list li::before {
  content: '✓';
  color: var(--accent-primary);
  font-weight: 900;
}

/* Buttons */
.btn {
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 300ms ease;
}

.btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.btn-primary { background: #fff; color: #000; }
.btn-primary:active { transform: scale(0.97); }

.full-width { width: 100%; }

/* Footer */
.footer {
  text-align: center;
  padding: 16px 0;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: all 700ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile responsive sheet-style */
@media (max-width: 768px) {
  body {
    align-items: flex-end; /* Bottom sheet style */
  }
  .app {
    width: 100%;
    max-height: 85vh;
    border-radius: 32px 32px 0 0;
    margin: 0;
    animation: slide-up-mobile 800ms cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
  }
  @keyframes slide-up-mobile {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
}
