/* ==========================================================================
   Citesc.Eu — Google Workspace Inspired Theme (Pixel Perfect)
   ========================================================================== */

:root {
  /* Google Brand Colors */
  --gw-blue-600: #1a73e8;
  --gw-blue-700: #174ea6;
  --gw-blue-800: #185abc;
  --gw-blue-50: #e8f0fe;
  --gw-blue-100: #d2e3fc;
  
  --gw-red-600: #d93025;
  --gw-red-50: #fce8e6;
  
  --gw-green-600: #1e8e3e;
  --gw-green-50: #e6f4ea;
  
  --gw-yellow-600: #f9ab00;
  --gw-yellow-50: #fef7e0;

  /* Neutrals */
  --gw-gray-900: #202124;
  --gw-gray-800: #3c4043;
  --gw-gray-700: #5f6368;
  --gw-gray-600: #80868b;
  --gw-gray-500: #9aa0a6;
  --gw-gray-400: #bdc1c6;
  --gw-gray-300: #dadce0;
  --gw-gray-200: #e8eaed;
  --gw-gray-100: #f1f3f4;
  --gw-gray-50: #f8f9fa;
  --gw-white: #ffffff;

  /* Semantic Colors */
  --gw-text-primary: var(--gw-gray-900);
  --gw-text-secondary: var(--gw-gray-700);
  --gw-text-disabled: var(--gw-gray-500);
  
  --gw-bg-main: var(--gw-white);
  --gw-bg-app: var(--gw-white); /* Used to be f8f9fa for a distinct background, but Workspace is often white */
  
  --gw-border-color: var(--gw-gray-300);
  
  /* Fonts */
  --gw-font-family: 'Google Sans', 'Roboto', 'Segoe UI', sans-serif;
  --gw-font-family-text: 'Roboto', 'Segoe UI', sans-serif;
  
  /* Shadows & Elevations */
  --gw-shadow-1: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  --gw-shadow-2: 0 1px 2px 0 rgba(60,64,67,0.3), 0 2px 6px 2px rgba(60,64,67,0.15);
  --gw-shadow-3: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
  
  /* Shape */
  --gw-radius-sm: 4px;
  --gw-radius-md: 8px;
  --gw-radius-lg: 16px;
  --gw-radius-xl: 24px;
  --gw-radius-pill: 9999px;
  
  /* Header */
  --gw-header-height: 64px;
  --gw-sidebar-width: 256px;
}

/* ==========================================================================
   Dark Mode
   ========================================================================== */

[data-theme="dark"] {
  --gw-gray-900: #e8eaed;
  --gw-gray-800: #dadce0;
  --gw-gray-700: #bdc1c6;
  --gw-gray-600: #9aa0a6;
  --gw-gray-500: #80868b;
  --gw-gray-400: #5f6368;
  --gw-gray-300: #3c4043;
  --gw-gray-200: #303134;
  --gw-gray-100: #282a2d;
  --gw-gray-50: #1f2023;
  --gw-white: #171717;

  --gw-bg-main: #171717;
  --gw-bg-app: #171717;
  --gw-border-color: #3c4043;

  --gw-blue-50: #1a2332;
  --gw-blue-100: #1d3048;
  --gw-red-50: #2d1a1a;
  --gw-green-50: #1a2d1e;
  --gw-yellow-50: #2d2a1a;

  --gw-shadow-1: 0 1px 2px 0 rgba(0,0,0,0.5), 0 1px 3px 1px rgba(0,0,0,0.3);
  --gw-shadow-2: 0 1px 2px 0 rgba(0,0,0,0.5), 0 2px 6px 2px rgba(0,0,0,0.3);
  --gw-shadow-3: 0 1px 3px 0 rgba(0,0,0,0.5), 0 4px 8px 3px rgba(0,0,0,0.3);

  color-scheme: dark;
}

[data-theme="dark"] .gw-header {
  background-color: #1f2023;
  border-bottom-color: #3c4043;
}

