/* ============================================
   Mici Tuffo - IBD Research Monitor
   Shared Stylesheet - New Visual Identity
   ============================================ */

/* CSS Variables - Mici Tuffo Brand */
:root {
  --primary: #1e3a8a;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a8a;
  --accent: #06b6d4;
  --accent-light: #22d3ee;
  --secondary: #059669;
  --danger: #dc2626;
  --bg: #f0f9ff;
  --bg-card: #ffffff;
  --bg-dark: #0f172a;
  --text: #1e293b;
  --text-light: #64748b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --gradient: linear-gradient(135deg, #1e3a8a, #06b6d4);
  --gradient-light: linear-gradient(135deg, #3b82f6, #22d3ee);
  --shadow: 0 4px 15px rgba(30, 58, 138, 0.1);
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 25px -3px rgba(30, 58, 138, 0.15), 0 4px 6px -4px rgba(30, 58, 138, 0.1);
  --radius: 12px;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --transition: all 0.2s ease;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 1280px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  height: auto;
}

/* ============================================
   LAYOUT
   ============================================ */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
}

/* Grid */
.grid {
  display: grid;
  gap: 1rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1023px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 639px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  
  /* Fix mobile overflow */
  .container { padding: 0 0.75rem; }
  .header-inner { padding: 0 0.5rem; }
  .logo { font-size: 1rem; gap: 0.5rem; }
  .logo-icon { width: 32px; height: 32px; }
  .nav-mobile-toggle { width: 40px; height: 40px; }
  
  /* Prevent horizontal scroll */
  * { max-width: 100vw; }
  .card, .profile-container, .stats-grid { margin-left: 0; margin-right: 0; }
}

/* Flex */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

/* ============================================
   HEADER & NAVIGATION - Mici Tuffo Style
   ============================================ */

.header {
  background: var(--gradient);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: white;
}

.logo:hover {
  color: rgba(255,255,255,0.9);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.875rem;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius);
}

.nav-desktop {
  display: none;
}

@media (min-width: 768px) {
  .nav-desktop {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }
}

.nav-link {
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius);
  color: rgba(255,255,255,0.85);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: white;
  background: rgba(255,255,255,0.15);
}

.nav-mobile-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255,255,255,0.15);
  cursor: pointer;
  color: white;
  border-radius: var(--radius);
  transition: var(--transition);
}

.nav-mobile-toggle:hover {
  background: rgba(255,255,255,0.25);
}

@media (min-width: 768px) {
  .nav-mobile-toggle {
    display: none;
  }
}

.nav-mobile {
  display: none;
  border-top: 1px solid rgba(255,255,255,0.2);
  padding: 0.5rem 0;
  background: var(--gradient);
}

.nav-mobile.open {
  display: block;
}

.nav-mobile .nav-link {
  display: block;
  padding: 0.875rem 1rem;
  min-height: 44px;
}

/* ============================================
   AUTH NAVIGATION
   ============================================ */

.auth-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.auth-nav .btn-auth-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  color: white;
  cursor: pointer;
  min-height: 44px;
}

.auth-nav .btn-auth-nav:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
}

.auth-nav .btn-auth-nav.primary {
  background: white;
  color: var(--primary);
  border-color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.auth-nav .btn-auth-nav.primary:hover {
  background: var(--bg);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.auth-nav .user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

.auth-nav .user-info:hover {
  background: rgba(255,255,255,0.25);
  color: white;
}

.auth-nav .user-info .username {
  font-weight: 500;
  color: white;
}

.auth-nav .user-info .avatar {
  width: 32px;
  height: 32px;
  background: white;
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.auth-nav .nav-divider {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,0.3);
}

/* Mobile auth nav */
.nav-mobile .auth-nav {
  flex-direction: column;
  align-items: stretch;
  padding: 0.75rem 1rem;
  gap: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.2);
  margin-top: 0.5rem;
}

.nav-mobile .auth-nav .btn-auth-nav {
  justify-content: center;
}

.nav-mobile .auth-nav .user-info {
  justify-content: center;
}

/* ============================================
   LANGUAGE SELECTOR
   ============================================ */

.lang-selector {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.75rem;
  padding: 0.125rem;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.1);
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: calc(var(--radius) - 2px);
  font-size: 1rem;
  line-height: 1;
  opacity: 0.7;
  transition: var(--transition);
  padding: 0;
}

.lang-btn:hover {
  opacity: 1;
  background: rgba(255,255,255,0.15);
}

.lang-btn.active {
  opacity: 1;
  background: rgba(255,255,255,0.25);
}

