/* Intelligence Dashboard - AiPRL Assist Branded Design */
:root {
  /* AiPRL Brand Colors - Consistent with main styles */
  --primary: #0a0a0a;
  --secondary: #1A1A1A;
  --accent: #4A90E2;
  --accent-light: #87CEEB;
  --text: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #ef4444;
  --card-bg: rgba(74, 144, 226, 0.08);
  --card-border: rgba(74, 144, 226, 0.15);
  --shadow: 0 4px 6px rgba(74, 144, 226, 0.1);
  --radius: 16px;
}

.intelligence-dashboard {
  background: var(--primary);
  min-height: 100vh;
  padding: 2rem;
  color: var(--text);
}

.dashboard-header {
  margin-bottom: 2rem;
  text-align: center;
}

.company-logo {
  max-width: 200px;
  height: auto;
  margin-bottom: 1rem;
}

.dashboard-title {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.dashboard-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* Bento Grid Layout */
.intelligence-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Intelligence Card Base Styles */
.intel-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

.intel-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.intel-card.expanded {
  grid-column: span 3;
  min-height: 500px;
}

/* Card Header */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rescrape-btn {
  background: rgba(52, 152, 219, 0.2);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.rescrape-btn:hover {
  background: var(--accent);
  color: var(--primary);
  transform: rotate(180deg);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-icon {
  font-size: 1.5rem;
}

.card-status {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: capitalize;
}

.status-completed { 
  background: rgba(46, 204, 113, 0.2); 
  color: #2ecc71; 
}

.status-loading { 
  background: rgba(241, 196, 15, 0.2); 
  color: #f1c40f; 
  animation: pulse 2s infinite;
}

.status-error { 
  background: rgba(231, 76, 60, 0.2); 
  color: #e74c3c; 
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Card Footer */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--card-border);
  gap: 0.75rem;
}

.expand-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  flex: 1;
}

.expand-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--accent);
}

/* Updated Raw Data Toggle */
.raw-data-toggle {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  flex: 1;
}

.raw-data-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--accent);
}

/* Card Content Cursor */
.card-content {
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 8px;
  padding: 0.5rem;
  margin: -0.5rem;
  flex: 1;
}

.card-content:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Data Visualization */
.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.data-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
}

.data-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.data-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Raw Data View */
.raw-data-view {
  display: none;
  background: var(--secondary);
  padding: 1rem;
  border-radius: 12px;
  margin-top: 1rem;
  overflow: auto;
  max-height: 400px;
}

.raw-data-view.visible {
  display: block;
}

.raw-data-view pre {
  margin: 0;
  font-family: 'Fira Code', monospace;
  font-size: 0.875rem;
  color: var(--text);
}

/* Modal View - FIXED VERSION */
.intel-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(5px);
  padding: 20px;
  box-sizing: border-box;
}

.intel-modal.visible,
.intel-modal.active {
  display: flex !important;
}

.modal-content {
  background: var(--primary);
  border-radius: var(--radius);
  width: 90vw;
  max-width: 1200px;
  height: 85vh;
  max-height: 800px;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--card-border);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text);
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.modal-header {
  padding: 2rem 2rem 1rem 2rem;
  border-bottom: 1px solid var(--card-border);
  flex-shrink: 0;
}

.modal-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 700;
}

.modal-body {
  padding: 2rem;
  flex: 1;
  overflow-y: auto;
}

/* Expanded Card Styles */
.classification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--accent);
}

.classification-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 700;
}

.confidence-badge,
.targets-badge {
  background: var(--accent);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
}

.content-section {
  margin-bottom: 2rem;
}

.content-section h3 {
  color: var(--text);
  font-size: 1.25rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.content-section p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Lists */
.strength-list,
.advantage-list,
.opportunity-list,
.threat-list,
.action-list,
.highlight-list,
.concern-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.strength-list li,
.advantage-list li,
.opportunity-list li,
.threat-list li,
.action-list li,
.highlight-list li,
.concern-list li {
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
  color: var(--text-secondary);
  line-height: 1.5;
}

.threat-list li {
  border-left-color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
}

.opportunity-list li {
  border-left-color: #51cf66;
  background: rgba(81, 207, 102, 0.1);
}

.advantage-list li {
  border-left-color: #ffd43b;
  background: rgba(255, 212, 59, 0.1);
}

.highlight-list li {
  border-left-color: #51cf66;
  background: rgba(81, 207, 102, 0.1);
}

.concern-list li {
  border-left-color: #ff922b;
  background: rgba(255, 146, 43, 0.1);
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}

.product-tag {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
}

/* Competitors Grid */
.competitors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.competitor-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--card-border);
  transition: all 0.3s ease;
}