[data-theme="dark"] .gw-ai-card {
  background: linear-gradient(135deg, #1a2332 0%, #1d2636 100%);
  border-color: #2d3a4d;
}

[data-theme="dark"] .gw-ai-metrics {
  background-color: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .gw-search-bar {
  background-color: #282a2d;
}

[data-theme="dark"] .gw-search-bar:focus-within {
  background-color: #303134;
  border-color: #3c4043;
}

[data-theme="dark"] .gw-tag {
  background-color: #282a2d;
  border-color: #3c4043;
}

[data-theme="dark"] .gw-intensity-dot {
  background-color: var(--gw-gray-400);
}

[data-theme="dark"] .gw-ai-alert {
  background-color: rgba(249, 171, 0, 0.1);
}

[data-theme="dark"] .gw-ai-alert.gw-alert-sentiment_shift,
[data-theme="dark"] .gw-ai-alert.gw-alert-intensity_spike {
  background-color: rgba(217, 48, 37, 0.1);
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--gw-bg-app);
  color: var(--gw-text-primary);
  font-family: var(--gw-font-family-text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .gw-font-google-sans {
  font-family: var(--gw-font-family);
  font-weight: 400;
  color: var(--gw-text-primary);
  margin-top: 0;
}

a {
  color: var(--gw-blue-600);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Material Symbols Adjustments */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  color: var(--gw-gray-700);
  font-size: 24px;
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
}

/* ==========================================================================
   Layout & Structure
   ========================================================================== */

.gw-body {
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Prevent body scroll, handle in main */
}

/* Header */
.gw-header {
  height: var(--gw-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  background-color: var(--gw-white);
  border-bottom: 1px solid var(--gw-border-color);
  box-sizing: border-box;
  flex-shrink: 0;
  z-index: 1000;
}

.gw-header-left, .gw-header-right {
  display: flex;
  align-items: center;
  min-width: 200px;
}

.gw-header-right {
  justify-content: flex-end;
  padding-right: 12px;
  gap: 4px;
}

.gw-header-center {
  flex: 1 1 auto;
  max-width: 720px;
  display: flex;
  align-items: center;
  padding: 0 20px;
}

/* Brand */
.gw-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none !important;
  margin-left: 4px;
  padding-right: 30px;
}

.gw-brand-icon {
  color: var(--gw-blue-600);
  font-size: 28px;
  font-variation-settings: 'FILL' 1;
}

.gw-brand-text {
  font-family: var(--gw-font-family);
  font-size: 22px;
  font-weight: 400;
  color: var(--gw-text-primary);
  line-height: 24px;
}

/* Icon Buttons */
.gw-icon-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  color: var(--gw-gray-700);
}

.gw-icon-button:hover, .gw-icon-button:focus {
  background-color: var(--gw-gray-100);
  outline: none;
}

.gw-icon-button-sm {
  width: 36px;
  height: 36px;
}

.gw-icon-button-sm .material-symbols-outlined {
  font-size: 20px;
}

/* Search Bar */
.gw-search-bar {
  display: flex;
  align-items: center;
  background-color: var(--gw-gray-100);
  border-radius: var(--gw-radius-pill);
  height: 48px;
  width: 100%;
  padding: 0 8px;
  transition: background-color 0.2s, box-shadow 0.2s;
  border: 1px solid transparent;
}

.gw-search-bar:focus-within {
  background-color: var(--gw-white);
  box-shadow: var(--gw-shadow-1);
  border-color: var(--gw-white);
}

.gw-search-input {
  border: none;
  background: transparent;
  font-size: 16px;
  font-family: var(--gw-font-family-text);
  color: var(--gw-text-primary);
  flex: 1;
  outline: none;
  padding: 0 8px;
}

.gw-search-input::placeholder {
  color: var(--gw-gray-600);
}

/* Profile Avatar */
.gw-profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--gw-blue-600);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  cursor: pointer;
}

.gw-profile-avatar .material-symbols-outlined {
  color: white;
  font-size: 20px;
}

/* Main Container & Sidebar */
.gw-main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - var(--gw-header-height));
}

.gw-sidebar {
  width: var(--gw-sidebar-width);
  background-color: var(--gw-bg-app);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding-top: 8px;
  overflow-y: auto;
}

.gw-nav {
  display: flex;
  flex-direction: column;
  padding: 0 12px;
}

.gw-nav-item {
  display: flex;
  align-items: center;
  height: 48px;
  border-radius: var(--gw-radius-pill);
  padding: 0 12px;
  color: var(--gw-gray-800);
  text-decoration: none !important;
  font-weight: 500;
  font-size: 14px;
  transition: background-color 0.2s;
}

.gw-nav-item .material-symbols-outlined {
  margin-right: 18px;
  color: var(--gw-gray-700);
}

.gw-nav-item:hover {
  background-color: var(--gw-gray-100);
}

.gw-nav-item.active {
  background-color: var(--gw-blue-50);
  color: var(--gw-blue-700);
}

.gw-nav-item.active .material-symbols-outlined {
  color: var(--gw-blue-700);
  font-variation-settings: 'FILL' 1;
}

.gw-nav-divider {
  height: 1px;
  background-color: var(--gw-gray-200);
  margin: 8px 0;
}

.gw-nav-section-title {
  padding: 12px 12px 4px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gw-gray-700);
  letter-spacing: 0.3px;
}

/* Content Area */
.gw-content {
  flex: 1;
  overflow-y: auto;
  background-color: var(--gw-white); /* White background for the main content area */
  border-radius: var(--gw-radius-lg) 0 0 0; /* Optional: adds a slight card effect if sidebar background is darker */
  box-shadow: none;
}

