/* Settings Page Styles */

.settings-page {
  min-height: calc(100vh - 80px);
  background-color: #f8f9fa;
  padding: 1.5rem 2rem;
}

.settings-container {
  max-width: 1000px;
  margin: 0 auto;
}

.settings-title {
  font-family: 'Raleway', system-ui;
  font-size: 1.75rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 2rem;
}

.settings-section {
  margin-bottom: 2rem;
}

.settings-section-title {
  font-family: 'Jost', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #555;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.settings-card {
  background: white;
  border-radius: 8px;
  padding: 0.4rem 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Profile Section */
.profile-info {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-details {
  flex: 1;
}

.profile-field {
  margin-bottom: 1rem;
}

.profile-field:last-child {
  margin-bottom: 0;
}

.profile-field label {
  display: block;
  font-family: 'Jost', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.profile-field span {
  font-size: 1rem;
  color: #333;
}

/* Subscriptions List */
.subscriptions-list {
  display: flex;
  flex-direction: column;
}

.subscription-item {
  padding: 1rem 0;
  border-bottom: 1px solid #eee;
}

.subscription-item:last-child {
  border-bottom: none;
}

.subscription-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.subscription-entity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.subscription-entity a {
  color: #333;
  font-weight: 500;
  text-decoration: none;
}

.subscription-entity a:hover {
  color: #667eea;
}

.entity-type-badge {
  font-size: 10px;
  padding: 2px 6px;
  background: #e8e8e8;
  color: #666;
  border-radius: 3px;
  text-transform: uppercase;
}

.subscription-actions {
  display: flex;
  gap: 0.5rem;
}

.subscription-activity-types {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.activity-types-label {
  font-family: 'Jost', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  min-width: 100px;
}

.activity-types-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.activity-badge {
  font-size: 11px;
  padding: 2px 8px;
  background: transparent;
  border: 1px solid #ccc;
  color: #666;
  border-radius: 3px;
}

/* Color-coded activity types */
.activity-badge-create {
  border-color: #28a745;
  color: #28a745;
}

.activity-badge-update {
  border-color: #0088fe;
  color: #0088fe;
}

.activity-badge-delete {
  border-color: #dc3545;
  color: #dc3545;
}

.activity-badge-status_change {
  border-color: #fd7e14;
  color: #fd7e14;
}

.activity-badge-refresh {
  border-color: #6f42c1;
  color: #6f42c1;
}

.activity-badge-tag {
  border-color: #6c757d;
  color: #6c757d;
}

.activity-types-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: #444;
  cursor: pointer;
}

.checkbox-label input[type='checkbox'] {
  cursor: pointer;
}

/* Buttons */
/* Icon buttons */
.btn-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
  border: none;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

.btn-edit {
  color: #aaa;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.btn-edit:hover {
  color: #28a745;
  background-color: #e8f5e9;
}

.btn-save {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  color: white;
  background: #28a745;
  border: 1px solid #28a745;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-save:hover {
  background: #218838;
  border-color: #218838;
}

.btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-cancel {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  color: #666;
  background: transparent;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-cancel:hover {
  background: #f5f5f5;
}

.btn-cancel:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-unsubscribe {
  color: #aaa;
  font-size: 25px;
  font-weight: 400;
  line-height: 1;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.btn-unsubscribe:hover {
  color: #dc3545;
  background-color: #ffeaea;
}

.text-muted {
  color: #999;
  font-style: italic;
}

/* Status badges */
.status-badge {
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-invalid {
  background-color: #ffeaea;
  color: #dc3545;
}

/* Empty State */
.empty-state {
  color: #888;
  font-size: 0.95rem;
  text-align: center;
  padding: 1rem 0;
}

/* Service Accounts Section */
.section-description {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.credentials-banner {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border: 1px solid #4caf50;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.credentials-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.credentials-header strong {
  color: #2e7d32;
}

.btn-dismiss {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #666;
  cursor: pointer;
  padding: 0 0.25rem;
}

.btn-dismiss:hover {
  color: #333;
}

.credentials-warning {
  color: #c62828;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.credentials-grid {
  display: grid;
  gap: 0.75rem;
}

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

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

.credential-item code {
  background: #fff;
  padding: 0.5rem;
  border-radius: 4px;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.85rem;
  word-break: break-all;
}

.credential-value {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.credential-value code {
  flex: 1;
}

.btn-copy {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-copy:hover {
  background: #f5f5f5;
}

.create-service-account-form {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.create-service-account-form input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: 'Jost', sans-serif;
}

.create-service-account-form input:focus {
  outline: none;
  border-color: #4caf50;
}

.btn-create {
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-family: 'Jost', sans-serif;
  cursor: pointer;
  white-space: nowrap;
}

.btn-create:hover:not(:disabled) {
  background: #43a047;
}

.btn-create:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.service-accounts-list h4 {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.service-accounts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.service-accounts-table th {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 2px solid #eee;
  color: #666;
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.service-accounts-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid #eee;
}

.service-accounts-table .client-id {
  background: #f5f5f5;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-size: 0.8rem;
}

.service-accounts-table .created-date {
  color: #888;
  font-size: 0.85rem;
}

.service-accounts-table .actions-cell {
  width: 40px;
  text-align: right;
}

.btn-delete-account {
  background: none;
  border: 1px solid transparent;
  color: #999;
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  line-height: 1;
  opacity: 0;
  transition: all 0.15s ease;
}

.service-accounts-table tr:hover .btn-delete-account {
  opacity: 1;
}

.btn-delete-account:hover {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.1);
  border-color: rgba(220, 53, 69, 0.2);
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.section-title-row .settings-section-title {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.section-title-row .btn-create {
  padding: 0.375rem 0.75rem;
  font-size: 0.85rem;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: white;
  border-radius: 8px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  animation: slideIn 0.15s ease-out;
}

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

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

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: 'Jost', sans-serif;
  color: #333;
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #999;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

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

.modal-body {
  padding: 1.25rem;
}

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

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

.form-group input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: 'Jost', sans-serif;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: #4caf50;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.form-hint {
  display: block;
  font-size: 0.8rem;
  color: #888;
  margin-top: 0.375rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid #eee;
  background: #fafafa;
  border-radius: 0 0 8px 8px;
}

.btn-secondary {
  background: white;
  color: #666;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-family: 'Jost', sans-serif;
  cursor: pointer;
}

.btn-secondary:hover:not(:disabled) {
  background: #f5f5f5;
  border-color: #ccc;
}

.btn-primary {
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-family: 'Jost', sans-serif;
  cursor: pointer;
}

.btn-primary:hover:not(:disabled) {
  background: #43a047;
}

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Credentials in Modal */
.credentials-success {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.credentials-success .success-icon {
  width: 24px;
  height: 24px;
  background: #4caf50;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
}

.credentials-success h4 {
  margin: 0;
  font-size: 1rem;
  color: #2e7d32;
}

.modal-body .credentials-warning {
  background: #fff3e0;
  border: 1px solid #ffb74d;
  border-radius: 4px;
  padding: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: #e65100;
}

.modal-body .credentials-grid {
  background: #f9f9f9;
  border-radius: 4px;
  padding: 1rem;
}

.modal-body .credential-item {
  margin-bottom: 0.75rem;
}

.modal-body .credential-item:last-child {
  margin-bottom: 0;
}

.modal-body .credential-item code {
  background: white;
  border: 1px solid #eee;
}
