/* Klaro.js Custom Theme for flowsAI */
/* Updated with all design requirements */

/* Override Klaro variables to match flowsAI theme */
:root {
  --klaro-font-family: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --klaro-primary-color: #ED7863;
  --klaro-border-radius: 0.75rem; 
}

/* Light theme colors */
.klaro {
  --klaro-bg-color: #ffffff;
  --klaro-text-color: #333333; /* Changed from #111827 */
  --klaro-border-color: rgba(125, 125, 125, 0.2);
  --klaro-button-bg: transparent;
  --klaro-button-text: #333333; /* Button text color */
  --klaro-button-border: #fefefe;
  --klaro-link-color: #333333; /* For privacy policy link */
}

/* Dark theme colors */
html.dark .klaro {
  --klaro-bg-color: #161616;
  --klaro-text-color: #e5e7eb;
  --klaro-border-color: rgba(255, 255, 255, 0.15);
  --klaro-button-bg: transparent;
  --klaro-button-text: #e5e7eb;
  --klaro-button-border: #fefefe;
  --klaro-link-color: #e5e7eb;
}

/* Main Klaro container */
.klaro .cookie-modal,
.klaro .cookie-notice {
  font-family: var(--klaro-font-family) !important;
  background: var(--klaro-bg-color) !important;
  color: var(--klaro-text-color) !important;
  border-radius: var(--klaro-border-radius) !important;
  border: 1px solid var(--klaro-border-color) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25) !important;
}

/* Klaro notice (banner) positioning - BOTTOM CENTER */
.klaro .cookie-notice {
  position: fixed !important;
  bottom: 1rem !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  max-width: 500px !important;
  z-index: 9999 !important;
  right: auto !important;
}

/* ALL BUTTONS - Universal styling */
.klaro .cm-btn,
.klaro .cn-button,
.klaro .cn-ok,
.klaro .cn-decline,
.klaro .cn-learn-more {
  background: var(--klaro-button-bg) !important;
  color: var(--klaro-button-text) !important;
  border: 1px solid var(--klaro-button-border) !important;
  border-radius: 0.5rem !important;
  font-weight: 700 !important;
  font-family: var(--klaro-font-family) !important;
  padding: 0.6rem 1rem !important;
  transition: background-color 0.15s ease, border-color 0.15s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important; /* CENTER TEXT */
  text-align: center !important; /* CENTER TEXT */
  cursor: pointer !important;
  white-space: nowrap !important;
}

/* Primary button (Accept All) - Override to have same border as others */
.klaro .cm-btn.cm-btn-success,
.klaro .cn-ok {
  background: var(--klaro-primary-color) !important;
  color: #ffffff !important;
  border: 1px solid var(--klaro-button-border) !important; /* Same border as others */
}

.klaro .cm-btn.cm-btn-success:hover,
.klaro .cn-ok:hover {
  background: #e06d58 !important;
}

/* Secondary buttons hover states */
.klaro .cm-btn:hover,
.klaro .cn-button:hover,
.klaro .cn-decline:hover,
.klaro .cn-learn-more:hover {
  background: rgba(125, 125, 125, 0.08) !important;
  border-color: var(--klaro-button-border) !important;
}

html.dark .klaro .cm-btn:hover,
html.dark .klaro .cn-button:hover,
html.dark .klaro .cn-decline:hover,
html.dark .klaro .cn-learn-more:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--klaro-button-border) !important;
}

/* Title styling */
.klaro .cookie-modal .cm-modal .cm-header h1,
.klaro .cookie-notice .cn-title {
  color: var(--klaro-text-color) !important;
  font-family: var(--klaro-font-family) !important;
  font-weight: 700 !important;
}

/* Text content */
.klaro .cookie-modal .cm-modal .cm-body,
.klaro .cookie-notice .cn-body {
  color: var(--klaro-text-color) !important;
  font-family: var(--klaro-font-family) !important;
}

