@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css");

/* HeartLink 공통 화면 스타일 */
/* 관리자 페이지와 실제 앱 화면이 동일한 스타일을 공유합니다 */

:root {
    /* 색상 */
    --hl-pink: #FF5A7A;
    --hl-dark: #333;
    --hl-gray: #999;
    --hl-light-gray: #F5F5F5;
    --hl-bg-gray: #FAFAFA;
    --hl-white: #FFFFFF;
    --hl-brown: #6B3745;
    --hl-light-brown: #8B4654;
    --hl-lighter-brown: #A65368;
    
    /* 크기 */
    --hl-logo-size: 64px;
    --hl-upload-button-size: 100%;
    --hl-progress-circle-size: 240px;
    --hl-qr-size: 200px;
    
    /* 간격 (8dp 그리드 시스템) */
    --hl-body-padding: 8px 16px;
    --hl-card-max-width: 420px;
    --hl-card-padding: 16px 24px 16px;
    --hl-card-border-radius: 24px;
    --hl-logo-margin-bottom: 8px;
    --hl-title-gap: 4px;
    --hl-title-margin-bottom: 12px;
    --hl-content-padding: 16px 0;
    --hl-content-margin-bottom: 12px;
}

/* 공통 컨테이너 */
.hl-body {
    background: var(--hl-white);
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
    padding: var(--hl-body-padding);
    margin: 0;
    box-sizing: border-box;
}

.hl-container {
    text-align: center;
    max-width: var(--hl-card-max-width);
    width: 100%;
    background: var(--hl-white);
    border-radius: var(--hl-card-border-radius);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: var(--hl-card-padding);
}

/* 로고 */
.hl-logo {
    width: var(--hl-logo-size);
    height: auto;
    margin-bottom: var(--hl-logo-margin-bottom);
}

/* 제목 */
.hl-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--hl-pink);
    line-height: 1.5;
    margin-bottom: var(--hl-title-gap);
    text-align: center;
}

.hl-subtitle {
    font-size: 26px;
    font-weight: 700;
    color: var(--hl-dark);
    margin-bottom: var(--hl-title-margin-bottom);
    text-align: center;
}

/* 업로드 영역 */
.hl-upload-area {
    padding: var(--hl-content-padding);
    margin-bottom: var(--hl-content-margin-bottom);
}

.hl-upload-button {
    width: 100%;
    height: auto;
    aspect-ratio: 4/5;
    border-radius: 16px;
    cursor: pointer;
    object-fit: cover;
}

/* Progress 영역 */
.hl-progress-area {
    padding: var(--hl-content-padding);
    margin-bottom: var(--hl-content-margin-bottom);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hl-progress-circle {
    width: var(--hl-progress-circle-size);
    height: var(--hl-progress-circle-size);
    position: relative;
}

.hl-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: 700;
    color: var(--hl-pink);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hl-progress-label {
    margin-top: 16px;
    font-size: 15px;
    color: var(--hl-pink);
    font-weight: 600;
    text-align: center;
}

/* 안내 텍스트 */
.hl-notice {
    font-size: 12px;
    color: var(--hl-gray);
    line-height: 1.7;
    margin-bottom: 4px;
}

.hl-warning {
    font-size: 11px;
    color: var(--hl-pink);
    line-height: 1.6;
    text-align: center;
    margin-bottom: 12px;
}

.hl-warning b {
    font-weight: 700;
}

/* Loading 화면 */
.hl-loading-container {
    text-align: center;
    padding: 20px;
}

.hl-heart-icon {
    width: 160px;
    height: 160px;
    object-fit: contain;
    animation: hl-pulse 1.5s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(255, 90, 122, 0.3));
}

@keyframes hl-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.hl-loading-title {
    font-size: 28px;
    font-weight: 700;
    margin-top: 24px;
    margin-bottom: 16px;
}

.hl-spinner {
    margin: 24px auto;
    width: 40px;
    height: 40px;
    border: 4px solid #F2F2F7;
    border-top-color: #FF3B30;
    border-radius: 50%;
    animation: hl-spin 1s linear infinite;
}

@keyframes hl-spin {
    to { transform: rotate(360deg); }
}

.hl-loading-message {
    font-size: 20px;
    font-weight: 400;
    color: #8E8E93;
    line-height: 1.6;
}

/* Success/Playback - Glassmorphism */
.hl-glass-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(139, 70, 84, 0.2);
    padding: 40px 24px;
    width: 100%;
    max-width: var(--hl-card-max-width);
    text-align: center;
}

.hl-qr-container {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(139, 70, 84, 0.1);
    display: inline-block;
}

/* 버튼 */
.hl-button {
    background: var(--hl-pink);
    color: var(--hl-white);
    border: none;
    border-radius: 12px;
    padding: 16px 28px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(255, 90, 122, 0.3);
}

.hl-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 90, 122, 0.4);
}

/* Preview 화면 */
.hl-preview-container {
    background: var(--hl-white);
    border-radius: var(--hl-card-border-radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 8px 20px 20px;
    width: 100%;
    max-width: var(--hl-card-max-width);
    text-align: center;
}

.hl-preview-video {
    width: 100%;
    height: auto;
    aspect-ratio: 4/5;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    object-fit: cover;
    background: #000;
}

.hl-button-group {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.hl-button-secondary {
    flex: 1;
    background: #F0F0F0;
    border: none;
    border-radius: 8px;
    padding: 13px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
}

.hl-button-primary {
    flex: 1;
    background: var(--hl-pink);
    border: none;
    border-radius: 8px;
    padding: 13px;
    font-size: 14px;
    font-weight: 600;
    color: var(--hl-white);
    box-shadow: 0 2px 8px rgba(255, 90, 122, 0.3);
    cursor: pointer;
}

.hl-terms-text {
    font-size: 10px;
    color: var(--hl-gray);
    line-height: 1.6;
    text-align: center;
}

.hl-terms-link {
    color: var(--hl-pink);
    font-weight: 600;
}

/* ── 하단 탭 (공통) ── */
.hl-bottom-tab {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid #F0F0F0;
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.hl-tab-item {
  flex: 1;
  display: flex !important;
  flex-direction: column !important;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  color: #8E8E93 !important;
  padding: 8px 4px;
  transition: all 0.2s;
}
.hl-tab-item:visited { color: #8E8E93 !important; }
.hl-tab-item:active { transform: scale(0.95); }
.hl-tab-item.active { color: #FF5A7A !important; }
.hl-tab-icon {
  font-size: 20px;
  margin-bottom: 3px;
  width: 36px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: background 0.2s;
}
.hl-tab-item.active .hl-tab-icon {
  background: linear-gradient(135deg, #FFE0EC 0%, #EED8FF 100%);
}
.hl-tab-label { font-size: 10px; font-weight: 600; line-height: 1.2; }
body {
  padding-bottom: max(72px, calc(72px + env(safe-area-inset-bottom, 0px))) !important;
}
/* 그라데이션 헤더 좌상단 브랜드 로고 (보관/기록/문의/스캔/룰렛 공용)
   규칙이 없으면 300x300 원본 크기로 렌더돼 헤더 레이아웃이 깨진다 */
.header-brand-logo-center {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 26px;
  object-fit: contain;
  opacity: 0.85;
  pointer-events: none;
  z-index: 1;
}

/* 헤더가 width:100% + 좌우 padding 으로 화면보다 넓어져 좌측으로 밀리는 문제 방지 */
.page-header, .scan-header, .page-body, .cards-wrap, .hl-container { box-sizing: border-box; }