.nav-mobile .lang-selector {
  margin: 0.5rem 1rem 0.25rem;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  background: var(--bg-dark);
  color: var(--text-light);
  padding: 2rem 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: var(--text-light);
  font-size: 0.875rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.footer-links a:hover {
  color: var(--accent-light);
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
}

/* Stat Card */
.stat-card {
  padding: 1.5rem;
  text-align: center;
}

/* Stat Link (clickable stat card) */
a.stat-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

a.stat-link:hover {
  color: inherit;
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

a.stat-link .stat-value {
  transition: var(--transition);
}

a.stat-link:hover .stat-value {
  color: var(--accent);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.stat-change {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.stat-change.up { color: var(--secondary); }
.stat-change.down { color: var(--danger); }

/* ============================================
   BADGES - Mici Tuffo Colors
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
}

.badge-primary { background: #dbeafe; color: var(--primary); }
.badge-secondary { background: #cffafe; color: #0e7490; }
.badge-accent { background: #a5f3fc; color: #155e75; }
.badge-danger { background: #fee2e2; color: var(--danger); }
.badge-muted { background: var(--border-light); color: var(--text-muted); }

/* Score Badge - A/B/C with Mici Tuffo colors */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
}

.score-high { background: var(--accent); }
.score-medium { background: var(--primary-light); }
.score-low { background: #93c5fd; }

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  min-height: 44px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--gradient);
  color: white;
  border: none;
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.25);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 15px rgba(30, 58, 138, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: white;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-accent {
  background: var(--accent);
  color: white;
  border: none;
}

.btn-accent:hover:not(:disabled) {
  background: var(--accent-light);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--border-light);
  color: var(--text);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  min-height: 36px;
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text);
  transition: var(--transition);
  min-height: 44px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.form-input::placeholder {
  color: var(--text-light);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* Search Bar */
.search-bar {
  position: relative;
  width: 100%;
  max-width: 600px;
  display: flex;
  align-items: center;
}

.search-bar input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--bg-card);
  transition: var(--transition);
  min-height: 52px;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.15);
}

.search-bar .search-icon {
  position: absolute;
  left: 1rem;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  color: var(--text-light);
  pointer-events: none;
}

/* ============================================
   ARTICLE LIST
   ============================================ */

.article-item {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}

.article-item:last-child {
  border-bottom: none;
}

.article-item:hover {
  background: var(--bg);
}

.article-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.article-title a {
  color: var(--text);
}

.article-title a:hover {
  color: var(--primary-light);
}

.article-date {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
  background: #dbeafe;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius);
  margin-right: 0.5rem;
  white-space: nowrap;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.article-meta-sep {
  color: var(--text-light);
}

.article-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

.article-excerpt {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Article Date Group */
.date-group {
  margin-bottom: 2rem;
}

.date-group-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.date-group-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.date-group-count {
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: var(--border-light);
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 0.625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition);
}

.pagination-btn:hover:not(:disabled) {
  background: var(--bg);
  border-color: var(--accent);
}

.pagination-btn.active {
  background: var(--gradient);
  color: white;
  border-color: transparent;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 1rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.empty-state-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}

.skeleton-text.short { width: 40%; }

/* ============================================
   TABLES
   ============================================ */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th,
.table td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  background: var(--bg);
}

.table tbody tr:hover {
  background: var(--bg);
}

.table .cell-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ============================================
   TABS
   ============================================ */

.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.tab {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  min-height: 44px;
}

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

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.alert-info {
  background: #dbeafe;
  color: var(--primary);
  border: 1px solid #bfdbfe;
}

.alert-success {
  background: #d1fae5;
  color: var(--secondary);
  border: 1px solid #a7f3d0;
}

.alert-warning {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.alert-error {
  background: #fee2e2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

/* ============================================
   PAGE HEADER - Mici Tuffo Style
   ============================================ */

.page-header {
  padding: 2.5rem 0;
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-size: 1.875rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
}

/* ============================================
   SECTIONS
   ============================================ */

.section {
  padding: 2rem 0;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title svg {
  color: var(--accent);
}

/* ============================================
   CHART CONTAINERS
   ============================================ */

.chart-container {
  position: relative;
  width: 100%;
  min-height: 300px;
}

.chart-container canvas {
  width: 100%;
  height: 100%;
}

.chart-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  background: var(--bg);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ============================================
   FILTERS SIDEBAR
   ============================================ */

.filters-sidebar {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.filters-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--primary);
}

/* ============================================
   ARTICLE DETAIL
   ============================================ */

.article-detail-header {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}

.article-detail-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
}

.article-detail-original {
  font-size: 1rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 1rem;
}

.article-detail-abstract {
  font-size: 0.9375rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.article-section {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-light);
}

.article-section:last-child {
  border-bottom: none;
}

.article-section-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--primary);
}

.article-section-content {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text);
}

.article-section-content p {
  margin-bottom: 1rem;
}

/* Score Display */
.score-display {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--radius);
}

.score-display-value {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.score-display-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Related Links */
.related-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.related-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: var(--transition);
  min-height: 44px;
}

.related-link:hover {
  background: var(--bg);
  border-color: var(--accent);
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 767px) {
  .page-title {
    font-size: 1.5rem;
  }

  .article-detail-title {
    font-size: 1.25rem;
  }

  .card-header,
  .card-body,
  .card-footer {
    padding: 1rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .section {
    padding: 1.5rem 0;
  }
  
  .page-header {
    padding: 1.5rem 0;
  }
}

/* Hide on mobile */
.hide-mobile {
  display: none;
}

@media (min-width: 768px) {
  .hide-mobile {
    display: block;
  }

  .hide-mobile.flex {
    display: flex;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

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

/* Wave decoration for Mici Tuffo */
.wave-decoration {
  position: relative;
  overflow: hidden;
}

.wave-decoration::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,60 C300,120 900,0 1200,60 L1200,120 L0,120 Z' fill='%23f0f9ff'/%3E%3C/svg%3E") no-repeat bottom;
  background-size: cover;
}

/* ============================================
   PRINT
   ============================================ */

@media print {
  .header,
  .footer,
  .nav-mobile-toggle,
  .btn {
    display: none !important;
  }

  body {
    background: white;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
