/* GAISEO Customer Portal Styles */

/* Hide default EDD login form — we use our own portal login.
   EDD Login block must exist on page for password reset to work. */
#edd_login_form,
.edd-login-form,
.edd_login {
  display: none !important;
}
.gaiseo-portal {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1a1a2e;
}

/* Header */
.gaiseo-portal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}
.gaiseo-portal-header h2 {
  margin: 0 0 4px 0;
  font-size: 1.5rem;
}
.gaiseo-portal-email {
  margin: 0;
  color: #6b7280;
  font-size: 0.9rem;
}

/* Tabs */
.gaiseo-portal-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 24px;
  overflow-x: auto;
}
.gaiseo-tab {
  padding: 10px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: #6b7280;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.gaiseo-tab:hover {
  color: #1a1a2e;
}
.gaiseo-tab.active {
  color: #4f46e5;
  border-bottom-color: #4f46e5;
}

/* Tab content */
.gaiseo-tab-content {
  display: none;
}
.gaiseo-tab-content.active {
  display: block;
}

/* Cards */
.gaiseo-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.gaiseo-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}
.gaiseo-card-label {
  display: block;
  font-size: 0.8rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.gaiseo-card-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a2e;
}

/* Buttons */
.gaiseo-btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background-color 0.2s, box-shadow 0.2s;
}
.gaiseo-btn-primary {
  background: #4f46e5;
  color: #fff;
}
.gaiseo-btn-primary:hover {
  background: #4338ca;
}
.gaiseo-btn-outline {
  background: transparent;
  color: #4f46e5;
  border: 1px solid #4f46e5;
}
.gaiseo-btn-outline:hover {
  background: #eef2ff;
}
.gaiseo-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.gaiseo-btn-download {
  background: #059669;
  color: #fff;
  padding: 6px 14px;
  font-size: 0.82rem;
}
.gaiseo-btn-download:hover {
  background: #047857;
}
.gaiseo-btn-upsell {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  padding: 6px 14px;
  font-size: 0.82rem;
  white-space: nowrap;
}
.gaiseo-btn-upsell:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
}

/* Quick Links */
.gaiseo-quick-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Loading & Empty */
.gaiseo-loading {
  text-align: center;
  padding: 40px;
  color: #6b7280;
}
.gaiseo-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid #e5e7eb;
  border-top-color: #4f46e5;
  border-radius: 50%;
  animation: gaiseo-spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes gaiseo-spin {
  to { transform: rotate(360deg); }
}
.gaiseo-empty-state {
  text-align: center;
  padding: 40px;
  color: #6b7280;
  background: #f9fafb;
  border-radius: 8px;
}

/* License List */
.gaiseo-plugin-group {
  margin-bottom: 24px;
}
.gaiseo-plugin-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #f3f4f6;
  border-radius: 8px 8px 0 0;
  border: 1px solid #e5e7eb;
  border-bottom: none;
}
.gaiseo-plugin-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: #4f46e5;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}
.gaiseo-plugin-icon.wordpress { background: #21759b; }
.gaiseo-plugin-icon.framer { background: #0055ff; }
.gaiseo-plugin-icon.webflow { background: #4353ff; }
.gaiseo-plugin-icon.wix { background: #0c6efc; }

.gaiseo-plugin-group-name {
  font-weight: 600;
  font-size: 1rem;
}

.gaiseo-license-card {
  border: 1px solid #e5e7eb;
  border-top: none;
}
.gaiseo-license-card:last-child {
  border-radius: 0 0 8px 8px;
}
.gaiseo-license-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  flex-wrap: wrap;
}
.gaiseo-license-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.gaiseo-license-details {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.gaiseo-license-key {
  font-family: monospace;
  font-size: 0.85rem;
  color: #374151;
  word-break: break-all;
}
.gaiseo-key-toggle,
.gaiseo-key-copy {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 0.85rem;
  line-height: 1;
  transition: background 0.2s;
}
.gaiseo-key-toggle:hover,
.gaiseo-key-copy:hover {
  background: #f3f4f6;
}
.gaiseo-license-meta {
  font-size: 0.8rem;
  color: #6b7280;
}
.gaiseo-badge-tier {
  background: #ede9fe;
  color: #5b21b6;
  text-transform: uppercase;
}

/* Upsell Banner */
.gaiseo-upsell-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-top: 1px dashed #f59e0b;
}
.gaiseo-upsell-text {
  font-size: 0.82rem;
  color: #92400e;
}


/* Status badges */
.gaiseo-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.gaiseo-badge-valid, .gaiseo-badge-active {
  background: #d1fae5;
  color: #065f46;
}
.gaiseo-badge-expired {
  background: #fee2e2;
  color: #991b1b;
}
.gaiseo-badge-disabled, .gaiseo-badge-inactive {
  background: #fef3c7;
  color: #92400e;
}

/* Credits */
.gaiseo-credit-bar-item {
  margin-bottom: 16px;
  padding: 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}
.gaiseo-credit-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.9rem;
}
.gaiseo-progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}
.gaiseo-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: #4f46e5;
  transition: width 0.3s ease;
}
.gaiseo-progress-fill.warning {
  background: #f59e0b;
}
.gaiseo-progress-fill.danger {
  background: #ef4444;
}

