/* AI Summary Plugin Styles */

/* CSS Custom Properties for Animated Border */
@property --border-angle-1 {
  syntax: "<angle>";
  inherits: true;
  initial-value: 0deg;
}

@property --border-angle-2 {
  syntax: "<angle>";
  inherits: true;
  initial-value: 90deg;
}

@property --border-angle-3 {
  syntax: "<angle>";
  inherits: true;
  initial-value: 180deg;
}

/* Keyframes for Animated Border */
@keyframes rotateBackground {
  to { --border-angle-1: 360deg; }
}

@keyframes rotateBackground2 {
  to { --border-angle-2: -270deg; }
}

@keyframes rotateBackground3 {
  to { --border-angle-3: 540deg; }
}

/* Main Container */
.ai-summary-container {
  background-color: #f9fafb;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 32px;
  border: 1px solid #e5e7eb;
}

/* Header */
.ai-summary-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.ai-summary-title {
  font-size: 18px;
  font-weight: 300;
  color: #1f2937;
  margin: 0;
}

/* Buttons Container */
.ai-summary-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Base Button Styles */
.ai-button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  background: none;
}

/* Secondary Button (Normal buttons) */
.ai-button-secondary {
  background-color: white;
  border: 1px solid #d1d5db;
  color: #1f2937;
}

.ai-button-secondary:hover {
  background-color: #f9fafb;
  transform: translateY(-1px);
}

/* Primary Button (Gemini with animated border) */
.ai-button-primary.animated-gradient-border {
  --border-angle-1: 0deg;
  --border-angle-2: 90deg;
  --border-angle-3: 180deg;
  --gemini-blue: #5F7EFF;
  --gemini-purple: #9D63FF;
  --gemini-pink: #FF7BBA;
  --gemini-pink-red: #FF5B7E;
  --border-size: 1px;
  --border-radius: 8px;

  border: 0;
  padding: var(--border-size);
  border-radius: var(--border-radius);
  background-color: transparent;
  background-image: conic-gradient(
        from var(--border-angle-1) at 10% 15%,
        transparent,
        var(--gemini-blue) 10%,
        var(--gemini-purple) 20%,
        transparent 30%,
        transparent
      ),
      conic-gradient(
        from var(--border-angle-2) at 70% 60%,
        transparent,
        var(--gemini-pink) 10%,
        transparent 60%,
        transparent
      ),
      conic-gradient(
        from var(--border-angle-3) at 50% 20%,
        transparent,
        var(--gemini-pink-red) 10%,
        transparent 50%,
        transparent
      );
  animation:
    rotateBackground 3s linear infinite,
    rotateBackground2 8s linear infinite,
    rotateBackground3 13s linear infinite;
}

.animated-gradient-border .button-content {
  background: white;
  padding: 12px 16px;
  border-radius: calc(var(--border-radius) - var(--border-size));
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background-color 0.2s;
  color: #1f2937;
  font-weight: 500;
}

.animated-gradient-border:hover .button-content {
  background: #f3f4f6;
}

/* Icon Styles */
.ai-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-icon img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* Modal Styles */
.ai-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-modal-content {
  background: white;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.ai-modal-header {
  padding: 20px 20px 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 20px;
}

.ai-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

.ai-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-modal-close:hover {
  color: #1f2937;
}

.ai-modal-body {
  padding: 0 20px 20px 20px;
}

.ai-modal-body p {
  color: #6b7280;
  margin-bottom: 16px;
  line-height: 1.5;
}

.copy-status {
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.copy-status.success {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.copy-status.error {
  background-color: #fffbeb;
  border: 1px solid #fed7aa;
  color: #92400e;
}

.prompt-text {
  background-color: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 12px;
  font-size: 12px;
  font-family: monospace;
  word-break: break-all;
  max-height: 120px;
  overflow-y: auto;
}

.ai-modal-footer {
  padding: 20px;
  display: flex;
  justify-content: center;
  gap: 12px;
  border-top: 1px solid #e5e7eb;
}

/* Button Styles for Modal */
.ai-btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.ai-btn-primary {
  background-color: #1f2937;
  color: white;
}

.ai-btn-primary:hover {
  background-color: #111827;
}

.ai-btn-secondary {
  background-color: white;
  color: #1f2937;
  border: 1px solid #d1d5db;
}

.ai-btn-secondary:hover {
  background-color: #f9fafb;
}

.ai-btn img {
  width: 16px;
  height: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .ai-summary-container {
    padding: 16px;
    margin-bottom: 24px;
  }
  
  .ai-summary-title {
    font-size: 16px;
  }
  
  .ai-summary-buttons {
    gap: 8px;
  }
  
  .ai-button {
    padding: 10px 12px;
    font-size: 13px;
  }
  
  .animated-gradient-border .button-content {
    padding: 10px 12px;
  }
  
  .ai-modal-content {
    margin: 20px;
    width: calc(100% - 40px);
  }
}

/* High DPI Display Support */
@supports (color: color(display-p3 1 1 1)) {
  .animated-gradient-border {
    --gemini-blue: color(display-p3 0.37 0.49 1);
    --gemini-purple: color(display-p3 0.62 0.39 1);
    --gemini-pink: color(display-p3 1 0.48 0.73);
    --gemini-pink-red: color(display-p3 1 0.36 0.49);
  }
}