/* e:\Antigravity\workspace\Cineaho\trend\styles.css */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

:root {
  --bg-main: #0b0f19;
  --bg-header: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(168, 85, 247, 0.3); /* Purple primary highlight */
  
  --text-main: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --color-primary: #a855f7; /* Purple */
  --color-secondary: #38bdf8; /* Cyan */
  --color-success: #10b981; /* Green */
  --color-error: #ef4444; /* Red */
  --color-warning: #f59e0b; /* Amber */
  
  --font-family: 'Inter', 'Noto Sans KR', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  letter-spacing: -0.02em;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* App Header & Toolbar */
.main-header {
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-logo {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kiwi-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #d8b4fe;
  cursor: pointer;
  transition: all 0.2s;
}

.kiwi-counter:hover {
  background: rgba(168, 85, 247, 0.25);
  transform: translateY(-1px);
}

.action-btn {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.action-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Tabs Bar */
.tabs-bar {
  background-color: rgba(17, 24, 39, 0.4);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  overflow-x: auto;
  white-space: nowrap;
}

.tabs-container {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  padding: 16px 20px;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  color: var(--color-primary);
  font-weight: 600;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-primary);
  box-shadow: 0 0 10px var(--color-primary);
}

/* Main Container */
.main-content {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.3s ease-out;
}

.tab-panel.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Glass Panels */
.glass-panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.glass-panel-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Grid Layouts */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.grid-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .grid-2col, .grid-3col {
    grid-template-columns: 1fr;
  }
}

/* Forms & Inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-text, .select-input, .textarea-input {
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  width: 100%;
}

.input-text:focus, .select-input:focus, .textarea-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.2);
}

.range-slider-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
}

.range-slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}

.range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  transition: transform 0.1s;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Buttons */
.submit-btn {
  background: linear-gradient(135deg, var(--color-primary), #7c3aed);
  color: #0b0f19;
  border: none;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.submit-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.secondary-btn {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.secondary-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Word Cloud */
.word-cloud-container {
  min-height: 200px;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
}

.word-cloud-tag {
  cursor: pointer;
  transition: all 0.2s;
  padding: 4px 8px;
  border-radius: 4px;
}

.word-cloud-tag:hover {
  transform: scale(1.1);
  background-color: rgba(255, 255, 255, 0.05);
}

/* Tables */
.table-container {
  overflow-x: auto;
}

.trend-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.trend-table th, .trend-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.trend-table th {
  font-weight: 600;
  color: var(--text-secondary);
  background-color: rgba(255, 255, 255, 0.02);
}

.trend-table tbody tr {
  transition: background-color 0.2s;
}

.trend-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

/* Ranks and badges */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.rank-top3 {
  background-color: var(--color-primary);
  color: #0b0f19;
}

.rank-other {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.badge-tag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.trend-up {
  color: var(--color-success);
}
.trend-down {
  color: var(--color-error);
}

/* Content Calendar Widget */
.calendar-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.calendar-day-header {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 0;
}

.calendar-cell {
  aspect-ratio: 1.1;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 4px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 11px;
  position: relative;
  min-height: 55px;
}

.calendar-cell-active {
  background-color: rgba(255, 255, 255, 0.04);
}

.calendar-cell-other-month {
  opacity: 0.3;
}

.calendar-day-num {
  font-weight: 500;
  color: var(--text-secondary);
}

.calendar-events-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  max-height: 36px;
  margin-top: 2px;
}

.calendar-event {
  background-color: rgba(168, 85, 247, 0.2);
  border-left: 2px solid var(--color-primary);
  color: #e9d5ff;
  padding: 1px 3px;
  border-radius: 2px;
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Saturation Meter */
.saturation-gauge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
}

.saturation-gauge-bar {
  width: 100%;
  height: 12px;
  background: linear-gradient(to right, var(--color-success) 0%, var(--color-warning) 50%, var(--color-error) 100%);
  border-radius: 6px;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.saturation-indicator {
  position: absolute;
  top: -4px;
  width: 8px;
  height: 20px;
  background-color: var(--text-main);
  border-radius: 4px;
  border: 1.5px solid #0b0f19;
  box-shadow: 0 0 6px #000;
  transform: translateX(-50%);
  transition: left 0.5s ease-out;
}

.saturation-grade-badge {
  font-size: 24px;
  font-weight: 800;
  color: var(--color-primary);
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

/* Newly Emerged Group */
.date-group {
  margin-bottom: 20px;
}

.date-group-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-secondary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.emerged-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.emerged-card {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s;
}

.emerged-card:hover {
  background-color: var(--bg-card-hover);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

/* SERP list elements */
.serp-sequence {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.serp-pill {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.serp-pill-active {
  background-color: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.3);
  color: #bae6fd;
}

/* Status overlay spinner */
.status-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

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

.status-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(168, 85, 247, 0.15);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.status-message {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  text-align: center;
}

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

.toast-message {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background-color: #1e1b4b;
  border: 1px solid var(--color-primary);
  color: #e9d5ff;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  z-index: 2000;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* News Analysis & Sources Custom Styles */
.news-freq-bar-item {
  display: flex;
  flex-direction: column;
}

.news-freq-progress-fill {
  transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#news-sentiment-bar div {
  transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.clickable-keyword:hover {
  text-decoration: underline;
  filter: brightness(1.2);
}

#news-headlines-list li a {
  transition: color 0.2s ease;
}

#news-headlines-list li a:hover {
  text-decoration: underline;
}

/* Portal Source Tabs Styles */
.source-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.source-tab-btn {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.source-tab-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.source-tab-btn.active {
  background-color: rgba(168, 85, 247, 0.15);
  color: #e9d5ff;
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