/* Bar chart (CSS-based) */
.gaiseo-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  padding: 16px 0;
}
.gaiseo-chart-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.gaiseo-chart-bar-fill {
  width: 100%;
  max-width: 40px;
  background: #4f46e5;
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height 0.3s ease;
}
.gaiseo-chart-bar-label {
  font-size: 0.7rem;
  color: #6b7280;
}

/* Usage table */
.gaiseo-usage-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}
.gaiseo-usage-table th,
.gaiseo-usage-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.85rem;
}
.gaiseo-usage-table th {
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  font-size: 0.75rem;
}

/* Billing section */
.gaiseo-billing-section {
  text-align: center;
  padding: 40px 20px;
}
.gaiseo-billing-section h3 {
  margin-bottom: 12px;
}
.gaiseo-billing-section p {
  color: #6b7280;
  max-width: 500px;
  margin: 0 auto 20px;
}
.gaiseo-billing-note {
  font-size: 0.8rem;
  margin-top: 12px !important;
}

/* Profile form */
.gaiseo-form {
  max-width: 500px;
}
.gaiseo-form-group {
  margin-bottom: 18px;
}
.gaiseo-form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.9rem;
}
.gaiseo-form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
  box-sizing: border-box;
}
.gaiseo-form-group input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.gaiseo-form-hint {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: #6b7280;
}
.gaiseo-divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 24px 0;
}
.gaiseo-form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.gaiseo-status-msg {
  font-size: 0.85rem;
}
.gaiseo-status-msg.success {
  color: #065f46;
}
.gaiseo-status-msg.error {
  color: #991b1b;
}

/* Login Form */
.gaiseo-portal-login {
  display: flex;
  justify-content: center;
  padding: 40px 20px;
}
.gaiseo-login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.gaiseo-login-header {
  text-align: center;
  margin-bottom: 24px;
}
.gaiseo-login-header h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  color: #1a1a2e;
}
.gaiseo-login-header p {
  margin: 0;
  color: #6b7280;
  font-size: 0.9rem;
}
.gaiseo-login-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}
.gaiseo-login-form .gaiseo-form-group {
  margin-bottom: 16px;
}
.gaiseo-login-form .gaiseo-form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  color: #374151;
}
.gaiseo-login-form .gaiseo-form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
  box-sizing: border-box;
}
.gaiseo-login-form .gaiseo-form-group input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.gaiseo-form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 0.85rem;
}
.gaiseo-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #374151;
  cursor: pointer;
}
.gaiseo-checkbox-label input[type="checkbox"] {
  width: auto;
}
.gaiseo-forgot-link {
  color: #4f46e5;
  text-decoration: none;
  font-size: 0.85rem;
}
.gaiseo-forgot-link:hover {
  text-decoration: underline;
}
.gaiseo-btn-full {
  width: 100%;
  text-align: center;
  padding: 12px;
  font-size: 1rem;
}

/* Responsive */
@media (max-width: 600px) {
  .gaiseo-portal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .gaiseo-portal-tabs {
    gap: 0;
  }
  .gaiseo-tab {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
  .gaiseo-license-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .gaiseo-upsell-banner {
    flex-direction: column;
    text-align: center;
  }
  .gaiseo-cards {
    grid-template-columns: 1fr 1fr;
  }
  .gaiseo-quick-links {
    flex-direction: column;
  }
}
