/* =============================================
   EKKO CPANEL EMAIL MANAGER - PUBLIC STYLES
   Based on Ekko Newsletter Design System
   ============================================= */

/* ===== CSS VARIABLES ===== */
:root {
  --ekko-primary: #3B82F6;
  --ekko-primary-dark: #2563EB;
  --ekko-gray-50: #F9FAFB;
  --ekko-gray-100: #F3F4F6;
  --ekko-gray-200: #E5E7EB;
  --ekko-gray-300: #D1D5DB;
  --ekko-gray-400: #9CA3AF;
  --ekko-gray-500: #6B7280;
  --ekko-gray-700: #374151;
  --ekko-gray-900: #111827;
  
  --ekko-space-2: 0.5rem;
  --ekko-space-3: 0.75rem;
  --ekko-space-4: 1rem;
  --ekko-space-5: 1.25rem;
  --ekko-space-6: 1.5rem;
  
  --ekko-radius-md: 0.5rem;
  --ekko-radius-lg: 0.75rem;
  
  --ekko-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --ekko-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== CONTAINER ===== */
.ekko--email-manager {
  max-width: 600px;
  margin: var(--ekko-space-6) auto;
  background: white;
  border-radius: var(--ekko-radius-lg);
  box-shadow: var(--ekko-shadow-sm);
  border: 1px solid var(--ekko-gray-200);
  position: relative;
  padding-bottom: 60px;
}

.ekko--email-manager__container {
  padding: var(--ekko-space-6);
}

.ekko--email-manager__title {
  margin: 0 0 var(--ekko-space-4) 0;
  text-align: center;
  line-height: 1.3;
  color: var(--ekko-gray-900);
}

.ekko--email-manager__description {
  margin: 0 0 var(--ekko-space-5) 0;
  text-align: center;
  line-height: 1.6;
  color: var(--ekko-gray-500);
}

/* ===== FORMS ===== */
.ekko--form {
  display: flex;
  flex-direction: column;
  gap: var(--ekko-space-5);
}

.ekko--form__group {
  display: flex;
  flex-direction: column;
  gap: var(--ekko-space-2);
}

.ekko--form__label {
  font-weight: 600;
  color: var(--ekko-gray-900);
  font-size: 14px;
}

.ekko--form__input {
  width: 100%;
  padding: var(--ekko-space-3) var(--ekko-space-4);
  border: 1.5px solid var(--ekko-gray-300);
  border-radius: var(--ekko-radius-md);
  font-size: 14px;
  line-height: 1.4;
  background: white;
  color: var(--ekko-gray-900);
  transition: var(--ekko-transition);
  box-sizing: border-box;
  font-family: inherit;
}

.ekko--form__input:focus {
  border-color: var(--ekko-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ekko--form__input:hover {
  border-color: var(--ekko-gray-400);
}

.ekko--form__input::placeholder {
  color: var(--ekko-gray-400);
}

/* ===== BUTTONS ===== */
/* Note: btn--primary and btn--secondary are managed by AutomaticCSS */
.ekko--btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ekko-space-2);
  padding: var(--ekko-space-3) var(--ekko-space-5);
  border: none;
  border-radius: var(--ekko-radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--ekko-transition);
  height: 40px;
  box-sizing: border-box;
  width: 100%;
  font-family: inherit;
}

.ekko--btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== FORWARDERS LIST ===== */
.ekko--forwarders-list {
  display: flex;
  flex-direction: column;
  gap: var(--ekko-space-3);
  padding: var(--ekko-space-4);
  background: var(--ekko-gray-50);
  border: 1.5px solid var(--ekko-gray-200);
  border-radius: var(--ekko-radius-md);
  max-height: 400px;
  overflow-y: auto;
}

.ekko--checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--ekko-space-3);
  cursor: pointer;
  padding: var(--ekko-space-3);
  border-radius: var(--ekko-radius-md);
  transition: var(--ekko-transition);
  background: white;
  border: 1px solid var(--ekko-gray-200);
}

.ekko--checkbox-label:hover {
  background: var(--ekko-gray-50);
  border-color: var(--ekko-primary);
}

.ekko--checkbox {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--ekko-primary);
  flex-shrink: 0;
}

