/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* 강제 가로 레이아웃 복원 - 최우선 적용 */
html {
  width: 100vw !important;
  min-width: 100vw !important;
  max-width: none !important;
  height: auto !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: auto !important;
  overflow-y: auto !important;
  position: static !important;
  display: block !important;
  writing-mode: horizontal-tb !important;
  direction: ltr !important;
  zoom: 1 !important;
  -webkit-text-size-adjust: 100% !important;
  -ms-text-size-adjust: 100% !important;
  transform: none !important;
  perspective: none !important;
  box-sizing: border-box !important;
}

/* 강제 데스크톱 레이아웃 */
@media screen and (max-width: 3000px) {
  html, body {
    width: 100vw !important;
    min-width: 100vw !important;
    max-width: none !important;
    overflow-x: auto !important;
    display: block !important;
    writing-mode: horizontal-tb !important;
    flex-direction: row !important;
    grid-template-columns: unset !important;
  }
  
  .dashboard, .main-content, .container {
    width: 100% !important;
    min-width: 100% !important;
    max-width: none !important;
    display: block !important;
  }
  
  .charts-grid, .grid, .flex-container {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    width: 100% !important;
  }
}

/* 모든 방향에서 가로 모드 강제 */
@media screen and (orientation: portrait), 
       screen and (orientation: landscape),
       screen and (max-width: 2000px) {
  html, body {
    width: 100vw !important;
    min-width: 100vw !important;
    overflow-x: auto !important;
    transform: none !important;
    writing-mode: horizontal-tb !important;
    direction: ltr !important;
  }
}

/*
 * Main dashboard/chart styles for QWER chart 현황
 */

body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  font-family: 'Spoqa Han Sans Neo', 'Segoe UI', 'Apple SD Gothic Neo', Arial, sans-serif;
  color: #222;
  margin: 0;
  padding: 20px;
  min-height: 100vh;
  position: relative;
  overflow-x: auto;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
  z-index: -1;
}

/* Dashboard Layout */
.dashboard {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.charts-grid {
  display: grid;
  gap: 30px;
}

.chart-section {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  padding: 35px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.2);
  position: relative;
  overflow: hidden;
}

.chart-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 30px 0;
  color: #333;
  text-align: center;
  position: relative;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 1px;
}

.chart-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 25px;
}

/* Chart Cards */
.chart-card {
  background: white;
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
}

.chart-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--card-color), var(--card-color-light));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.chart-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.chart-card:hover::before {
  opacity: 1;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f0f0f0;
  position: relative;
}

.chart-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 50px;
  height: 2px;
  background: var(--card-color);
  border-radius: 1px;
}

.chart-header h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
  color: #333;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.chart-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
  transition: transform 0.3s ease;
}

.chart-card:hover .chart-icon {
  transform: scale(1.1) rotate(5deg);
}

.chart-content {
  min-height: 80px;
}

.chart-item {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  padding: 15px 18px;
  margin-bottom: 10px;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #374151;
  border-left: 5px solid var(--card-color);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.chart-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}

