/* 
  Models Provider Theme System - Centralized Styling
  Supporta tutti i provider con CSS Variables per colori personalizzabili
*/

:root {
  --brand-primary: #10a37f;
  --brand-dark: #0d8a65;
  --brand-light: rgba(16, 163, 127, 0.1);
  --brand-light-more: rgba(16, 163, 127, 0.15);
  --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-code: 'Courier New', monospace;
  --radius-lg: 20px;
  --radius-md: 15px;
  --shadow-xl: 0 15px 35px rgba(0, 0, 0, 0.1);
}

/* Provider-specific overrides */
body.provider-anthropic {
  --brand-primary: #d2691e;
  --brand-dark: #b3521a;
  --brand-light: rgba(210, 105, 30, 0.1);
  --brand-light-more: rgba(210, 105, 30, 0.15);
}

body.provider-google {
  --brand-primary: #4285F4;
  --brand-dark: #1f6ee5;
  --brand-light: rgba(66, 133, 244, 0.1);
  --brand-light-more: rgba(66, 133, 244, 0.15);
}

body.provider-mistral {
  --brand-primary: #FF6B35;
  --brand-dark: #e85a2a;
  --brand-light: rgba(255, 107, 53, 0.1);
  --brand-light-more: rgba(255, 107, 53, 0.15);
}

body.provider-meta {
  --brand-primary: #0A66C2;
  --brand-dark: #0851a5;
  --brand-light: rgba(10, 102, 194, 0.1);
  --brand-light-more: rgba(10, 102, 194, 0.15);
}

body.provider-xai {
  --brand-primary: #000000;
  --brand-dark: #333333;
  --brand-light: rgba(0, 0, 0, 0.08);
  --brand-light-more: rgba(0, 0, 0, 0.12);
}

body.provider-cohere {
  --brand-primary: #5555FF;
  --brand-dark: #3333dd;
  --brand-light: rgba(85, 85, 255, 0.1);
  --brand-light-more: rgba(85, 85, 255, 0.15);
}

body.provider-perplexity {
  --brand-primary: #009E9D;
  --brand-dark: #007d7c;
  --brand-light: rgba(0, 158, 157, 0.1);
  --brand-light-more: rgba(0, 158, 157, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-primary); background: #f8f9fa; min-height: 100vh; color: #333; padding-top: 40px; }

.header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding-top: 40px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.header h1 {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-dark));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.company-logo {
  width: 75px;
  height: 75px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-dark));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.header-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.header-title > div:nth-child(2) {
  text-align: left;
}

.header-title h1 {
  font-size: 2.5rem;
  margin-bottom: 0.25rem;
}

.header-title p {
  margin: 0;
  color: #666;
  font-size: 1rem;
}

.back-btn {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 60px;
  height: 60px;
  background: var(--brand-primary);
  border: none;
  border-radius: 50%;
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.back-btn:hover {
  background: var(--brand-dark);
  transform: scale(1.1);
}

.main-container {
  margin: 0 auto;
  padding: 2rem;
}

.company-overview {
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-xl);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.overview-item {
  text-align: center;
  padding: 1rem;
  background: var(--brand-light);
  border-radius: var(--radius-md);
  border: 2px solid var(--brand-light-more);
  transition: all 0.3s ease;
}

.overview-item:hover {
  background: var(--brand-light-more);
  transform: translateY(-2px);
}

.overview-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--brand-primary);
  margin-bottom: 0.5rem;
}

.overview-label {
  color: #666;
  font-size: 0.9rem;
}

.models-section { margin-bottom: 4rem; }

.section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  font-size: 2rem;
  font-weight: bold;
  color: var(--brand-primary);
}

.section-icon { font-size: 2.5rem; margin-right: 1rem; }

.models-table {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.table thead th {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-dark));
  color: white;
  border: none;
  padding: 1rem;
  font-weight: 600;
  text-align: center;
}