/* Service toggles */
.klaro .cm-list-input input[type=checkbox] + label::before {
  background: rgba(125, 125, 125, 0.15) !important;
  border: 1px solid var(--klaro-border-color) !important;
}

.klaro .cm-list-input input[type=checkbox]:checked + label::before {
  background: var(--klaro-primary-color) !important;
  border-color: var(--klaro-primary-color) !important;
}

/* Modal backdrop */
.klaro .cookie-modal .cm-bg {
  background: rgba(0, 0, 0, 0.5) !important;
}

html.dark .klaro .cookie-modal .cm-bg {
  background: rgba(0, 0, 0, 0.7) !important;
}

/* Service list items */
.klaro .cm-list-item {
  border-color: var(--klaro-border-color) !important;
  color: var(--klaro-text-color) !important;
}

/* Service descriptions */
.klaro .cm-list-item .cm-list-description {
  color: var(--klaro-text-color) !important;
  font-family: var(--klaro-font-family) !important;
}

/* Privacy Policy Links - smaller and positioned */
.klaro a {
  color: var(--klaro-link-color) !important;
  text-decoration: underline !important;
  font-size: 0.75rem !important; /* Smaller text */
  font-family: var(--klaro-font-family) !important;
}

.klaro a:hover {
  color: var(--klaro-primary-color) !important;
}

/* Ensure z-index is above everything */
.klaro {
  z-index: 9999 !important;
}

.klaro .cookie-modal,
.klaro .cookie-notice {
  z-index: 9999 !important;
}

/* Button layout optimization - Custom layout for privacy link positioning */
.klaro .cookie-notice .cn-buttons {
  display: flex !important;
  gap: 0.5rem !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-items: center !important;
  margin-top: 1rem !important;
}

/* Custom layout: Privacy Policy left, then buttons */
.klaro .cookie-notice {
  padding: 1rem !important;
}

.klaro .cookie-notice .cn-buttons {
  display: grid !important;
  grid-template-columns: auto 1fr auto auto !important;
  gap: 0.5rem !important;
  align-items: center !important;
  margin-top: 1rem !important;
}

/* Position privacy policy link on the left */
.klaro .cookie-notice a {
  grid-column: 1 !important;
  justify-self: start !important;
  margin-right: auto !important;
}

/* Ensure buttons are on the right */
.klaro .cn-decline {
  grid-column: 3 !important;
}

.klaro .cn-learn-more {
  grid-column: 4 !important;
}

.klaro .cn-ok {
  grid-column: 4 !important;
}

/* Responsive design - Mobile positioning */
@media (max-width: 640px) {
  .klaro .cookie-notice {
    left: 1rem !important;
    right: 1rem !important;
    transform: none !important;
    max-width: none !important;
    bottom: 1rem !important;
  }
  
  .klaro .cookie-modal .cm-modal {
    margin: 1rem !important;
    max-width: calc(100vw - 2rem) !important;
  }
  
  .klaro .cookie-notice .cn-buttons {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
    justify-items: center !important;
  }
  
  .klaro .cookie-notice a {
    grid-column: 1 !important;
    justify-self: center !important;
    margin-bottom: 0.5rem !important;
    order: -1 !important;
  }
  
  .klaro .cn-button,
  .klaro .cn-ok,
  .klaro .cn-decline,
  .klaro .cn-learn-more {
    width: 100% !important;
    justify-content: center !important;
    grid-column: 1 !important;
  }
}

/* Ensure proper text inheritance */
.klaro * {
  font-family: var(--klaro-font-family) !important;
}

/* Override any default link styling within buttons */
.klaro .cn-button a,
.klaro .cn-ok a,
.klaro .cn-decline a,
.klaro .cn-learn-more a {
  color: inherit !important;
  text-decoration: none !important;
  font-size: inherit !important;
}

/* Fix for P and SPAN elements in Light Mode Cookie Banner */
.klaro .cookie-notice p,
.klaro .cookie-notice span {
  color: var(--klaro-text-color) !important;
  font-family: var(--klaro-font-family) !important;
}