.gw-content-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 32px 64px 32px;
}

@media (max-width: 768px) {
  .gw-content-inner {
    padding: 16px 16px 64px 16px;
  }
}

/* ==========================================================================
   Components (Index Page)
   ========================================================================== */

/* Page Header */
.gw-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}

.gw-page-title {
  font-size: 28px;
  font-weight: 400;
  color: var(--gw-text-primary);
  margin: 0;
}

/* Live Status Indicator */
.gw-live-status {
  display: flex;
  align-items: center;
  background-color: var(--gw-gray-100);
  padding: 4px 12px;
  border-radius: var(--gw-radius-pill);
  font-size: 12px;
  font-weight: 500;
  color: var(--gw-gray-700);
}

.gw-live-dot {
  width: 8px;
  height: 8px;
  background-color: var(--gw-green-600);
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse-live 2s infinite;
}

@keyframes pulse-live {
  0% { box-shadow: 0 0 0 0 rgba(30, 142, 62, 0.4); }
  70% { box-shadow: 0 0 0 4px rgba(30, 142, 62, 0); }
  100% { box-shadow: 0 0 0 0 rgba(30, 142, 62, 0); }
}

.gw-live-text {
  margin-right: 6px;
  letter-spacing: 0.5px;
}

.gw-live-time {
  color: var(--gw-gray-600);
}

/* AI Megamind Card (Like Google Workspace AI Features) */
.gw-ai-card {
  background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
  border: 1px solid #d2e3fc;
  border-radius: var(--gw-radius-xl);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--gw-shadow-1);
}

.gw-ai-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.gw-ai-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--gw-font-family);
  font-size: 16px;
  font-weight: 500;
  color: var(--gw-blue-800);
}

.gw-ai-icon {
  color: var(--gw-blue-600);
  font-variation-settings: 'FILL' 1;
}

.gw-ai-summary {
  font-size: 15px;
  line-height: 1.6;
  color: var(--gw-text-primary);
  margin-bottom: 20px;
}

.gw-ai-metrics {
  display: flex;
  flex-direction: column;
  gap: 24px;
  background-color: rgba(255, 255, 255, 0.6);
  border-radius: var(--gw-radius-lg);
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.gw-metric-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gw-metric-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--gw-gray-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gw-sentiment-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gw-sentiment-track {
  height: 6px;
  background-color: var(--gw-gray-200);
  border-radius: var(--gw-radius-pill);
  flex-grow: 1;
  overflow: hidden;
}

.gw-sentiment-indicator {
  height: 100%;
  background-color: var(--gw-blue-600);
  border-radius: var(--gw-radius-pill);
  transition: width 0.5s ease-in-out, background-color 0.5s ease;
}

.gw-metric-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--gw-gray-800);
  min-width: 40px;
}

.gw-trending-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gw-tag {
  background-color: var(--gw-white);
  border: 1px solid var(--gw-gray-300);
  color: var(--gw-gray-800);
  padding: 4px 10px;
  border-radius: var(--gw-radius-pill);
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.gw-ai-card-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

/* Megamind Intensity Dots */
.gw-intensity-dots {
  display: flex;
  gap: 3px;
  align-items: center;
}

.gw-intensity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--gw-gray-300);
  transition: background-color 0.3s;
}

.gw-intensity-dot.filled {
  background-color: var(--gw-blue-600);
}

.gw-megamind-countdown {
  font-size: 13px;
  color: var(--gw-gray-600);
  white-space: nowrap;
}

/* Category Sentiment Rows */
.gw-category-sentiments {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gw-category-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gw-category-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--gw-gray-700);
  min-width: 70px;
  text-transform: capitalize;
}

/* Megamind Alerts */
.gw-ai-alerts {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gw-ai-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--gw-radius-md);
  font-size: 13px;
  font-weight: 500;
  background-color: var(--gw-yellow-50);
  color: var(--gw-gray-900);
  border: 1px solid var(--gw-yellow-600);
}

.gw-ai-alert.gw-alert-sentiment_shift { background-color: var(--gw-red-50); border-color: var(--gw-red-600); }
.gw-ai-alert.gw-alert-intensity_spike { background-color: var(--gw-red-50); border-color: var(--gw-red-600); }

/* Skeleton Loading States */
.gw-skeleton-text {
  display: inline-block;
  height: 16px;
  background-color: rgba(0,0,0,0.06);
  border-radius: 4px;
  width: 100%;
  margin-bottom: 8px;
  animation: pulse-skeleton 1.5s infinite ease-in-out;
}

