/**
 * Yaraa AI Sales Agent - Integrations Page Styles.
 *
 * @package Yaraa_AI_Sales_Agent.
 * @since 1.0.0
 */

/* ==========================================================================
Page Layout.
========================================================================== */
.yaraa-integrations-wrap {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 20px;
}

/* ==========================================================================
Notices.
========================================================================== */
.yaraa-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: 8px;
  animation: slideDown 0.3s ease-out;
}

.yaraa-notice-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.yaraa-notice-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.yaraa-notice-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.yaraa-notice .dashicons {
  font-size: 18px;
  width: 18px;
  height: 18px;
}

.yaraa-notice-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.7;
  color: inherit;
}

.yaraa-notice-dismiss:hover {
  opacity: 1;
}

@keyframes slideDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ==========================================================================
Page Header.
========================================================================== */
.yaraa-page-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.yaraa-page-header h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 600;
  color: #1e3a5f;
  margin: 0 0 8px 0;
}

.yaraa-page-header h1 .dashicons {
  font-size: 28px;
  width: 28px;
  height: 28px;
  color: #4285f4;
}

.yaraa-header-description {
  color: #6b7280;
  margin: 0;
  font-size: 14px;
}

/* ==========================================================================
Integrations Grid.
========================================================================== */
.yaraa-integrations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

/* ==========================================================================
Integration Card.
========================================================================== */
.yaraa-integration-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  transition: all 0.3s ease;
  position: relative;
}

