/* ==========================================================================
   InvestArchive - Premium Glassmorphic Stylesheet (Investment Theme)
   ========================================================================== */

/* 1. 디자인 시스템 토큰 & 테마 정의 */
:root {
  /* 다크 테마 기본 HSL 토큰 */
  --bg-primary: 220, 24%, 7%;
  --bg-secondary: 220, 20%, 11%;
  --bg-tertiary: 220, 16%, 15%;
  --glass-bg: 220, 22%, 10%, 0.65;
  --glass-border: 220, 20%, 25%, 0.4;
  --glass-highlight: 220, 30%, 95%, 0.05;
  
  /* 색상 악센트 (성장, 경제, 투자 테마 - 비취색, 에메랄드, 골드) */
  --accent-cyan: 175, 90%, 45%;
  --accent-cyan-rgb: 12, 218, 177;
  --accent-gold: 42, 90%, 55%;
  --accent-green: 145, 80%, 45%;
  --accent-red: 355, 85%, 55%;
  
  /* 텍스트 색상 */
  --text-main: 220, 15%, 90%;
  --text-muted: 220, 10%, 65%;
  --text-inverse: 220, 30%, 5%;
  
  /* 그림자 & 블러 필터 효과 */
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.05);
  --glass-blur: 16px;
  
  /* 폰트 정의 */
  --font-display: 'Outfit', 'Noto Sans KR', sans-serif;
  --font-body: 'Noto Sans KR', sans-serif;
  
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-fast: all 0.15s ease-out;
}

/* 라이트 테마 토큰 */
.light-theme {
  --bg-primary: 220, 20%, 95%;
  --bg-secondary: 220, 20%, 90%;
  --bg-tertiary: 220, 15%, 85%;
  --glass-bg: 0, 0%, 100%, 0.75;
  --glass-border: 220, 15%, 80%, 0.6;
  --glass-highlight: 0, 0%, 100%, 0.3;
  
  --accent-cyan: 180, 85%, 35%;
  --accent-cyan-rgb: 13, 160, 150;
  --accent-gold: 38, 85%, 45%;
  --accent-green: 145, 75%, 35%;
  --accent-red: 355, 75%, 45%;
  
  --text-main: 220, 25%, 15%;
  --text-muted: 220, 15%, 40%;
  --text-inverse: 0, 0%, 100%;
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.02);
}

/* 2. 베이스 마크업 및 전체 리셋 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: hsl(var(--bg-primary));
  color: hsl(var(--text-main));
  font-family: var(--font-body);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  transition: var(--transition-smooth);
}

/* 3. 백그라운드 오로라 글로우 이펙트 */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.35;
  pointer-events: none;
  transition: var(--transition-smooth);
}
.dark-theme .bg-glow { opacity: 0.45; }

.bg-glow-1 {
  width: 450px;
  height: 450px;
  top: -100px;
  right: -50px;
  background: radial-gradient(circle, hsla(var(--accent-cyan), 0.4) 0%, transparent 70%);
}
.bg-glow-2 {
  width: 600px;
  height: 600px;
  bottom: -200px;
  left: -150px;
  background: radial-gradient(circle, hsla(var(--accent-gold), 0.3) 0%, transparent 70%);
}
.bg-glow-3 {
  width: 400px;
  height: 400px;
  top: 50%;
  left: 40%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, hsla(var(--accent-cyan), 0.15) 0%, transparent 70%);
}

/* 스크롤바 디자인 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: hsla(var(--glass-border));
  border-radius: 10px;
  border: 2px solid hsl(var(--bg-primary));
}
::-webkit-scrollbar-thumb:hover {
  background: hsla(var(--accent-cyan), 0.5);
}

/* 4. 공통 UI 컴포넌트 */

/* 글래스모피즘 기본 스타일 */
.glass-panel {
  background: hsla(var(--glass-bg));
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid hsla(var(--glass-border));
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  background-image: linear-gradient(135deg, hsla(var(--glass-highlight)), transparent);
  transition: var(--transition-smooth);
}

/* 버튼 컴포넌트 */
button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: var(--font-body);
  transition: var(--transition-fast);
}