.chart-item:hover {
  background: linear-gradient(135deg, var(--card-hover-bg), var(--card-hover-bg-light));
  transform: translateX(5px) scale(1.02);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.chart-item:hover::before {
  left: 100%;
}

.chart-item:last-child {
  margin-bottom: 0;
}

.chart-item.no-data {
  color: #6b7280;
  border-left-color: #d1d5db;
  font-style: italic;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

/* Chart Card Themes */
.chart-card.melon {
  --card-color: #00c73c;
  --card-color-light: #00e676;
  --card-hover-bg: #e8f5e8;
  --card-hover-bg-light: #d4edda;
}

.chart-card.hanteo {
  --card-color: #ff6b35;
  --card-color-light: #ff8a65;
  --card-hover-bg: #fff3e0;
  --card-hover-bg-light: #ffe0b2;
}

.chart-card.circle {
  --card-color: #8b5cf6;
  --card-color-light: #a78bfa;
  --card-hover-bg: #f3e8ff;
  --card-hover-bg-light: #e9d5ff;
}

.chart-card.hanteo-album {
  --card-color: #f59e0b;
  --card-color-light: #fbbf24;
  --card-hover-bg: #fffbeb;
  --card-hover-bg-light: #fef3c7;
}

.chart-card.circle-album {
  --card-color: #ec4899;
  --card-color-light: #f472b6;
  --card-hover-bg: #fdf2f8;
  --card-hover-bg-light: #fce7f3;
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  .chart-section {
    padding: 25px;
  }
  
  .chart-cards {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .chart-card {
    padding: 20px;
  }
  
  .chart-header h3 {
    font-size: 1.3rem;
  }
  
  .chart-item {
    font-size: 1rem;
    padding: 12px 15px;
  }
}

@media (max-width: 480px) {
  .section-title {
    font-size: 1.6rem;
  }
  
  .chart-section {
    padding: 20px;
  }
  
  .chart-card {
    padding: 15px;
  }
  
  .chart-item {
    font-size: 0.95rem;
    padding: 10px 12px;
  }
}

/* Legacy styles for backward compatibility */
.container {
  max-width: 540px;
  margin: 20px auto 24px auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 6px 32px rgba(37,99,235,0.08), 0 1.5px 6px rgba(0,0,0,0.03);
  padding: 28px 24px 20px 24px;
  transition: box-shadow 0.2s;
}

.container:hover {
  box-shadow: 0 10px 40px rgba(37,99,235,0.13), 0 2px 8px rgba(0,0,0,0.04);
}

h1, h2 {
  text-align: center;
  font-weight: 700;
  margin-bottom: 18px;
  margin-top: 0;
  letter-spacing: 1.5px;
  color: #2563eb;
  font-size: 2rem;
}

h2 {
  font-size: 1.3rem;
  margin-bottom: 18px;
}

ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

li {
  background: #f0f4ff;
  margin-bottom: 12px;
  padding: 16px 20px;
  border-radius: 8px;
  font-size: 1.1rem;
  transition: background 0.2s, transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  word-break: keep-all;
}

li:hover {
  background: #dbeafe;
  transform: translateY(-2px) scale(1.02);
}

.hanteo-card {
  background: linear-gradient(90deg, #e0edff 60%, #f7faff 100%);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(37,99,235,0.08);
  padding: 24px 18px;
  text-align: center;
  font-size: 1.15rem;
  color: #1e293b;
  font-weight: 500;
  margin-bottom: 0;
}

.chart-label {
  font-size: 0.98em;
  color: #888;
  margin: 0 0 4px 2px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* 스크롤바 완전 숨김 (cross-browser) */
body::-webkit-scrollbar {
  display: none;
}
body {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE, Edge */
}

/* html 스크롤바 완전 숨김 (cross-browser) */
html::-webkit-scrollbar {
  display: none;
}
html {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE, Edge */
}

/* Dynamic Island - Apple Style - 중앙 위치 */
#dynamic-island {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  background: rgba(28, 28, 30, 0.9) !important;
  backdrop-filter: blur(30px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(30px) saturate(180%) !important;
  border: 1px solid rgba(84, 84, 88, 0.5) !important;
  color: #ffffff !important;
  border-radius: 50px !important;
  padding: 8px 20px !important;
  box-shadow: 
    0 8px 40px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.15),
    0 0 0 1px rgba(255,255,255,0.05) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 999999 !important;
  min-width: 180px !important;
  max-width: 180px !important;
  height: 60px !important;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  user-select: none !important;
}

/* 호버 시 확장 애니메이션 */
#dynamic-island:hover {
  transform: translate(-50%, -50%) scale(1.08) !important;
  padding: 16px 32px !important;
  min-width: 320px !important;
  max-width: 400px !important;
  height: 80px !important;
  font-size: 15px !important;
  background: rgba(28, 28, 30, 0.95) !important;
  box-shadow: 
    0 20px 60px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.2),
    0 0 0 1px rgba(255,255,255,0.1) !important;
  border-radius: 45px !important;
}

/* 클릭 시 살짝 축소 */
#dynamic-island:active {
  transform: translate(-50%, -50%) scale(0.98) !important;
}

#dynamic-island.expanded {
  min-width: 350px !important;
  padding: 18px 36px !important;
  border-radius: 40px !important;
  height: 90px !important;
}