.gw-skeleton-tag {
  display: inline-block;
  height: 24px;
  width: 60px;
  background-color: rgba(0,0,0,0.06);
  border-radius: 12px;
  animation: pulse-skeleton 1.5s infinite ease-in-out;
}
.gw-skeleton-tag:nth-child(2) { width: 80px; animation-delay: 0.2s; }

@keyframes pulse-skeleton {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

/* Tabs */
.gw-tabs-container {
  position: relative;
  margin-bottom: 24px;
}

.gw-tabs {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 32px;
}

.gw-tab-item {
  margin: 0;
}

.gw-tab-link {
  background: transparent;
  border: none;
  padding: 12px 0;
  font-family: var(--gw-font-family);
  font-size: 14px;
  font-weight: 500;
  color: var(--gw-gray-600);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.gw-tab-link:hover {
  color: var(--gw-gray-900);
}

.gw-tab-link.active {
  color: var(--gw-blue-600);
}

.gw-tab-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--gw-blue-600);
  border-radius: 3px 3px 0 0;
}

.gw-tabs-border {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background-color: var(--gw-gray-300);
  z-index: -1;
}

/* Buttons */
.gw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  height: 36px;
  border-radius: var(--gw-radius-pill);
  font-family: var(--gw-font-family);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s;
  border: 1px solid transparent;
  text-decoration: none !important;
}

.gw-btn-text {
  background-color: transparent;
  color: var(--gw-blue-600);
  padding: 0 16px;
}

.gw-btn-text:hover {
  background-color: var(--gw-blue-50);
}

/* Feed & Cards */
.gw-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gw-empty-state {
  text-align: center;
  padding: 64px 0;
  color: var(--gw-gray-600);
}

/* These styles apply to the JS-injected article cards */
.gw-article-card {
  display: flex;
  padding: 16px;
  background-color: var(--gw-white);
  border: 1px solid var(--gw-gray-300);
  border-radius: var(--gw-radius-md);
  transition: box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}

.gw-article-card:hover {
  box-shadow: var(--gw-shadow-1);
  border-color: transparent;
}

.gw-article-content {
  flex: 1;
}

.gw-article-title {
  font-family: var(--gw-font-family);
  font-size: 16px;
  font-weight: 500;
  color: var(--gw-text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.gw-article-title a {
  color: inherit;
  text-decoration: none;
}

.gw-article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--gw-gray-600);
}

.gw-source-badge {
  background-color: var(--gw-gray-100);
  color: var(--gw-gray-800);
  padding: 2px 8px;
  border-radius: var(--gw-radius-sm);
  font-weight: 500;
}

/* Animation for new articles — two-phase queue system */
.gw-article-enter {
  overflow: hidden;
  height: 0;
  transition: height 300ms ease-out;
}

.gw-article-enter .gw-article-card {
  opacity: 0;
  transition: opacity 250ms ease-in 100ms;
}

.gw-article-enter.expanding {
  /* height set via JS to scrollHeight */
}

.gw-article-enter.expanding .gw-article-card {
  opacity: 1;
}

.gw-article-card.new-item {
  border-left: 4px solid var(--gw-blue-600);
}

/* Favorite button on article cards */
.gw-favorite-btn {
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.2s;
}

.gw-article-card:hover .gw-favorite-btn,
.gw-favorite-btn.is-favorited {
  opacity: 1;
}

/* Filled star icon for favorites */
.gw-star-filled {
  font-variation-settings: 'FILL' 1;
  color: var(--gw-yellow-600);
}

/* Vue cloak — hide template until mounted */
[v-cloak] { display: none !important; }

/* Search Section (in-page, visible on all viewports) */
.gw-search-section {
  margin-bottom: 20px;
}

/* Filter Chips */
.gw-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.gw-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: var(--gw-blue-50);
  color: var(--gw-blue-700);
  padding: 4px 10px;
  border-radius: var(--gw-radius-pill);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.gw-filter-chip:hover {
  background-color: var(--gw-blue-100);
}

/* New Articles Banner */
.gw-new-articles-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background-color: var(--gw-blue-600);
  color: white;
  padding: 8px 16px;
  border-radius: var(--gw-radius-pill);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 16px;
  transition: background-color 0.2s;
}

.gw-new-articles-banner:hover {
  background-color: var(--gw-blue-700);
}

/* ==========================================================================
   Responsive — Mobile
   ========================================================================== */

@media (max-width: 768px) {
  .gw-header-left, .gw-header-right { min-width: auto; }
  .gw-header-center { display: none; }
  .gw-brand-text { display: none; }
  .gw-page-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .gw-tabs { gap: 16px; overflow-x: auto; }
  .gw-sidebar { display: none; }
}

@media (max-width: 480px) {
  .gw-page-title { font-size: 22px; }
  .gw-content-inner { padding: 12px; }
  .gw-ai-card { padding: 16px; }
}