.ekko--checkbox-label span {
  font-size: 14px;
  color: var(--ekko-gray-500);
  font-weight: 500;
}

/* Checked items have normal text color */
.ekko--checkbox-label:has(input:checked) span {
  color: var(--ekko-gray-900);
}

/* ===== SELECT ACTIONS ===== */
.ekko--select-actions {
  display: flex;
  gap: var(--ekko-space-2);
  align-items: center;
  font-size: 13px;
  margin-top: var(--ekko-space-2);
}

.ekko--link {
  color: var(--ekko-primary);
  text-decoration: none;
  font-weight: 600;
}

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

/* ===== MESSAGES ===== */
.ekko--message,
.ekko--notice {
  padding: var(--ekko-space-4) var(--ekko-space-5);
  border-radius: var(--ekko-radius-md);
  margin: var(--ekko-space-4) 0;
  border-left: 4px solid;
  font-size: 14px;
  line-height: 1.6;
}

.ekko--notice--success {
  background: #ECFDF5;
  color: #065F46;
  border-left-color: #10B981;
}

.ekko--notice--error {
  background: #FEF2F2;
  color: #991B1B;
  border-left-color: #EF4444;
}

.ekko--notice--warning {
  background: #FFFBEB;
  color: #92400E;
  border-left-color: #F59E0B;
}

.ekko--notice--info {
  background: #EFF6FF;
  color: #1E40AF;
  border-left-color: #3B82F6;
}

/* ===== SIGNATURE ===== */
.ekko--signature {
  position: absolute;
  bottom: var(--ekko-space-4);
  right: var(--ekko-space-4);
}

.ekko--signature a {
  display: inline-flex;
  align-items: center;
  gap: var(--ekko-space-2);
  font-size: 11px;
  color: var(--ekko-gray-400);
  text-decoration: none;
  font-weight: 600;
  padding: var(--ekko-space-2) var(--ekko-space-3);
  border-radius: var(--ekko-radius-md);
  transition: var(--ekko-transition);
}

.ekko--signature a::before {
  content: "⚡";
  font-size: 14px;
}

.ekko--signature a:hover {
  color: var(--ekko-primary);
  background: var(--ekko-gray-50);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .ekko--email-manager {
    margin: var(--ekko-space-4);
    border-radius: var(--ekko-radius-md);
  }
  
  .ekko--email-manager__container {
    padding: var(--ekko-space-4);
  }
  
  .ekko--signature {
    position: static;
    text-align: right;
    padding-top: var(--ekko-space-4);
    margin-top: var(--ekko-space-6);
    border-top: 1px solid var(--ekko-gray-200);
  }
}

/* ===== SCROLLBAR ===== */
.ekko--forwarders-list::-webkit-scrollbar {
  width: 8px;
}

.ekko--forwarders-list::-webkit-scrollbar-track {
  background: var(--ekko-gray-100);
  border-radius: var(--ekko-radius-md);
}

.ekko--forwarders-list::-webkit-scrollbar-thumb {
  background: var(--ekko-gray-300);
  border-radius: var(--ekko-radius-md);
}

.ekko--forwarders-list::-webkit-scrollbar-thumb:hover {
  background: var(--ekko-gray-400);
}

/* ===== DARK THEME ===== */
.ekko--email-manager--dark {
  background: var(--ekko-gray-900);
  border-color: var(--ekko-gray-700);
  color: var(--ekko-gray-100);
}

.ekko--email-manager--dark .ekko--email-manager__title {
  color: white;
}

.ekko--email-manager--dark .ekko--email-manager__description {
  color: var(--ekko-gray-300);
}

.ekko--email-manager--dark .ekko--form__label {
  color: var(--ekko-gray-200);
}

.ekko--email-manager--dark .ekko--form__input {
  background: var(--ekko-gray-800);
  border-color: var(--ekko-gray-700);
  color: white;
}

.ekko--email-manager--dark .ekko--form__input:focus {
  border-color: var(--ekko-primary);
  background: var(--ekko-gray-800);
}

.ekko--email-manager--dark .ekko--form__input::placeholder {
  color: var(--ekko-gray-500);
}

.ekko--email-manager--dark .btn--secondary {
  background: var(--ekko-gray-800);
  color: var(--ekko-gray-200);
  border-color: var(--ekko-gray-700);
}

