/**
 * CookiePilot Admin Styles
 */

#cookiepilot-admin-root {
  margin: 20px 20px 20px 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Hide WordPress notices in our admin page */
.toplevel_page_cookiepilot .notice,
.toplevel_page_cookiepilot .updated {
  display: none !important;
}

/* Reset some WP styles */
#cookiepilot-admin-root * {
  box-sizing: border-box;
}

/* Main Wrap */
.cookiepilot-wrap {
  max-width: 800px;
  margin: 20px auto;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Logo */
.cookiepilot-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.cookiepilot-logo span {
  font-size: 24px;
  font-weight: 600;
  color: #1f2937;
}

/* Loading */
.cookiepilot-loading {
  text-align: center;
  padding: 40px;
  color: #6b7280;
}

.cookiepilot-loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #ddd;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 10px;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Errors and Success */
.cookiepilot-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.cookiepilot-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #16a34a;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
}

/* Auth Forms */
.cookiepilot-auth {
  max-width: 400px;
  margin: 0 auto;
}

.cookiepilot-auth h2 {
  margin-bottom: 24px;
  text-align: center;
  color: #1f2937;
}

.cookiepilot-description {
  color: #6b7280;
  margin-bottom: 20px;
  text-align: center;
}

.cookiepilot-field {
  margin-bottom: 16px;
}

.cookiepilot-field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #374151;
}

.cookiepilot-field input[type="text"],
.cookiepilot-field input[type="email"],
.cookiepilot-field input[type="password"],
.cookiepilot-field input[type="number"],
.cookiepilot-field textarea,
.cookiepilot-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cookiepilot-field input:focus,
.cookiepilot-field textarea:focus,
.cookiepilot-field select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.cookiepilot-field input:disabled {
  background: #f9fafb;
  color: #6b7280;
}

.cookiepilot-field small {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 12px;
}

.cookiepilot-checkbox label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}

.cookiepilot-checkbox input[type="checkbox"] {
  margin-top: 2px;
}