.primary-btn {
  background: linear-gradient(135deg, hsl(var(--accent-cyan)), hsl(185, 95%, 40%));
  color: hsl(var(--text-inverse));
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  box-shadow: 0 4px 15px -3px hsla(var(--accent-cyan), 0.4);
}
.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px -3px hsla(var(--accent-cyan), 0.6);
  filter: brightness(1.1);
}
.primary-btn:active {
  transform: translateY(0);
}

.secondary-btn {
  background: hsla(var(--glass-border));
  color: hsl(var(--text-main));
  border: 1px solid hsla(var(--glass-border));
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.secondary-btn:hover {
  background: hsla(var(--glass-border), 1.5);
  color: hsl(var(--accent-cyan));
}

.kakaotalk-btn {
  background: linear-gradient(135deg, #FEE500, #FADA0A);
  color: #191919 !important;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px -3px rgba(254, 229, 0, 0.4);
}
.kakaotalk-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px -3px rgba(254, 229, 0, 0.6);
  filter: brightness(1.05);
}

.telegram-btn {
  background: linear-gradient(135deg, #0088cc, #00a2ed);
  color: white !important;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px -3px rgba(0, 136, 204, 0.4);
}
.telegram-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px -3px rgba(0, 136, 204, 0.6);
  filter: brightness(1.1);
}

.icon-btn {
  background: hsla(var(--glass-highlight));
  border: 1px solid hsla(var(--glass-border));
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--text-main));
}
.icon-btn:hover {
  background: hsla(var(--glass-border));
  color: hsl(var(--accent-cyan));
  transform: scale(1.05);
}

/* 텍스트 데코레이션 */
.highlight {
  color: hsl(var(--accent-cyan));
}

/* 5. 레이아웃 구조 */
.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: calc(100vh - 60px);
}

/* 헤더 스타일 */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-radius: 16px;
  gap: 20px;
  background: hsla(var(--glass-bg));
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid hsla(var(--glass-border));
  box-shadow: var(--shadow-sm);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  transition: var(--transition-fast);
}
.logo-container:hover {
  opacity: 0.85;
  transform: scale(1.02);
}

.logo-icon {
  background: linear-gradient(135deg, hsl(var(--accent-cyan)), hsl(var(--accent-green)));
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--text-inverse));
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(var(--accent-cyan-rgb), 0.3);
}

.logo-text h1 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.sub-logo {
  font-size: 0.7rem;
  color: hsl(var(--text-muted));
  letter-spacing: 0.5px;
}

/* 헤더 검색 & 액션 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  position: relative;
  width: 320px;
}
.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--text-muted));
}
.search-box input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: 20px;
  border: 1px solid hsla(var(--glass-border));
  background: hsla(var(--bg-primary), 0.5);
  color: hsl(var(--text-main));
  outline: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}
.search-box input:focus {
  border-color: hsl(var(--accent-cyan));
  box-shadow: 0 0 10px rgba(var(--accent-cyan-rgb), 0.2);
  width: 380px;
}

/* 실시간 마켓 티커 */
.market-ticker-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 36px;
  background: hsla(var(--bg-primary), 0.3);
  border-radius: 18px;
  border: 1px solid hsla(var(--glass-border), 0.4);
  max-width: 600px;
}
.ticker-wrapper {
  display: flex;
  align-items: center;
  position: absolute;
  white-space: nowrap;
  animation: ticker-slide 25s linear infinite;
  height: 100%;
}
.ticker-wrapper:hover {
  animation-play-state: paused;
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 40px;
  font-size: 0.75rem;
  font-family: var(--font-display);
}
.ticker-label {
  color: hsl(var(--text-muted));
  font-weight: 500;
}
.ticker-val {
  font-weight: 600;
}
.ticker-val.up { color: hsl(var(--accent-green)); }
.ticker-val.down { color: hsl(var(--accent-red)); }

