/* CSS Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Language Selector - Compact Corner Button */
.language-selector {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1001;
}

.lang-toggle {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #1f2937;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  min-width: 80px;
}

.lang-toggle:hover {
  background: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  min-width: 140px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.lang-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  background: transparent;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #1f2937;
  cursor: pointer;
  transition: all 0.3s ease;
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 0.25rem;
}

.lang-option:last-child {
  margin-bottom: 0;
}

.lang-option.active {
  background: linear-gradient(135deg, #059669, #047857);
  color: white;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.lang-option:hover:not(.active) {
  background: #f8fafc;
  color: #059669;
}

.lang-button {
  background: transparent;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.lang-button.active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.lang-button:hover:not(.active) {
  background: #f3f4f6;
  color: #374151;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: #ffffff;
  color: #1f2937;
  line-height: 1.6;
  min-height: 100vh;
}

/* Header Styles */
.header {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: white;
  padding: 1.5rem 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: none;
  pointer-events: none;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
  position: relative;
}

.title-section {
  flex: 1;
  min-width: 300px;
}

.main-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.title-icon {
  color: #34d399;
  font-size: 1.2em;
  animation: pulse 2s infinite;
}

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

.subtitle-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.info-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.info-badge:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.info-badge i {
  font-size: 0.875rem;
  opacity: 0.9;
}

/* ESG Score Section */
.esg-score-section {
  flex-shrink: 0;
  min-width: 200px;
}

.esg-score-container {
  background: rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.esg-score-label {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.esg-score-value {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: #ffffff;
}

.score-divider {
  opacity: 0.6;
  font-weight: 400;
}

.score-indicator {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.score-progress {
  height: 100%;
  background: linear-gradient(90deg, #34d399, #10b981);
  border-radius: 3px;
  transition: width 1s ease-out;
  position: relative;
}

.score-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Dashboard Grid */
.dashboard {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  align-items: start;
}

/* Card Styles */
.card {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #f1f5f9;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #059669, #10b981);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.card:hover::before {
  transform: scaleX(1);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.15);
  border-color: #d1fae5;
}

.card-featured {
  grid-column: 1 / -1;
  background: #ffffff;
}

.card-clickable {
  cursor: pointer;
}

.card-clickable:hover {
  background: #f9fafb;
}

.card-info {
  background: linear-gradient(145deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #bbf7d0;
}

.card-info::before {
  background: linear-gradient(90deg, #059669, #10b981);
}

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

.card-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
}

.card-header h3 i {
  color: #059669;
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.card-action {
  color: #64748b;
  font-size: 0.875rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-clickable:hover .card-action {
  opacity: 1;
}

/* Chart Container */
.chart-container {
  position: relative;
  height: 200px;
  margin-bottom: 1rem;
}

.card-featured .chart-container {
  height: 300px;
}

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

/* Card Footer */
.card-footer {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.metric-value {
  font-weight: 600;
  color: #1e293b;
}

.details-link {
  color: #059669;
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.details-link:hover {
  color: #047857;
  transform: translateX(2px);
}

.details-link i {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.details-link:hover i {
  transform: translateX(2px);
}

/* Info List Styles */
.info-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 0.5rem;
  border-left: 3px solid #059669;
}

.info-label {
  font-weight: 600;
  color: #1e293b;
  flex-shrink: 0;
  min-width: 120px;
}

.info-value {
  color: #64748b;
  text-align: right;
  flex: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }

  .title-section {
    min-width: unset;
  }

  .main-title {
    font-size: 1.75rem;
    justify-content: center;
  }

  .subtitle-info {
    justify-content: center;
  }

  .esg-score-section {
    min-width: unset;
    width: 100%;
    max-width: 300px;
  }

  .dashboard {
    padding: 2rem 1rem;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .card {
    padding: 1.25rem;
  }

  .chart-container {
    height: 180px;
  }

  .card-featured .chart-container {
    height: 250px;
  }

  .info-item {
    flex-direction: column;
    gap: 0.5rem;
  }

  .info-label {
    min-width: unset;
  }

  .info-value {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .info-badge {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
  }

  .card-header h3 {
    font-size: 1rem;
  }

  .chart-container {
    height: 160px;
  }

  .card-featured .chart-container {
    height: 220px;
  }
}

/* Animation for page load */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeInUp 0.6s ease-out forwards;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for better accessibility */
.card-clickable:focus {
  outline: 2px solid #059669;
  outline-offset: 2px;
}

.details-link:focus {
  outline: 2px solid #059669;
  outline-offset: 1px;
  border-radius: 2px;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 2rem;
  animation: fadeIn 0.3s ease-out;
}

.modal-overlay.show {
  display: flex;
}

.modal-container {
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 1rem;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: slideUp 0.3s ease-out;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 2rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: white;
  border-radius: 1rem 1rem 0 0;
}

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.25rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

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

.modal-content {
  padding: 2rem;
}

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

.modal-section:last-child {
  margin-bottom: 0;
}

.modal-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-chart-container {
  height: 300px;
  margin-bottom: 1.5rem;
  position: relative;
}

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

.modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.modal-stat-card {
  background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 1.25rem;
  border-radius: 0.75rem;
  border-left: 4px solid #059669;
  text-align: center;
  transition: transform 0.2s ease;
}

.modal-stat-card:hover {
  transform: translateY(-2px);
}

.modal-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #059669;
  margin-bottom: 0.5rem;
}

.modal-stat-label {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 500;
}

.modal-description {
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.modal-info-list {
  background: #f8fafc;
  border-radius: 0.75rem;
  padding: 1.5rem;
  border: 1px solid #e2e8f0;
}

.modal-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e2e8f0;
}

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

.modal-info-label {
  font-weight: 600;
  color: #1e293b;
}

.modal-info-value {
  color: #059669;
  font-weight: 500;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Responsive Modal */
@media (max-width: 768px) {
  .modal-overlay {
    padding: 1rem;
  }
  
  .modal-header {
    padding: 1.5rem 1.5rem 1rem;
  }
  
  .modal-content {
    padding: 1.5rem;
  }
  
  .modal-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-chart-container {
    height: 250px;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
  }
  
  .header {
    background: #059669;
    color: white;
    box-shadow: none;
  }
  
  .card {
    break-inside: avoid;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
  }
  
  .card:hover {
    transform: none;
  }
  
  .modal-overlay {
    display: none !important;
  }
}

/* Header Right Section */
.header-right {
    margin-left: auto;
    padding: 1rem 2rem;
}

/* User Menu Styles */
.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.user-name {
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    opacity: 0.9;
}

.logout-btn {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    transform: translateY(-1px);
}

.logout-btn i {
    font-size: 0.8rem;
}

/* Advanced Analytics Styles */
.analytics-section {
  background: #ffffff;
  padding: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid #f1f5f9;
  min-height: auto;
}

.analytics-container {
  max-width: 1400px;
  margin: 0 auto;
}

.analytics-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.analytics-tab {
  background: none;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  color: #64748b;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.analytics-tab:hover {
  background: #f0fdf4;
  color: #059669;
}

.analytics-tab.active {
  background: #059669;
  color: white;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

.analytics-content {
  min-height: 0;
}

.analytics-panel {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #f1f5f9;
  margin-bottom: 0;
}

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

.panel-header h3 {
  font-size: 1.5rem;
  color: #1f2937;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.panel-header p {
  color: #64748b;
  font-size: 1rem;
}

/* Heat Map Styles */
.heatmap-container {
  position: relative;
  background: #fafbfc;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
}

.heatmap-legend {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #64748b;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

/* Benchmark Styles */
.benchmark-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.benchmark-card {
  background: #fafbfc;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
}

.benchmark-card h4 {
  color: #1f2937;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.benchmark-chart {
  height: 200px;
  margin-bottom: 1rem;
}

.benchmark-stats {
  display: flex;
  justify-content: space-between;
  text-align: center;
}

.stat {
  flex: 1;
}

.stat span {
  display: block;
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.score-value {
  color: #059669;
  font-size: 1.25rem;
}

.score-avg {
  color: #f59e0b;
  font-size: 1.25rem;
}

.score-top {
  color: #3b82f6;
  font-size: 1.25rem;
}

/* 3D Trends Styles */
.trends-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  align-items: start;
}

.trends-chart {
  background: #f8fafc;
  border-radius: 8px;
  padding: 1rem;
}

.trends-controls {
  background: #f8fafc;
  border-radius: 8px;
  padding: 1.5rem;
}

.control-group {
  margin-bottom: 1.5rem;
}

.control-group label {
  display: block;
  font-weight: 500;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.control-group select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  color: #1f2937;
}

/* Overview Summary Styles */
.overview-summary {
  padding: 1rem;
}

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

.summary-card {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.summary-icon {
  background: #059669;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.summary-content h4 {
  color: #1f2937;
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
}

.summary-value {
  font-size: 1.75rem;
  font-weight: bold;
  color: #059669;
  margin-bottom: 0.25rem;
}

.summary-trend {
  font-size: 0.875rem;
  font-weight: 500;
}

.summary-trend.positive {
  color: #16a34a;
}

.summary-trend.negative {
  color: #dc2626;
}

.overview-message {
  background: #f0f9ff;
  border: 1px solid #0ea5e9;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  margin-top: 0;
}

.overview-message p {
  margin: 0;
  color: #0c4a6e;
  font-size: 0.95rem;
}

/* Analytics Responsive Design */
@media (max-width: 768px) {
  .analytics-tabs {
    justify-content: center;
  }
  
  .analytics-tab {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
  
  .trends-container {
    grid-template-columns: 1fr;
  }
  
  .benchmark-grid {
    grid-template-columns: 1fr;
  }

  .summary-cards {
    grid-template-columns: 1fr;
  }
}

/* Enhanced AI Assistant Styles */
.ai-enhanced-card {
  background: linear-gradient(135deg, #fafbff 0%, #f0f4ff 100%);
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
}

.ai-enhanced-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9, #3b82f6);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  z-index: -1;
}

.ai-enhanced-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.2);
}

.ai-gradient-header {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 50%, #3b82f6 100%);
  color: white;
  border-radius: 12px 12px 0 0;
  padding: 1rem;
}

.ai-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-icon-wrapper {
  width: 45px;
  height: 45px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.ai-robot-icon {
  font-size: 1.4rem;
  color: white;
  animation: aiPulse 2s infinite;
}

@keyframes aiPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.ai-title-text {
  display: flex;
  flex-direction: column;
}

.ai-main-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.ai-subtitle {
  font-size: 0.8rem;
  opacity: 0.9;
  font-weight: 400;
}

.ai-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  backdrop-filter: blur(10px);
}

.ai-pulse-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: aiPulseDot 1.5s infinite;
}

@keyframes aiPulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.ai-enhanced-container {
  padding: 0;
}

.ai-dashboard-preview {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ai-insight-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ai-metric-card {
  background: white;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.ai-metric-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.ai-metric-icon {
  width: 35px;
  height: 35px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.ai-metric-icon.env {
  background: linear-gradient(135deg, #10b981, #059669);
}

.ai-metric-icon.social {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.ai-metric-content {
  flex: 1;
}

.ai-metric-value {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1f2937;
  margin-bottom: 2px;
}

.ai-metric-trend {
  font-size: 0.75rem;
  font-weight: 500;
}

.ai-metric-trend.positive {
  color: #059669;
}

.ai-recommendations-preview {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #e5e7eb;
}

.ai-rec-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6d28d9;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.ai-rec-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: white;
  border-radius: 8px;
  margin-bottom: 8px;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.ai-rec-item.priority-high {
  border-left-color: #dc2626;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.1);
}

.ai-rec-item.priority-medium {
  border-left-color: #d97706;
  box-shadow: 0 1px 3px rgba(217, 119, 6, 0.1);
}

.ai-rec-icon {
  font-size: 1.1rem;
}

.ai-rec-text {
  flex: 1;
  font-size: 0.85rem;
  color: #374151;
  font-weight: 500;
}

.ai-rec-impact {
  font-size: 0.8rem;
  font-weight: 600;
  color: #059669;
  background: #ecfdf5;
  padding: 4px 8px;
  border-radius: 12px;
}

.ai-predictions-preview {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #bae6fd;
}

.ai-pred-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1e40af;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.ai-prediction-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ai-pred-item {
  background: white;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #bae6fd;
}

.ai-pred-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 4px;
}

.ai-pred-value {
  font-size: 1rem;
  font-weight: 700;
  color: #1f2937;
}

.ai-pred-value.good {
  color: #059669;
}

.ai-footer {
  background: #f8fafc;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #e5e7eb;
}

.ai-footer-stats {
  display: flex;
  gap: 16px;
}

.ai-stat {
  font-size: 0.75rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-cta-button {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.ai-cta-button:hover {
  transform: translateX(2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Real-time Alerts Card */
.alert-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alert-count {
  background: #dc2626;
  color: white;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  animation: alertPulse 2s infinite;
}

@keyframes alertPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.alert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  border-left: 4px solid transparent;
  transition: all 0.2s ease;
}

.alert-item.critical {
  background: #fef2f2;
  border-left-color: #dc2626;
}

.alert-item.warning {
  background: #fef3c7;
  border-left-color: #d97706;
}

.alert-item.info {
  background: #eff6ff;
  border-left-color: #3b82f6;
}

.alert-icon {
  font-size: 1.2rem;
  min-width: 24px;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1f2937;
  margin-bottom: 2px;
}

.alert-desc {
  font-size: 0.8rem;
  color: #6b7280;
}

.alert-time {
  font-size: 0.75rem;
  color: #9ca3af;
  font-weight: 500;
}

/* Performance Tracker Card */
.performance-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.performance-score {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 1rem;
}

.performance-metrics {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.perf-metric {
  display: flex;
  align-items: center;
  gap: 12px;
}

.perf-label {
  min-width: 140px;
  font-size: 0.85rem;
  color: #374151;
  font-weight: 500;
}

.perf-bar {
  flex: 1;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.perf-progress {
  height: 100%;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.perf-value {
  min-width: 40px;
  text-align: right;
  font-weight: 600;
  font-size: 0.85rem;
  color: #059669;
}

/* Quick Actions Card */
.quick-actions {
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.action-btn i {
  font-size: 1.4rem;
}

.action-btn.primary {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: white;
}

.action-btn.secondary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.action-btn.tertiary {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
}

.action-btn.quaternary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

/* Sustainability Goals Card */
.goals-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.goals-overall {
  background: linear-gradient(135deg, #059669, #047857);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 1rem;
}

.goals-list {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.goal-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.goal-info {
  flex: 1;
}

.goal-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1f2937;
  margin-bottom: 4px;
}

.goal-desc {
  font-size: 0.8rem;
  color: #6b7280;
}

.goal-progress {
  min-width: 60px;
}

.goal-ring {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: conic-gradient(#10b981 0deg 240deg, #e5e7eb 240deg 360deg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.goal-ring::before {
  content: '';
  width: 35px;
  height: 35px;
  background: white;
  border-radius: 50%;
  position: absolute;
}

.goal-percentage {
  font-size: 0.75rem;
  font-weight: 700;
  color: #1f2937;
  z-index: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .quick-actions {
    grid-template-columns: 1fr;
  }
  
  .ai-insight-panel {
    grid-template-columns: 1fr;
  }
  
  .performance-metrics {
    padding: 16px;
  }
  
  .perf-label {
    min-width: 100px;
    font-size: 0.8rem;
  }
}

.prediction-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.85rem;
}

.prediction-label {
  color: #6b7280;
}

.prediction-value {
  font-weight: 600;
}

.prediction-value.good {
  color: #10b981;
}

.risk-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.risk-alert.high {
  background: #fef2f2;
  color: #dc2626;
}

.risk-alert.medium {
  background: #fef3c7;
  color: #d97706;
}

/* AI Chat Interface Styles */
.ai-message {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  animation: fadeInUp 0.3s ease;
}

.ai-message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.ai-message.system .message-avatar {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

.ai-message.user .message-avatar {
  background: linear-gradient(135deg, #059669, #047857);
  color: white;
}

.message-content {
  background: white;
  padding: 12px 16px;
  border-radius: 18px;
  max-width: 70%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  font-size: 0.9rem;
  line-height: 1.5;
}

.ai-message.user .message-content {
  background: linear-gradient(135deg, #059669, #047857);
  color: white;
}

.quick-question {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s;
}

.quick-question:hover {
  background: #8b5cf6;
  color: white;
  border-color: #8b5cf6;
}

.insight-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid #f1f5f9;
}

.insight-icon {
  font-size: 1.1rem;
}

.recommendation-item {
  background: #f8fafc;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  border-left: 3px solid #6d28d9;
}

.rec-priority {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6d28d9;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.rec-content {
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 5px;
}

.rec-impact {
  font-size: 0.8rem;
  color: #10b981;
  font-weight: 600;
}

.prediction-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.prediction-box {
  background: #f8fafc;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
}

.pred-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 5px;
}

.pred-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #3b82f6;
  margin-bottom: 3px;
}

.pred-change {
  font-size: 0.8rem;
  color: #10b981;
  font-weight: 600;
}

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