.yaraa-integration-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.yaraa-integration-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.yaraa-integration-icon {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.yaraa-integration-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.yaraa-icon-placeholder {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.yaraa-icon-placeholder .dashicons {
  font-size: 32px;
  width: 32px;
  height: 32px;
  color: #9ca3af;
}

.yaraa-integration-title h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 4px 0;
}

.yaraa-integration-category {
  font-size: 13px;
  color: #6b7280;
}

.yaraa-integration-description {
  margin-bottom: 20px;
}

.yaraa-integration-description p {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

/* ==========================================================================
Connection Info.
========================================================================== */
.yaraa-connection-info {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.yaraa-connection-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.yaraa-connection-row:not(:last-child) {
  border-bottom: 1px solid #e5e7eb;
}

.yaraa-connection-label {
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
}

.yaraa-connection-value {
  font-size: 13px;
  color: #374151;
}

.yaraa-location-id {
  font-family: monospace;
  background: #e5e7eb;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

/* Status Badges. */
.yaraa-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.yaraa-status-connected {
  background: #d1fae5;
  color: #065f46;
}

.yaraa-status-connected .dashicons {
  font-size: 14px;
  width: 14px;
  height: 14px;
}

.yaraa-status-disconnected {
  background: #fee2e2;
  color: #991b1b;
}

/* Security Info. */
.yaraa-security-info {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.yaraa-security-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1e40af;
  font-size: 13px;
}

.yaraa-security-badge .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

/* ==========================================================================
Integration Actions.
========================================================================== */
.yaraa-integration-actions {
  margin-bottom: 20px;
}

/* ==========================================================================
Buttons.
========================================================================== */
.yaraa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}

.yaraa-btn-block {
  width: 100%;
}

.yaraa-btn .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

.yaraa-btn-primary {
  background: #4285f4;
  color: #ffffff;
}

.yaraa-btn-primary:hover {
  background: #3367d6;
  transform: translateY(-1px);
}

.yaraa-btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.yaraa-btn-secondary:hover {
  background: #e5e7eb;
}

.yaraa-btn-danger {
  background: #dc3545;
  color: #ffffff;
}

.yaraa-btn-danger:hover {
  background: #c82333;
}

.yaraa-btn-outline-danger {
  background: #ffffff;
  color: #dc3545;
  border: 2px solid #dc3545;
}

.yaraa-btn-outline-danger:hover {
  background: #dc3545;
  color: #ffffff;
}

.yaraa-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.yaraa-btn-loading {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Spinner. */
.yaraa-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
Features List.
========================================================================== */
.yaraa-integration-features {
  border-top: 1px solid #e5e7eb;
  padding-top: 16px;
}

.yaraa-integration-features h4 {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.yaraa-integration-features ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.yaraa-integration-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 8px;
}

.yaraa-integration-features li .dashicons {
  color: #10b981;
  font-size: 14px;
  width: 14px;
  height: 14px;
  margin-top: 2px;
}

/* ==========================================================================
Coming Soon Card.
========================================================================== */
.yaraa-integration-coming-soon {
  background: #f9fafb;
  border-style: dashed;
}

.yaraa-integration-coming-soon:hover {
  transform: none;
  box-shadow: none;
}

.yaraa-coming-soon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

.yaraa-coming-soon-badge .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

/* ==========================================================================
Modal.
========================================================================== */
.yaraa-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.yaraa-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.2s ease;
}

.yaraa-modal-content {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: auto;
  animation: slideUp 0.3s ease;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.yaraa-modal-sm {
  max-width: 400px;
}

.yaraa-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.yaraa-modal-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.yaraa-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.yaraa-modal-close:hover {
  color: #6b7280;
}

.yaraa-modal-body {
  padding: 24px;
}

.yaraa-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 0 0 12px 12px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Warning Icon. */
.yaraa-warning-icon {
  text-align: center;
  margin-bottom: 16px;
}

.yaraa-warning-icon .dashicons {
  font-size: 48px;
  width: 48px;
  height: 48px;
  color: #f59e0b;
}

.yaraa-modal-body > p {
  text-align: center;
  color: #6b7280;
  margin: 0;
}

/* ==========================================================================
Form Styles.
========================================================================== */
.yaraa-form-group {
  margin-bottom: 20px;
}

.yaraa-form-group:last-child {
  margin-bottom: 0;
}

.yaraa-form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

.yaraa-form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  color: #1f2937;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.yaraa-form-control:focus {
  outline: none;
  border-color: #4285f4;
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.yaraa-form-control[readonly] {
  background: #f9fafb;
  color: #6b7280;
}

.yaraa-form-hint {
  font-size: 12px;
  color: #9ca3af;
  margin: 6px 0 0 0;
}

.yaraa-copy-field {
  display: flex;
  gap: 8px;
}

.yaraa-copy-field .yaraa-form-control {
  flex: 1;
}

.yaraa-btn-copy {
  padding: 10px 12px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.yaraa-btn-copy:hover {
  background: #e5e7eb;
}

.yaraa-btn-copy .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
  color: #6b7280;
}

/* ==========================================================================
Info Box.
========================================================================== */
.yaraa-form-info-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 16px;
  margin-top: 20px;
}

.yaraa-form-info-box h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #0369a1;
  margin: 0 0 12px 0;
}

.yaraa-form-info-box h4 .dashicons {
  font-size: 18px;
  width: 18px;
  height: 18px;
}

.yaraa-form-info-box ol {
  margin: 0 0 12px 20px;
  padding: 0;
  color: #0c4a6e;
  font-size: 13px;
  line-height: 1.8;
}

.yaraa-form-info-box ol li {
  margin-bottom: 4px;
}

.yaraa-external-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #0369a1;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

.yaraa-external-link:hover {
  color: #0284c7;
  text-decoration: underline;
}

.yaraa-external-link .dashicons {
  font-size: 14px;
  width: 14px;
  height: 14px;
}

.yaraa-required {
  color: #dc2626;
}

/* ==========================================================================
Responsive.
========================================================================== */
@media (max-width: 768px) {
  .yaraa-integrations-wrap {
    padding: 0 10px;
  }

  .yaraa-integrations-grid {
    grid-template-columns: 1fr;
  }

  .yaraa-modal-content {
    margin: 10px;
  }

  .yaraa-modal-footer {
    flex-direction: column;
  }

  .yaraa-modal-footer .yaraa-btn {
    width: 100%;
  }
}

/* ==========================================================================
Configuration Required State.
========================================================================== */
.yaraa-config-required {
  background: #fef3c7;
  border-color: #fde68a;
}

.yaraa-config-message {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #92400e;
  font-size: 13px;
  font-weight: 500;
}

.yaraa-config-message .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

.yaraa-config-hint {
  font-size: 12px;
  color: #6b7280;
  margin: 8px 0 0 0;
  text-align: center;
}

/* ==========================================================================
Configuration Instructions Box.
========================================================================== */
.yaraa-config-instructions {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  margin-top: 30px;
}

.yaraa-config-instructions h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 16px 0;
}

.yaraa-config-instructions h3 .dashicons {
  font-size: 20px;
  width: 20px;
  height: 20px;
  color: #4285f4;
}

.yaraa-config-instructions p {
  color: #6b7280;
  font-size: 14px;
  margin: 0 0 16px 0;
}

.yaraa-config-instructions ol {
  margin: 0 0 16px 20px;
  padding: 0;
  color: #374151;
  font-size: 14px;
  line-height: 1.8;
}

.yaraa-config-instructions ol li {
  margin-bottom: 8px;
}

.yaraa-config-instructions ol code {
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: #1f2937;
  word-break: break-all;
}

.yaraa-code-block {
  background: #1f2937;
  border-radius: 8px;
  padding: 16px;
  margin: 0 0 16px 0;
  overflow-x: auto;
}

.yaraa-code-block code {
  color: #10b981;
  font-family: "Monaco", "Consolas", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre;
}

/* ==========================================================================
Responsive additions.
========================================================================== */
@media (max-width: 768px) {
  .yaraa-config-instructions {
    padding: 16px;
  }

  .yaraa-code-block {
    padding: 12px;
  }

  .yaraa-code-block code {
    font-size: 11px;
  }
}