@keyframes ticker-slide {
  0% { transform: translate3d(100%, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

/* 6. 메인 바디 컨텐츠 레이아웃 */
.app-content {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
}

/* 사이드바 스타일 */
.app-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-nav {
  background: hsla(var(--glass-bg));
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid hsla(var(--glass-border));
  border-radius: 16px;
  padding: 20px 14px;
}

.nav-title {
  font-size: 0.8rem;
  color: hsl(var(--text-muted));
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  margin-top: 16px;
  padding-left: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-title:first-of-type { margin-top: 0; }

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  color: hsl(var(--text-muted));
  transition: var(--transition-fast);
}

.nav-item:hover {
  background: hsla(var(--glass-border), 0.5);
  color: hsl(var(--text-main));
}

.nav-item.active {
  background: linear-gradient(90deg, hsla(var(--accent-cyan), 0.15) 0%, transparent 100%);
  border-left: 3px solid hsl(var(--accent-cyan));
  color: hsl(var(--accent-cyan));
  font-weight: 600;
}

.sidebar-card {
  background: hsla(var(--glass-bg));
  border: 1px solid hsla(var(--glass-border));
  border-radius: 16px;
  padding: 20px;
}

.share-panel {
  border-color: hsla(175, 90%, 45%, 0.3);
  background-image: linear-gradient(135deg, hsla(175, 90%, 35%, 0.05), transparent);
}

.kakaotalk-color {
  color: #FEE500;
}

.telegram-color {
  color: #0088cc;
}

.share-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.share-panel-header h4 {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  font-size: 0.65rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 10px;
  background: hsla(var(--glass-border));
  color: hsl(var(--text-muted));
}
.status-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-dot.active {
  background: hsla(var(--accent-green), 0.15);
  color: hsl(var(--accent-green));
}
.status-dot.error {
  background: hsla(var(--accent-red), 0.15);
  color: hsl(var(--accent-red));
}

.kakao-desc {
  font-size: 0.78rem;
  color: hsl(var(--text-muted));
  line-height: 1.5;
  margin-bottom: 15px;
}

.pulse-effect {
  position: relative;
  overflow: hidden;
}
.pulse-effect::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.4);
  opacity: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  animation: pulse-ring 2.5s infinite;
}

@keyframes pulse-ring {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
  }
  100% {
    transform: translate(-50%, -50%) scale(40);
    opacity: 0;
  }
}

.briefing-time-info {
  font-size: 0.68rem;
  color: hsl(var(--text-muted));
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: center;
  justify-content: center;
}

.study-tip-panel h4 {
  font-size: 0.9rem;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: hsl(var(--accent-gold));
}

.study-tips {
  list-style: none;
  font-size: 0.78rem;
  color: hsl(var(--text-muted));
  display: flex;
  flex-direction: column;
  gap: 8px;
  line-height: 1.4;
}
.study-tips li::before {
  content: '⚡';
  margin-right: 6px;
}

/* 7. 메인 뉴스 영역 & 그리드 */
.main-news-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.section-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.news-meta-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-count {
  font-size: 0.8rem;
  background: hsla(var(--glass-border), 0.6);
  padding: 4px 10px;
  border-radius: 20px;
  color: hsl(var(--text-muted));
  font-weight: 500;
}

.refresh-btn {
  background: transparent;
  color: hsl(var(--text-muted));
  border: 1px solid hsla(var(--glass-border));
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.refresh-btn:hover {
  background: hsla(var(--glass-border));
  color: hsl(var(--accent-cyan));
}

/* 뉴스 그리드 */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* 뉴스 카드 스타일 */
.news-card {
  background: hsla(var(--glass-bg));
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid hsla(var(--glass-border));
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  background-image: linear-gradient(135deg, hsla(var(--glass-highlight)), transparent);
  transition: var(--transition-smooth);
}

.news-card:hover {
  transform: translateY(-4px);
  border-color: hsla(var(--accent-cyan), 0.5);
  box-shadow: 0 12px 30px -10px rgba(var(--accent-cyan-rgb), 0.15);
}

.news-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.source-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: hsl(var(--accent-cyan));
  background: rgba(var(--accent-cyan-rgb), 0.08);
  padding: 3px 8px;
  border-radius: 6px;
}

.lang-flag {
  font-size: 0.75rem;
  padding: 2px 6px;
  background: hsla(var(--glass-border), 0.5);
  border-radius: 4px;
}

.news-card h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: hsl(var(--text-main));
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8rem;
  transition: var(--transition-fast);
}
.news-card:hover h3 {
  color: hsl(var(--accent-cyan));
}