.ekko--email-manager--dark .btn--secondary:hover {
  background: var(--ekko-gray-700);
  border-color: var(--ekko-gray-600);
}

.ekko--email-manager--dark .ekko--forwarders-list {
  background: var(--ekko-gray-800);
  border-color: var(--ekko-gray-700);
}

.ekko--email-manager--dark .ekko--checkbox-label {
  background: var(--ekko-gray-800);
  border-color: var(--ekko-gray-700);
}

.ekko--email-manager--dark .ekko--checkbox-label:hover {
  background: var(--ekko-gray-700);
  border-color: var(--ekko-primary);
}

.ekko--email-manager--dark .ekko--checkbox-label span {
  color: var(--ekko-gray-200);
}

.ekko--email-manager--dark .ekko--link {
  color: var(--ekko-primary-light);
}

.ekko--email-manager--dark .ekko--signature a {
  color: var(--ekko-gray-500);
}

.ekko--email-manager--dark .ekko--signature a:hover {
  color: var(--ekko-primary-light);
  background: var(--ekko-gray-800);
}

/* ===== COMPACT MODE ===== */
.ekko--email-manager--compact {
  max-width: 400px;
  padding-bottom: 40px;
}

.ekko--email-manager--compact .ekko--email-manager__container {
  padding: var(--ekko-space-4);
}

.ekko--email-manager--compact .ekko--email-manager__title {
  font-size: 18px;
  margin-bottom: var(--ekko-space-3);
}

.ekko--email-manager--compact .ekko--email-manager__description {
  font-size: 13px;
  margin-bottom: var(--ekko-space-3);
}

.ekko--email-manager--compact .ekko--form {
  gap: var(--ekko-space-3);
}

.ekko--email-manager--compact .ekko--form__label {
  font-size: 13px;
}

.ekko--email-manager--compact .ekko--form__input {
  padding: var(--ekko-space-2) var(--ekko-space-3);
  font-size: 13px;
  height: 36px;
}

.ekko--email-manager--compact .ekko--btn {
  height: 36px;
  padding: var(--ekko-space-2) var(--ekko-space-4);
  font-size: 13px;
}

.ekko--email-manager--compact .ekko--forwarders-list {
  padding: var(--ekko-space-3);
  max-height: 300px;
  gap: var(--ekko-space-2);
}

.ekko--email-manager--compact .ekko--checkbox-label {
  padding: var(--ekko-space-2);
}

.ekko--email-manager--compact .ekko--checkbox-label span {
  font-size: 13px;
}

/* ===== CONFIRMATION PAGE STYLES ===== */
/* Using body.ekko-confirmation-body for higher specificity to override theme styles */

/* Body and page wrapper */
body.ekko-confirmation-body {
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  position: relative;
  overflow-x: hidden;
}

body.ekko-confirmation-body * {
  box-sizing: border-box;
}

body.ekko-confirmation-body .ekko-confirmation-page {
  width: 100% !important;
  min-height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 2rem !important;
  position: relative !important;
  z-index: 1 !important;
  margin: 0 !important;
  max-width: 100% !important;
}

body.ekko-confirmation-body .ekko-confirmation-container {
  background: #ffffff !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
  max-width: 520px !important;
  width: 100% !important;
  padding: 3rem 2.5rem !important;
  text-align: center !important;
  margin: 0 auto !important;
  position: relative !important;
  float: none !important;
  left: auto !important;
  right: auto !important;
}

/* Logo */
body.ekko-confirmation-body .ekko-confirmation-logo {
  margin-bottom: 1.5rem;
}

body.ekko-confirmation-body .ekko-confirmation-logo img {
  display: block;
  margin: 0 auto;
  height: auto;
}

/* Status icon */
body.ekko-confirmation-body .ekko-confirmation-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: bold;
  margin: 0 auto 1.25rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

body.ekko-confirmation-body .ekko-confirmation-icon-success {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
}

body.ekko-confirmation-body .ekko-confirmation-icon-error {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  color: white;
}