.competitor-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.competitor-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.competitor-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 600;
}

.priority-badge {
  background: var(--accent);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.priority-badge.high {
  background: #ff6b6b;
}

.priority-badge.medium {
  background: #ffd43b;
  color: #333;
}

.priority-badge.low {
  background: #51cf66;
}

.competitor-url {
  color: var(--accent);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  word-break: break-all;
}

.competitor-description {
  color: var(--text-secondary);
  line-height: 1.5;
  font-size: 0.9rem;
}

/* Platforms Grid */
.platforms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.platform-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--card-border);
  transition: all 0.3s ease;
}

.platform-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.platform-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.platform-name {
  margin: 0;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 600;
}

.platform-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.platform-rating .stars {
  font-size: 0.875rem;
}

.platform-rating .rating-value {
  color: var(--text-secondary);
  font-weight: 600;
}

.platform-details {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.platform-details p {
  margin: 0.5rem 0;
}

/* Locations Grid */
.locations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.location-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--card-border);
  transition: all 0.3s ease;
}

.location-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.location-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.location-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 600;
  flex: 1;
}

.location-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.location-rating .stars {
  font-size: 0.875rem;
}

.location-rating .rating-value {
  color: var(--text-secondary);
  font-weight: 600;
}

.location-details {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.location-details p {
  margin: 0.5rem 0;
}

.location-address {
  color: var(--text);
  font-weight: 500;
}

/* Presence Metrics */
.presence-metrics,
.sentiment-overview {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
}

.metric,
.sentiment-metric {
  text-align: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
}

.metric-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.metric-label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .intelligence-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .intel-card.expanded {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .intelligence-grid {
    grid-template-columns: 1fr;
  }
  
  .intel-card.expanded {
    grid-column: span 1;
  }
  
  .dashboard-title {
    font-size: 2rem;
  }
  
  .dashboard-subtitle {
    font-size: 1rem;
  }
  
  .intel-card {
    padding: 1rem;
  }

  .modal-content {
    width: 95vw;
    height: 90vh;
    margin: 2.5vh auto;
  }
  
  .modal-header,
  .modal-body {
    padding: 1rem;
  }
  
  .competitors-grid,
  .platforms-grid,
  .locations-grid {
    grid-template-columns: 1fr;
  }
  
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .presence-metrics,
  .sentiment-overview {
    flex-direction: column;
    gap: 1rem;
  }
  
  .classification-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* Animations */
@keyframes cardExpand {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.intel-card {
  animation: cardExpand 0.3s ease forwards;
}

/* Loading States */
.loading-skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.1) 25%,
    rgba(255, 255, 255, 0.15) 37%,
    rgba(255, 255, 255, 0.1) 63%
  );
  background-size: 400% 100%;
  animation: skeletonLoading 1.4s ease infinite;
}