.news-card-desc {
  font-size: 0.8rem;
  color: hsl(var(--text-muted));
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 3.6rem;
}

.news-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid hsla(var(--glass-border), 0.5);
  font-size: 0.75rem;
}

.news-time {
  color: hsl(var(--text-muted));
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-actions {
  display: flex;
  gap: 8px;
}

.card-btn {
  background: hsla(var(--glass-border), 0.8);
  border: 1px solid hsla(var(--glass-border));
  color: hsl(var(--text-main));
  font-size: 0.72rem;
  padding: 5px 10px;
  border-radius: 6px;
  font-weight: 500;
}
.card-btn.original-btn {
  text-decoration: none;
  background: hsla(var(--glass-border), 0.4);
  color: hsl(var(--text-muted));
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.card-btn.original-btn:hover {
  background: hsla(var(--glass-border), 1);
  color: hsl(var(--accent-cyan));
  border-color: hsla(var(--accent-cyan), 0.4);
}
.card-btn.ai-btn {
  background: linear-gradient(135deg, rgba(var(--accent-cyan-rgb), 0.15), rgba(var(--accent-cyan-rgb), 0.05));
  border-color: hsla(var(--accent-cyan), 0.3);
  color: hsl(var(--accent-cyan));
  font-weight: 600;
}
.card-btn.ai-btn:hover {
  background: linear-gradient(135deg, rgba(var(--accent-cyan-rgb), 0.35), rgba(var(--accent-cyan-rgb), 0.15));
  border-color: hsl(var(--accent-cyan));
  transform: scale(1.03);
}

.card-btn.bookmark-btn:hover {
  color: hsl(var(--accent-gold));
  border-color: hsla(var(--accent-gold), 0.5);
}
.card-btn.bookmark-btn.active {
  color: hsl(var(--accent-gold));
  background: rgba(220, 160, 42, 0.1);
  border-color: hsl(var(--accent-gold));
}

/* 8. 로딩 및 에러 컴포넌트 */
.loading-container, .error-container, .empty-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  gap: 16px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid hsla(var(--glass-border));
  border-top-color: hsl(var(--accent-cyan));
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.hidden { display: none !important; }

/* 9. 모달 레이아웃 & 애니메이션 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: var(--transition-smooth);
}

.modal-card {
  width: 90%;
  max-width: 680px;
  background: hsl(var(--bg-secondary));
  border: 1px solid hsla(var(--glass-border));
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  border-radius: 20px;
  overflow: hidden;
  animation: modal-enter 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-enter {
  0% { transform: scale(0.9) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid hsla(var(--glass-border), 0.5);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.modal-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.modal-badge {
  font-size: 0.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 1.5px;
  color: hsl(var(--accent-cyan));
  display: flex;
  align-items: center;
  gap: 6px;
}
.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
}

.close-modal-btn {
  background: transparent;
  color: hsl(var(--text-muted));
  font-size: 1.3rem;
  padding: 4px;
}
.close-modal-btn:hover {
  color: hsl(var(--accent-red));
}

.modal-body {
  padding: 24px;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-article-info {
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: hsl(var(--text-muted));
}

.original-snippet-box {
  background: hsla(var(--bg-primary), 0.6);
  border: 1px solid hsla(var(--glass-border), 0.5);
  border-radius: 12px;
  padding: 16px;
}
.original-snippet-box h4 {
  font-size: 0.82rem;
  color: hsl(var(--text-muted));
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.original-snippet-box p {
  font-size: 0.85rem;
  line-height: 1.6;
}

/* AI 요약용 상세 스타일 */
.ai-loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 16px;
  text-align: center;
  background: rgba(var(--accent-cyan-rgb), 0.03);
  border: 1px dashed hsla(var(--accent-cyan), 0.3);
  border-radius: 12px;
}

.ai-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(var(--accent-cyan-rgb), 0.1);
  border-top-color: hsl(var(--accent-cyan));
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.ai-analysis-result {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.analysis-section h4 {
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: hsl(var(--accent-cyan));
}

.highlight-text-box {
  background: rgba(var(--accent-cyan-rgb), 0.08);
  border: 1px solid hsla(var(--accent-cyan), 0.4);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}

.summary-list, .implications-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.88rem;
  line-height: 1.6;
}

.summary-list li, .implications-list li {
  padding-left: 24px;
  position: relative;
}

.summary-list li::before {
  content: '\f058';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  left: 0;
  top: 1px;
  color: hsl(var(--accent-green));
}

.implications-section h4 {
  color: hsl(var(--accent-gold));
}
.implications-list li::before {
  content: '\f0eb';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  left: 0;
  top: 1px;
  color: hsl(var(--accent-gold));
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid hsla(var(--glass-border), 0.5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-left, .footer-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.text-link-btn {
  font-size: 0.85rem;
  color: hsl(var(--text-muted));
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}
.text-link-btn:hover {
  color: hsl(var(--accent-cyan));
  text-decoration: underline;
}

/* 설정 페이지용 스타일 */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid hsla(var(--glass-border), 0.5);
  padding-bottom: 20px;
}
.settings-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}
.settings-section h4 {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: hsl(var(--accent-gold));
}

.api-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.api-status-card {
  background: hsla(var(--bg-primary), 0.6);
  border: 1px solid hsla(var(--glass-border), 0.5);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-name {
  font-size: 0.8rem;
  font-weight: 500;
}
.status-value {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}
.status-value.loading { background: hsla(var(--glass-border)); color: hsl(var(--text-muted)); }
.status-value.active { background: hsla(var(--accent-green), 0.15); color: hsl(var(--accent-green)); }
.status-value.inactive { background: hsla(var(--accent-red), 0.15); color: hsl(var(--accent-red)); }

.settings-help-text {
  font-size: 0.75rem;
  color: hsl(var(--text-muted));
  line-height: 1.4;
}

.add-feed-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.add-feed-form .form-group {
  width: 100%;
}
.add-feed-form input {
  width: 100%;
  padding: 10px 14px;
  background: hsla(var(--bg-primary), 0.8);
  border: 1px solid hsla(var(--glass-border));
  color: hsl(var(--text-main));
  outline: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  border-radius: 8px;
}
.add-feed-form input:focus {
  border-color: hsl(var(--accent-cyan));
}
.url-group {
  display: flex;
  gap: 8px;
}
.url-group input {
  flex: 1;
}

.feed-validation-msg {
  font-size: 0.75rem;
  padding: 6px 12px;
  border-radius: 6px;
}
.feed-validation-msg.success { background: hsla(var(--accent-green), 0.1); color: hsl(var(--accent-green)); }
.feed-validation-msg.error { background: hsla(var(--accent-red), 0.1); color: hsl(var(--accent-red)); }

.custom-feeds-list-container {
  margin-top: 10px;
}
.custom-feeds-list-container h5 {
  font-size: 0.8rem;
  color: hsl(var(--text-muted));
  margin-bottom: 8px;
}
.custom-feeds-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}
.custom-feed-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: hsla(var(--bg-primary), 0.4);
  border: 1px solid hsla(var(--glass-border), 0.3);
  border-radius: 8px;
}
.custom-feed-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.custom-feed-title {
  font-size: 0.8rem;
  font-weight: 500;
}
.custom-feed-url {
  font-size: 0.65rem;
  color: hsl(var(--text-muted));
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.delete-feed-btn {
  background: transparent;
  color: hsl(var(--text-muted));
  padding: 4px;
}
.delete-feed-btn:hover {
  color: hsl(var(--accent-red));
}

/* 10. 반응형 최적화 */
@media (max-width: 1024px) {
  .app-content {
    grid-template-columns: 1fr;
  }
  .app-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .sidebar-nav, .share-panel, .study-tip-panel {
    flex: 1 1 300px;
  }
}

@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .market-ticker-container {
    max-width: 100%;
  }
  .search-box {
    width: 100%;
  }
  .search-box input:focus {
    width: 100%;
  }
  .modal-card {
    width: 95%;
  }
  .modal-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .footer-left {
    justify-content: space-between;
  }
  .footer-right {
    justify-content: space-between;
  }
}