#dynamic-island.minimized {
  min-width: 140px !important;
  padding: 6px 16px !important;
  border-radius: 30px !important;
  height: 50px !important;
}

#music-info {
  flex: 1 !important;
  margin-right: 16px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  opacity: 0.85 !important;
  transition: all 0.4s ease !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: flex-start !important;
}

#dynamic-island:hover #music-info {
  opacity: 1 !important;
  margin-right: 20px !important;
}

#song-title {
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
  margin-bottom: 2px !important;
  display: block !important;
  width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

#dynamic-island:hover #song-title {
  font-size: 16px !important;
  margin-bottom: 4px !important;
}

#artist-name {
  color: #8e8e93 !important;
  font-weight: 400 !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  display: block !important;
  width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

#dynamic-island:hover #artist-name {
  font-size: 13px !important;
  color: #a1a1a6 !important;
}

#play-pause-btn {
  background: rgba(255,255,255,0.12) !important;
  border: 1px solid rgba(255,255,255,0.25) !important;
  color: #ffffff !important;
  border-radius: 50% !important;
  width: 36px !important;
  height: 36px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 14px !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  opacity: 0.8 !important;
  flex-shrink: 0 !important;
}

#dynamic-island:hover #play-pause-btn {
  width: 44px !important;
  height: 44px !important;
  font-size: 16px !important;
  opacity: 1 !important;
  background: rgba(255,255,255,0.18) !important;
  border: 1px solid rgba(255,255,255,0.3) !important;
  transform: scale(1.05) !important;
}

#play-pause-btn:hover {
  background: rgba(255,255,255,0.25) !important;
  transform: scale(1.1) !important;
  box-shadow: 0 4px 20px rgba(255,255,255,0.1) !important;
}

#play-pause-btn:active {
  transform: scale(0.95) !important;
}

#progress-container {
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 3px !important;
  background: rgba(255,255,255,0.08) !important;
  border-radius: 0 0 50px 50px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  transition: all 0.4s ease !important;
}

#dynamic-island:hover #progress-container {
  opacity: 1 !important;
  height: 4px !important;
}

#progress-bar {
  height: 100% !important;
  background: linear-gradient(90deg, #007aff 0%, #5856d6 50%, #34c759 100%) !important;
  width: 45% !important; /* 데모용 진행률 */
  transition: width 0.2s ease !important;
  border-radius: 0 0 50px 50px !important;
  box-shadow: 0 0 10px rgba(0, 122, 255, 0.3) !important;
}

/* 로딩 애니메이션 */
#dynamic-island.loading {
  animation: islandPulse 2s ease-in-out infinite !important;
}

@keyframes islandPulse {
  0%, 100% { 
    opacity: 0.85;
    transform: translate(-50%, -50%) scale(1);
  }
  50% { 
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.02);
  }
}

/* 배경 블러 효과 */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: backdrop-filter 0.3s ease;
  pointer-events: none;
  z-index: -1;
}

#dynamic-island:hover ~ * {
  filter: blur(0.5px) brightness(0.98);
  transition: filter 0.3s ease;
}

/* 모바일 대응 */
@media (max-width: 768px) {
  #dynamic-island {
    min-width: 160px !important;
    max-width: 160px !important;
    height: 55px !important;
    font-size: 12px !important;
    padding: 6px 18px !important;
  }
  
  #dynamic-island:hover {
    min-width: 280px !important;
    max-width: 320px !important;
    height: 70px !important;
    padding: 12px 24px !important;
  }
  
  #play-pause-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 12px !important;
  }
  
  #dynamic-island:hover #play-pause-btn {
    width: 38px !important;
    height: 38px !important;
    font-size: 14px !important;
  }
}