/* Title and text - max 1.75rem for contained appearance */
body.ekko-confirmation-body .ekko-confirmation-title {
  font-size: clamp(1.25rem, 3vw, 1.75rem) !important;
  font-weight: 700 !important;
  margin: 0 0 0.75rem 0 !important;
  line-height: 1.3 !important;
  text-align: center !important;
  color: var(--ekko-brand-color, #374151) !important;
  word-wrap: break-word !important;
}

body.ekko-confirmation-body .ekko-confirmation-list-name {
  font-size: 15px;
  color: #6b7280;
  margin: 0 0 1.5rem 0;
  text-align: center;
}

body.ekko-confirmation-body .ekko-confirmation-list-name strong {
  color: #374151;
}

/* Details section - Email template style */
body.ekko-confirmation-body .ekko-confirmation-details {
  background: #f9fafb;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0 0 0;
  text-align: left;
  border: 1px solid #e5e7eb;
}

body.ekko-confirmation-body .ekko-confirmation-section {
  margin-bottom: 1.25rem;
}

body.ekko-confirmation-body .ekko-confirmation-section:last-child {
  margin-bottom: 0;
}

/* Section titles - max 1rem for contained appearance */
body.ekko-confirmation-body .ekko-confirmation-section h2 {
  font-size: clamp(0.75rem, 2vw, 1rem) !important;
  font-weight: 600 !important;
  margin: 0 0 0.75rem 0 !important;
  text-align: left !important;
  color: var(--ekko-brand-color, #374151) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.025em !important;
}

body.ekko-confirmation-body .ekko-confirmation-section--added h2 {
  color: #059669;
}

body.ekko-confirmation-body .ekko-confirmation-section--removed h2 {
  color: #DC2626;
}

body.ekko-confirmation-body .ekko-confirmation-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

body.ekko-confirmation-body .ekko-confirmation-list li {
  padding: 0.625rem 0.875rem;
  background: #ffffff;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-size: 14px;
  color: #374151;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  transition: all 0.15s ease;
}

body.ekko-confirmation-body .ekko-confirmation-list li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ekko-brand-color, #6b7280);
  margin-right: 0.75rem;
  flex-shrink: 0;
}

body.ekko-confirmation-body .ekko-confirmation-section--added .ekko-confirmation-list li::before {
  background: #10B981;
}

body.ekko-confirmation-body .ekko-confirmation-section--removed .ekko-confirmation-list li::before {
  background: #EF4444;
}

body.ekko-confirmation-body .ekko-confirmation-list li:last-child {
  margin-bottom: 0;
}

body.ekko-confirmation-body .ekko-confirmation-no-changes {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
  text-align: center;
  padding: 1rem;
}

/* Actions */
body.ekko-confirmation-body .ekko-confirmation-actions {
  margin-top: 2rem;
  text-align: center;
}

body.ekko-confirmation-body .ekko-confirmation-button {
  display: inline-block;
  padding: 0.875rem 2rem;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  background: var(--ekko-button-color, #2563EB);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

body.ekko-confirmation-body .ekko-confirmation-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
  color: #ffffff;
  text-decoration: none;
}

body.ekko-confirmation-body .ekko-confirmation-button:active {
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 640px) {
  body.ekko-confirmation-body .ekko-confirmation-page {
    padding: 1rem;
    align-items: flex-start;
    padding-top: 2rem;
  }

  body.ekko-confirmation-body .ekko-confirmation-container {
    padding: 2rem 1.5rem;
    border-radius: 12px;
  }

  body.ekko-confirmation-body .ekko-confirmation-title {
    font-size: 1.25rem;
  }

  body.ekko-confirmation-body .ekko-confirmation-icon {
    width: 60px;
    height: 60px;
    font-size: 30px;
  }

  body.ekko-confirmation-body .ekko-confirmation-details {
    padding: 1.25rem;
  }

  body.ekko-confirmation-body .ekko-confirmation-section h2 {
    font-size: 0.8125rem;
  }

  body.ekko-confirmation-body .ekko-confirmation-list li {
    font-size: 13px;
    padding: 0.5rem 0.75rem;
  }

  body.ekko-confirmation-body .ekko-confirmation-button {
    width: 100%;
    padding: 1rem;
  }
}

/* WordPress admin bar adjustment */
body.admin-bar.ekko-confirmation-body .ekko-confirmation-page {
  min-height: calc(100vh - 32px);
}

@media screen and (max-width: 782px) {
  body.admin-bar.ekko-confirmation-body .ekko-confirmation-page {
    min-height: calc(100vh - 46px);
  }
}