.app-footer-text {
  text-align: center;
  padding: 20px 0;
  font-size: 0.7rem;
  color: hsl(var(--text-muted));
}

/* ==========================================================================
   AdSense & Premium Footer Additions
   ========================================================================== */

/* 1. 사이드바 광고 플레이스홀더 */
.adsense-sidebar-placeholder {
  border: 1px dashed hsla(var(--accent-cyan), 0.3) !important;
  background-image: linear-gradient(135deg, hsla(var(--accent-cyan), 0.04), transparent) !important;
}
.adsense-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: hsla(var(--accent-cyan), 0.6);
  letter-spacing: 1.5px;
  margin-bottom: 12px;
  text-align: center;
}
.adsense-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border-radius: 10px;
  background: hsla(var(--bg-primary), 0.4);
  border: 1px solid hsla(var(--glass-border), 0.4);
  color: hsl(var(--text-muted));
  text-align: center;
  transition: var(--transition-smooth);
}
.adsense-box i {
  font-size: 2rem;
  color: hsla(var(--accent-cyan), 0.5);
  margin-bottom: 10px;
}
.adsense-box p {
  font-size: 0.8rem;
  font-weight: 600;
  color: hsl(var(--text-main));
  margin-bottom: 4px;
}
.adsense-box span {
  font-size: 0.68rem;
  color: hsl(var(--text-muted));
}