/* Buttons */
.cookiepilot-auth button[type="submit"],
.button.button-primary {
  width: 100%;
  padding: 12px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.cookiepilot-auth button[type="submit"]:hover,
.button.button-primary:hover {
  background: #1d4ed8;
}

.cookiepilot-auth button[type="submit"]:disabled,
.button.button-primary:disabled {
  background: #93c5fd;
  cursor: not-allowed;
}

.button.button-secondary {
  background: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
}

.button.button-secondary:hover {
  background: #f9fafb;
}

.button-link {
  background: none;
  border: none;
  color: #2563eb;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}

.button-link:hover {
  text-decoration: underline;
}

.cookiepilot-links {
  margin-top: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Dashboard */
.cookiepilot-dashboard {
  /* Dashboard styles */
}

.cookiepilot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.cookiepilot-user {
  color: #6b7280;
}

.cookiepilot-user .org {
  margin-left: 8px;
  color: #9ca3af;
}

.cookiepilot-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.cookiepilot-nav-item {
  background: none;
  border: none;
  padding: 12px 16px;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}

.cookiepilot-nav-item:hover {
  color: #374151;
}

.cookiepilot-nav-item.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

/* Cards */
.cookiepilot-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.cookiepilot-card h3 {
  margin: 0 0 16px 0;
  font-size: 16px;
  color: #1f2937;
}

/* Status Items */
.cookiepilot-status-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
}

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

.cookiepilot-status-item .label {
  color: #6b7280;
}

.cookiepilot-status-item .value {
  font-weight: 500;
  color: #1f2937;
}

.cookiepilot-status-item .value.active {
  color: #16a34a;
}

.cookiepilot-status-item .value.inactive {
  color: #dc2626;
}

.cookiepilot-status-item .value.warning {
  color: #d97706;
}

.cookiepilot-status-item .value.danger {
  color: #dc2626;
}

/* Progress Bar */
.cookiepilot-progress-bar {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  margin: 8px 0 4px 0;
  overflow: hidden;
}

.cookiepilot-progress-fill {
  height: 100%;
  background: #2563eb;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.cookiepilot-progress-fill.warning {
  background: #d97706;
}

.cookiepilot-progress-fill.danger {
  background: #dc2626;
}

/* Domain List */
.cookiepilot-domains-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cookiepilot-domains-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.cookiepilot-domains-list li:last-child {
  border-bottom: none;
}

.cookiepilot-domains-list li.current {
  background: #eff6ff;
}

.cookiepilot-domains-list .hostname {
  flex: 1;
  font-weight: 500;
}

.cookiepilot-domains-list .status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
}

.cookiepilot-domains-list .status.active {
  background: #dcfce7;
  color: #16a34a;
}

.cookiepilot-domains-list .status.inactive {
  background: #fef2f2;
  color: #dc2626;
}

/* Domain Info */
.cookiepilot-domain-info {
  /* Domain info container */
}

.cookiepilot-domain-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

.cookiepilot-syncing {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #2563eb;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 14px;
}

.cookiepilot-syncing .spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #bfdbfe;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Domain Add */
.cookiepilot-domain-add {
  text-align: center;
}

.cookiepilot-domain-add p {
  color: #6b7280;
  margin-bottom: 16px;
}

/* Billing */
.cookiepilot-billing .cookiepilot-plan-name {
  font-size: 24px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 12px;
}

.cookiepilot-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.cookiepilot-plan {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
}

.cookiepilot-plan h4 {
  margin: 0 0 12px 0;
  font-size: 18px;
}

.cookiepilot-plan ul {
  list-style: none;
  margin: 0 0 16px 0;
  padding: 0;
}

.cookiepilot-plan li {
  padding: 4px 0;
  color: #6b7280;
}

.cookiepilot-plan li::before {
  content: "✓";
  color: #16a34a;
  margin-right: 8px;
}

.cookiepilot-plan-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cookiepilot-plan-actions .button {
  text-align: center;
}

/* Config Editor */
.cookiepilot-config-editor {
  /* Config editor styles */
}

.cookiepilot-config-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.cookiepilot-config-header h3 {
  margin: 0;
}

.cookiepilot-config-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.cookiepilot-config-tabs button {
  background: none;
  border: none;
  padding: 12px 16px;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.cookiepilot-config-tabs button:hover {
  color: #374151;
}

.cookiepilot-config-tabs button.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.cookiepilot-config-section {
  /* Section styles */
}

.cookiepilot-config-section h4 {
  margin: 24px 0 12px 0;
  font-size: 14px;
  color: #6b7280;
  text-transform: uppercase;
}

.cookiepilot-config-section h4:first-child {
  margin-top: 0;
}

.cookiepilot-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.cookiepilot-locale-switcher {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
}

.cookiepilot-locale-switcher button {
  padding: 8px 16px;
  border: 1px solid #d1d5db;
  background: #fff;
  cursor: pointer;
  border-radius: 4px;
}

.cookiepilot-locale-switcher button.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.cookiepilot-color-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.cookiepilot-color-input {
  display: flex;
  gap: 8px;
}

.cookiepilot-color-input input[type="color"] {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  cursor: pointer;
}

.cookiepilot-color-input input[type="text"] {
  flex: 1;
}

.cookiepilot-preview {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.cookiepilot-banner-preview {
  margin-top: 12px;
}

.cookiepilot-config-actions {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

/* Agency Success */
.cookiepilot-agency-success {
  text-align: center;
}

.cookiepilot-agency-success h2 {
  color: #16a34a;
  margin-bottom: 20px;
}

.cookiepilot-agency-success code {
  display: inline-block;
  background: #f3f4f6;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: monospace;
  word-break: break-all;
}

.cookiepilot-note {
  color: #6b7280;
  margin: 20px 0;
}

/* Visual Effects Styles */
.cookiepilot-effect-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.cookiepilot-effect-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cookiepilot-effect-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cookiepilot-effect-info strong {
  font-size: 14px;
  color: #1f2937;
}

.cookiepilot-effect-info small {
  font-size: 12px;
  color: #6b7280;
}

.cookiepilot-effect-options {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

/* Toggle Switch */
.cookiepilot-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.cookiepilot-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookiepilot-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d5db;
  transition: 0.2s;
  border-radius: 24px;
}

.cookiepilot-toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

.cookiepilot-toggle input:checked + .cookiepilot-toggle-slider {
  background-color: #2563eb;
}

.cookiepilot-toggle input:checked + .cookiepilot-toggle-slider:before {
  transform: translateX(20px);
}

/* Button Group */
.cookiepilot-button-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cookiepilot-button-group button {
  flex: 1;
  min-width: 80px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.cookiepilot-button-group button:hover {
  border-color: #2563eb;
  background: #f8fafc;
}

.cookiepilot-button-group button.active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #2563eb;
}

/* Range Slider */
.cookiepilot-field input[type="range"] {
  width: 100%;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

.cookiepilot-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: #2563eb;
  border-radius: 50%;
  cursor: pointer;
}

.cookiepilot-field input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #2563eb;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Effect Info Box */
.cookiepilot-effect-info-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 12px 16px;
  margin-top: 16px;
}

.cookiepilot-effect-info-box p {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
}

.cookiepilot-effect-info-box code {
  background: #e5e7eb;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 11px;
}

/* Agency Dashboard */
.cookiepilot-agency-dashboard {
  /* Agency dashboard container */
}

.cookiepilot-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.cookiepilot-dashboard-info h2 {
  margin: 0 0 8px 0;
  font-size: 20px;
  color: #1f2937;
}

.cookiepilot-agency-name {
  color: #6b7280;
  margin: 0;
}

.cookiepilot-dashboard-actions {
  display: flex;
  gap: 8px;
}

.cookiepilot-status-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.cookiepilot-status-label {
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
}

.cookiepilot-status-value {
  font-weight: 500;
  color: #1f2937;
}

.cookiepilot-status-value code {
  background: #e5e7eb;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
}

.cookiepilot-status-active {
  color: #16a34a;
}

.cookiepilot-config-section h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #1f2937;
}

.cookiepilot-hint {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 16px;
}

/* Modal */
.cookiepilot-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: 100000;
}

.cookiepilot-modal {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.cookiepilot-modal h3 {
  margin: 0 0 12px 0;
  font-size: 18px;
  color: #1f2937;
}

.cookiepilot-modal p {
  color: #6b7280;
  margin-bottom: 20px;
}

.cookiepilot-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.cookiepilot-button-danger {
  background: #dc2626 !important;
}

.cookiepilot-button-danger:hover {
  background: #b91c1c !important;
}

/* Email Verification Screens */
.cookiepilot-verification-pending,
.cookiepilot-verification-screen {
  text-align: center;
  padding: 20px 0;
}

.cookiepilot-verification-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  color: #6b7280;
}

.cookiepilot-verification-icon.cookiepilot-success-icon {
  color: #16a34a;
}

.cookiepilot-verification-icon.cookiepilot-error-icon {
  color: #dc2626;
}

.cookiepilot-verification-email {
  color: #6b7280;
  margin: 0;
}

.cookiepilot-verification-email-address {
  font-size: 18px;
  color: #1f2937;
  margin: 8px 0 16px 0;
}

.cookiepilot-verification-hint {
  color: #6b7280;
  margin: 16px 0 24px 0;
  line-height: 1.5;
}

.cookiepilot-verification-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.cookiepilot-verification-actions .button {
  min-width: 180px;
}

.cookiepilot-verification-actions .cookiepilot-success,
.cookiepilot-verification-actions .cookiepilot-error {
  margin-bottom: 0;
}

/* Loading Spinner for verification */
.cookiepilot-loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px auto;
}

/* Responsive */
@media (max-width: 600px) {
  .cookiepilot-wrap {
    margin: 10px;
    padding: 16px;
  }

  .cookiepilot-field-row,
  .cookiepilot-color-row {
    grid-template-columns: 1fr;
  }

  .cookiepilot-plans {
    grid-template-columns: 1fr;
  }

  .cookiepilot-dashboard-header {
    flex-direction: column;
    gap: 16px;
  }
}