@keyframes skeletonLoading {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

/* Expanded Card Styles */
.expanded-overview,
.expanded-market-position,
.expanded-competitor-analysis,
.expanded-local-presence,
.expanded-sentiment-analysis,
.expanded-brand-analysis {
    padding: 2rem;
    color: var(--text);
}

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

.classification-header h2 {
    font-size: 2rem;
    margin: 0;
    background: linear-gradient(135deg, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.confidence-badge,
.targets-badge,
.digital-score {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
    font-weight: 500;
}

.content-section {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.analysis-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.analysis-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.analysis-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.analysis-section li {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
}

.analysis-section li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* Competitor Cards */
.competitors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.competitor-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--card-border);
}

.competitor-card.priority-high { border-color: var(--danger); }
.competitor-card.priority-medium { border-color: var(--warning); }
.competitor-card.priority-low { border-color: var(--success); }

.competitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.target-id {
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.priority-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.priority-high .priority-badge { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }
.priority-medium .priority-badge { background: rgba(241, 196, 15, 0.2); color: #f1c40f; }
.priority-low .priority-badge { background: rgba(46, 204, 113, 0.2); color: #2ecc71; }

/* Local Presence */
.presence-metrics {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.location-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.location-details {
    margin-top: 1rem;
}

.rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.contact p {
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Reviews & Sentiment */
.sentiment-metrics {
    display: flex;
    justify-content: space-around;
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
}

.reviews-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: flex-start;
}

.review-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    flex: 0 1 calc(33.333% - 10px); 
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    max-height: 250px; 
    overflow: hidden; 
}

.review-card.positive { border: 1px solid var(--success); }
.review-card.negative { border: 1px solid var(--danger); }
.review-card.neutral { border: 1px solid var(--text-secondary); }

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.sentiment-badge {
    padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
    font-weight: 500;
  text-transform: capitalize;
}

.sentiment-badge.positive { background: rgba(46, 204, 113, 0.2); color: #2ecc71; }
.sentiment-badge.negative { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }
.sentiment-badge.neutral { background: rgba(255, 255, 255, 0.1); color: var(--text); }

.review-content blockquote {
  margin: 0;
    font-style: italic;
  color: #ffffff !important;
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3; 
  -webkit-box-orient: vertical;
}

.review-source {
    margin-top: auto;
    padding-top: 0.5rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9) !important;
    align-self: flex-start;
}

.review-source a {
    color: var(--accent);
    text-decoration: none;
    pointer-events: auto; /* Ensure links are clickable */
}

.review-source a:hover {
    text-decoration: underline;
}

/* Brand Analysis */
.brand-summary {
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
}

/* Responsive Adjustments for Expanded Views */
@media (max-width: 1200px) {
    .analysis-grid {
        grid-template-columns: 1fr;
    }
    
    .presence-metrics {
        flex-direction: column;
        gap: 1rem;
    }
    
    .sentiment-metrics {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .classification-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .competitors-grid,
    .locations-grid,
    .reviews-grid {
        grid-template-columns: 1fr;
    }
}

/* Error state styling */
.intel-card.error {
  border-color: var(--danger);
}

.intel-card.loading {
  border-color: var(--warning);
}

.intel-card.completed {
  border-color: var(--success);
}

/* Data Status Indicator */
.data-status {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.75rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

/* Reviews Modal Fixes */
.expanded-sentiment-analysis {
  padding: 1.5rem;
  color: var(--text);
  max-height: 80vh;
  overflow-y: auto;
}

.sentiment-header {
  margin-bottom: 2rem;
  text-align: center;
}

.sentiment-header h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sentiment-metrics {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.sentiment-metrics .metric {
  text-align: center;
  padding: 1rem;
  border-radius: 12px;
  min-width: 120px;
}

.sentiment-metrics .metric.positive {
  background: rgba(40, 167, 69, 0.2);
  border: 1px solid rgba(40, 167, 69, 0.4);
}

.sentiment-metrics .metric.negative {
  background: rgba(220, 53, 69, 0.2);
  border: 1px solid rgba(220, 53, 69, 0.4);
}

.sentiment-metrics .metric.neutral {
  background: rgba(108, 117, 125, 0.2);
  border: 1px solid rgba(108, 117, 125, 0.4);
}

.reviews-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.review-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1rem;
}

.review-item.positive {
  border-left: 4px solid #28a745;
  background: rgba(40, 167, 69, 0.05);
}

.review-item.negative {
  border-left: 4px solid #dc3545;
  background: rgba(220, 53, 69, 0.05);
}

.review-item.neutral {
  border-left: 4px solid #6c757d;
  background: rgba(108, 117, 125, 0.05);
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.review-id {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8) !important;
  font-weight: 500;
}

.sentiment-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.sentiment-badge.positive {
  background: rgba(40, 167, 69, 0.2);
  color: #28a745;
}

.sentiment-badge.negative {
  background: rgba(220, 53, 69, 0.2);
  color: #dc3545;
}

.sentiment-badge.neutral {
  background: rgba(108, 117, 125, 0.2);
  color: #6c757d;
}

.review-content {
  margin-top: 1rem;
}

.review-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #ffffff !important;
}

.review-text {
  margin: 0;
  padding: 1rem;
  border-radius: 8px;
  font-style: italic;
  line-height: 1.6;
  background: rgba(0, 0, 0, 0.2);
  border-left: 3px solid;
  color: #ffffff !important;
}

.review-text.positive {
  border-left-color: #28a745;
  background: rgba(40, 167, 69, 0.15);
  color: #ffffff !important;
}

.review-text.negative {
  border-left-color: #dc3545;
  background: rgba(220, 53, 69, 0.15);
  color: #ffffff !important;
}

.review-text.neutral {
  border-left-color: #6c757d;
  background: rgba(108, 117, 125, 0.15);
  color: #ffffff !important;
}

.review-rating {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rating-value {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9) !important;
}

/* Modal Enhancements */


/* Scrollbar Styling */
.reviews-container::-webkit-scrollbar {
  width: 6px;
}

.reviews-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.reviews-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.reviews-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
} 

/* Company Overview Styles */
.company-overview {
  color: var(--text-secondary);
  line-height: 1.6;
}

.overview-summary {
  margin-bottom: 1rem;
}

.overview-summary p {
  margin: 0.5rem 0;
  color: var(--text-secondary);
}

.overview-summary strong {
  color: var(--text);
  font-weight: 600;
}

.products-preview {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem;
  border-radius: var(--radius);
  margin-top: 1rem;
  border-left: 3px solid var(--accent);
  font-size: 0.9rem;
}

.products-preview strong {
  color: var(--text);
  font-weight: 600;
}

/* Enhanced modal content styles */
.insight-list, .recommendation-list, .action-list {
    list-style: none;
    padding-left: 0;
}

.insight-list li, .recommendation-list li, .action-list li {
    padding: 8px 12px;
    margin-bottom: 8px;
    background: rgba(74, 144, 226, 0.05);
    border-radius: 4px;
    border-left: 3px solid var(--accent);
}

/* Brand analysis specific styles */
.expanded-brand-analysis .analysis-section {
    margin-bottom: 20px;
}

.expanded-brand-analysis .analysis-section h3 {
    color: var(--accent);
    font-size: 1.1em;
    margin-bottom: 10px;
}

.expanded-brand-analysis .analysis-section p {
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Competitor analysis specific styles */
.expanded-competitor-analysis .insights {
    background: rgba(74, 144, 226, 0.1);
    border-left-color: var(--accent);
}

.expanded-competitor-analysis .threats {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: var(--danger);
}

.expanded-competitor-analysis .opportunities {
    background: rgba(52, 211, 153, 0.1);
    border-left-color: var(--success);
} 

/* Tooltip styles for intelligence justification */
.intelligence-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.intelligence-tooltip .tooltip-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #4A90E2;
    border-radius: 50%;
    color: white;
    text-align: center;
    line-height: 16px;
    font-size: 12px;
    margin-left: 8px;
}

.intelligence-tooltip .tooltip-text {
    visibility: hidden;
    width: 280px;
    background-color: #2c3e50;
    color: #fff;
    text-align: left;
    border-radius: 8px;
    padding: 12px;
    position: fixed;
    z-index: 99999;
    bottom: auto;
    top: 20px;
    left: 50%;
    margin-left: -140px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    border: 1px solid #4A90E2;
}

.intelligence-tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #2c3e50 transparent transparent transparent;
}

.intelligence-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Enriched Card Styles */
.company-overview.enriched {
    padding: 1.5rem;
}

.company-header {
    margin-bottom: 1rem;
}

.company-badge {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.founded-badge, .ownership-badge {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.ownership-badge {
    background: linear-gradient(135deg, var(--success) 0%, #2dd4bf 100%);
}

.company-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.company-metrics .metric {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
}

.company-metrics .metric.highlight {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: white;
}

.company-metrics .metric.success {
    background: linear-gradient(135deg, var(--success) 0%, #2dd4bf 100%);
    color: white;
}

.mission-preview {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

.mission-preview h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: var(--accent-light);
}

.mission-preview p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

/* Local Presence Enriched Styles */
.local-metrics.enriched {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.local-metrics.enriched .metric {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
}

.location-breakdown {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.location-type {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 6px;
    text-align: center;
}

.type-count {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-light);
}

.type-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.hours-preview {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem;
    border-radius: 8px;
    border-left: 3px solid var(--success);
}

.hours-preview h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: var(--success);
}

.hours-preview p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

 