/* 2. 가로형 탑 리더보드 광고 배너 */
.adsense-banner-placeholder {
  border: 1px dashed hsla(var(--accent-cyan), 0.3);
  background: hsla(var(--glass-bg));
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.adsense-banner-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: hsla(var(--accent-cyan), 0.6);
  letter-spacing: 2px;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.adsense-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.adsense-banner-content i {
  font-size: 2.2rem;
  color: hsla(var(--accent-cyan), 0.6);
}
.adsense-banner-text {
  flex: 1;
}
.adsense-banner-text h5 {
  font-size: 0.9rem;
  font-weight: 600;
  color: hsl(var(--text-main));
  margin-bottom: 4px;
}
.adsense-banner-text p {
  font-size: 0.78rem;
  color: hsl(var(--text-muted));
  line-height: 1.4;
}
.banner-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: hsla(var(--accent-cyan), 0.12);
  color: hsl(var(--accent-cyan));
  border: 1px solid hsla(var(--accent-cyan), 0.2);
}

/* 3. 대형 포털 푸터 */
.app-portal-footer {
  margin-top: 50px;
  padding: 40px 30px 20px 30px;
  background: hsla(var(--glass-bg));
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-top: 1px solid hsla(var(--glass-border));
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.branding-col {
  max-width: 420px;
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.footer-desc {
  font-size: 0.8rem;
  line-height: 1.6;
  color: hsl(var(--text-muted));
}
.footer-col h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: hsl(var(--text-main));
  border-bottom: 2px solid hsla(var(--glass-border));
  padding-bottom: 8px;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col a {
  font-size: 0.82rem;
  color: hsl(var(--text-muted));
  text-decoration: none;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.footer-col a:hover {
  color: hsl(var(--accent-cyan));
  transform: translateX(2px);
}

/* 4. 투자 면책고지 박스 */
.footer-disclaimer {
  background: hsla(var(--bg-primary), 0.4);
  border: 1px solid hsla(var(--glass-border), 0.4);
  border-radius: 10px;
  padding: 20px;
  font-size: 0.72rem;
  line-height: 1.6;
  color: hsl(var(--text-muted));
  text-align: justify;
}
.footer-disclaimer strong {
  color: hsl(var(--accent-gold));
}

/* 5. 푸터 하단 저작권 및 사이트맵 태그 */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid hsla(var(--glass-border), 0.4);
  padding-top: 20px;
  font-size: 0.75rem;
  color: hsl(var(--text-muted));
  flex-wrap: wrap;
  gap: 15px;
}
.sitemap-badge {
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 600;
  color: hsl(var(--accent-green)) !important;
  background: hsla(var(--accent-green), 0.1);
  border: 1px solid hsla(var(--accent-green), 0.3);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}
.sitemap-badge:hover {
  background: hsla(var(--accent-green), 0.2);
  transform: scale(1.03);
}

/* 반응형 미디어 쿼리 추가 */
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .adsense-banner-content {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  .adsense-banner-text {
    width: 100%;
  }
  .banner-badge {
    align-self: center;
  }
}
