/**
 * Chart Sharing Modal Styles
 * Styles for the chart sharing modal with preview functionality
 */

/* Modal Overlay and Container */
.chart-share-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.chart-share-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
}

.chart-share-modal-content {
  position: relative;
  background: #1e1e1e;
  color: #ffffff;
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease-out;
  border: 1px solid #333;
  margin: auto;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Modal Header */
.chart-share-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #333;
}

.chart-share-modal-header h2 {
  margin: 0;
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
}

.chart-share-modal-close {
  background: #333;
  border: none;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: #ccc;
  transition: all 0.2s ease;
}

.chart-share-modal-close:hover {
  background: #444;
  color: #fff;
}

/* Modal Body */
.chart-share-modal-body {
  padding: 20px 24px;
}

/* Chart Preview Section */
.chart-preview-section {
  margin-bottom: 24px;
}

.chart-preview-container {
  position: relative;
  background: #2a2a2a;
  border: 2px solid #444;
  border-radius: 12px;
  padding: 16px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-preview-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #ccc;
}

.chart-preview-loading .loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #444;
  border-top: 3px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.chart-preview-image {
  max-width: 100%;
  max-height: 250px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.chart-type-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #3b82f6;
  color: white;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

/* Sentiment Analysis Section */
.sentiment-analysis-section {
  margin-bottom: 24px;
}

.sentiment-analysis-section h3 {
  margin: 0 0 16px 0;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
}

.modal-sentiment-content {
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 16px;
}

.sentiment-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ccc;
}

.sentiment-loading .small-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #444;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.modal-sentiment-badges {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.modal-sentiment-badge,
.modal-performance-badge {
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.modal-performance-badge {
  background: #333;
  border: 1px solid #555;
  color: #fff;
}

.modal-analysis-summary p {
  margin: 0;
  color: #ccc;
  line-height: 1.5;
  font-size: 14px;
}

/* Modal Footer */
.chart-share-modal-footer {
  padding: 20px 24px;
  border-top: 1px solid #333;
  background: #2a2a2a;
  border-radius: 0 0 16px 16px;
}

/* Share Message Preview */
.share-message-preview {
  margin-bottom: 20px;
  background: #333;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 16px;
}

.message-preview-header {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}

.message-preview-content {
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.4;
  color: #fff;
  margin-bottom: 8px;
  min-height: 60px;
}

.character-count {
  font-size: 12px;
  color: #999;
  text-align: right;
}

/* Share Actions */
.share-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.share-btn {
  flex: 1;
  min-width: 140px;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.twitter-share {
  background: linear-gradient(135deg, #1da1f2, #0d8bd9);
  color: white;
}

.twitter-share:hover {
  background: linear-gradient(135deg, #0d8bd9, #0a7bc4);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(29, 161, 242, 0.3);
}

.linkedin-share {
  background: linear-gradient(135deg, #0077b5, #005582);
  color: white;
}

.linkedin-share:hover {
  background: linear-gradient(135deg, #005582, #004466);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 119, 181, 0.3);
}

.copy-link {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.copy-link:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Error Messages */
.error-message {
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .chart-share-modal-content {
    width: 95%;
    margin: 20px;
    max-height: calc(100vh - 40px);
  }
  
  .chart-share-modal-header,
  .chart-share-modal-body,
  .chart-share-modal-footer {
    padding: 16px;
  }
  
  .chart-share-modal-header h2 {
    font-size: 18px;
  }
  
  .chart-preview-image {
    max-height: 180px;
  }
  
  .share-actions {
    flex-direction: column;
  }
  
  .share-btn {
    min-width: 100%;
  }
  
  .modal-sentiment-badges {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .chart-share-modal-content {
    width: 98%;
    margin: 10px;
    max-height: calc(100vh - 20px);
  }
  
  .chart-preview-container {
    min-height: 150px;
    padding: 12px;
  }
  
  .chart-preview-image {
    max-height: 120px;
  }
  
  .modal-sentiment-badges {
    flex-direction: column;
    align-items: center;
  }
}

/* Animation for spinner */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
