/* API Key Management Panel Styles */

.api-key-management {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

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

.panel-header h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.panel-header .subtitle {
  font-size: 1rem;
  color: #666;
}

/* Benefits Banner */
.benefits-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.benefits-banner h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.benefits-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.benefits-list li {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.benefits-list .icon {
  font-size: 2rem;
}

.benefits-list strong {
  font-size: 1.1rem;
}

.benefits-list span:last-child {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: #f8f9fa;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #333;
}

.empty-state p {
  font-size: 1rem;
  color: #666;
}

/* Credentials List */
.credentials-list {
  margin-bottom: 2rem;
}

.credentials-list h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: #333;
}

/* Credential Card */
.credential-card {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.credential-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.credential-card.active {
  border-color: #4caf50;
}

.credential-card.unverified {
  border-color: #ff9800;
  background: #fff3e0;
}

.credential-card.invalid {
  border-color: #f44336;
  background: #ffebee;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
}

.provider-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.provider-icon {
  font-size: 2.5rem;
}

.provider-details h4 {
  font-size: 1.2rem;
  margin: 0 0 0.25rem 0;
  color: #333;
}

.key-hint {
  font-size: 0.85rem;
  color: #666;
  font-family: 'Courier New', monospace;
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-badge.active {
  background: #4caf50;
  color: white;
}

.status-badge.unverified {
  background: #ff9800;
  color: white;
}

.status-badge.invalid {
  background: #f44336;
  color: white;
}

/* Card Stats */
.card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat .label {
  font-size: 0.75rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat .value {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
}

.error-message {
  background: #ffcdd2;
  color: #c62828;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.info-message {
  background: #fff3e0;
  color: #e65100;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Card Actions */
.card-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

/* Add Button */
.add-button-container {
  text-align: center;
  padding: 2rem 0;
}

.all-configured {
  text-align: center;
  padding: 2rem;
  background: #e8f5e9;
  color: #2e7d32;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
}

/* Add Form Modal */
.add-form-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  /* backdrop-filter removed - already blurred by parent ProfileModal */
}

.add-form {
  position: relative;
  background: white;
  border-radius: 16px;
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e0e0e0;
}

.form-header h3 {
  font-size: 1.5rem;
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.close-btn:hover {
  background: #f0f0f0;
  color: #333;
}

/* Provider Selection */
.provider-selection {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.provider-btn {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.provider-btn:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.provider-btn.selected {
  border-color: #667eea;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.provider-btn .icon {
  font-size: 3rem;
}

.provider-btn .name {
  font-size: 1.2rem;
  font-weight: 600;
}

.provider-btn .model {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Key Input Form */
.key-input-form {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-help {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.form-help p {
  margin: 0 0 0.5rem 0;
  font-weight: 600;
}

.form-help ol {
  margin: 0.5rem 0 0 1.5rem;
  padding: 0;
}

.form-help li {
  margin: 0.25rem 0;
}

.form-help a {
  color: #667eea;
  text-decoration: none;
  word-break: break-all;
}

.form-help a:hover {
  text-decoration: underline;
}

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #333;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'Courier New', monospace;
  transition: border-color 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: #667eea;
}

.form-hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #666;
}

.form-hint.info-hint {
  color: #e65100;
  background: #fff3e0;
  padding: 0.5rem;
  border-radius: 6px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  color: #333;
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #667eea;
}

.checkbox-label:hover {
  color: #667eea;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #e0e0e0;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #e0e0e0;
  color: #333;
}

.btn-secondary:hover {
  background: #d0d0d0;
}

.btn-danger {
  background: #f44336;
  color: white;
}

.btn-danger:hover {
  background: #d32f2f;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
  .api-key-management {
    padding: 1rem;
  }

  .benefits-list {
    grid-template-columns: 1fr;
  }

  .card-stats {
    grid-template-columns: 1fr;
  }

  .provider-selection {
    grid-template-columns: 1fr;
  }

  .add-form {
    padding: 1.5rem;
  }

  .form-actions {
    flex-direction: column;
  }
}