.table tbody tr {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

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

.table tbody td {
  padding: 1rem;
  text-align: center;
  vertical-align: middle;
  border: none;
}

.model-name {
  font-weight: bold;
  color: var(--brand-primary);
  font-size: 1.1rem;
}

.model-description {
  color: #666;
  font-size: 0.9rem;
  text-align: left;
}

.price-tag {
  background: var(--brand-light);
  color: var(--brand-primary);
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.85rem;
  font-weight: 600;
}

.capability-badge {
  background: var(--brand-light-more);
  color: var(--brand-primary);
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  font-size: 0.8rem;
  margin: 0.2rem;
  display: inline-block;
}

.performance-bar {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.3rem;
}

.performance-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-dark));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.performance-label {
  font-size: 0.8rem;
  color: #666;
}

.try-btn {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-dark));
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.85rem;
}

.try-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.api-docs {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-top: 3rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.code-block {
  background: #1a1a1a;
  color: #00ff88;
  padding: 1.5rem;
  border-radius: 10px;
  margin: 1rem 0;
  overflow-x: auto;
  font-family: var(--font-code);
  border-left: 4px solid var(--brand-primary);
}

.news-updates-container {
  background: var(--brand-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border-left: 1px solid var(--brand-primary);
}

.news-updates-container h2 {
  color: var(--brand-primary);
  margin-bottom: 1rem;
}

.news-entry {
  margin-bottom: 1.5rem;
}

.news-entry p {
  color: #333;
  line-height: 1.7;
  font-size: 1.1rem;
  margin: 0.5rem 0;
}

.featured-entry {
  background: linear-gradient(135deg, var(--brand-light) 0%, rgba(255,255,255,0.3) 100%);
  padding: 1.5rem;
  border-radius: 12px;
  border-left: 1px solid var(--brand-primary);
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.featured-entry p {
  font-weight: 500;
  font-size: 1.15rem;
}

.toggle-news-btn {
  background: var(--brand-primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: bold;
  margin-top: 1.5rem;
  transition: all 0.3s ease;
}

.toggle-news-btn:hover {
  background: var(--brand-dark);
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Centralized inline styles to reduce duplication */
.section-heading {
  color: var(--brand-primary);
  margin-bottom: 1rem;
}

.section-description {
  color: #666;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.news-container {
  background: var(--brand-light);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 16px var(--brand-light-more);
  border-left: 5px solid var(--brand-primary);
}

.news-header {
  color: var(--brand-primary);
  margin-bottom: 1rem;
}

.news-timestamp {
  color: #999;
  font-size: 0.9rem;
  margin-top: 1rem;
}

.info-box {
  margin-top: 2rem;
  padding: 1rem;
  background: var(--brand-light);
  border-radius: 10px;
  border-left: 4px solid var(--brand-primary);
}

.info-box strong {
  color: var(--brand-primary);
}

.info-box span {
  color: #666;
}

.api-section-heading {
  color: var(--brand-primary);
  margin: 1.5rem 0 1rem 0;
}

.source-link {
  color: var(--brand-primary);
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-block;
  margin-right: 1rem;
  margin-top: 0.5rem;
}

.source-link:hover {
  text-decoration: underline;
}

/* Code styling for API endpoints */
code {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-code);
  font-size: 0.9rem;
}

ul.section-description li {
  margin-bottom: 0.8rem;
}

ul.section-description code {
  color: var(--brand-primary);
  background: var(--brand-light);
  font-weight: 500;
}

@media (max-width: 768px) {
  .header h1 { font-size: 2rem; }
  .section-title { font-size: 1.5rem; }
  .main-container { padding: 2rem 1rem; }
  .models-table { font-size: 0.85rem; }
  .back-btn { width: 50px; height: 50px; font-size: 0.8rem; bottom: 1rem; left: 1rem; }
}

@media (max-width: 480px) {
  .header h1 { font-size: 1.5rem; }
  .overview-grid { grid-template-columns: 1fr; }
  .section-title { font-size: 1.2rem; }
  .back-btn { width: 45px; height: 45px; font-size: 1rem; }
}
