/* Klaro Cookie Consent Custom Styles for Journala */

/* Override Klaro's default variables to match Journala's design */
.klaro {
  --primary-color: #16A34A; /* Journala's primary green */
  --primary-hover: #15803D;
  --secondary-color: #F3F4F6; /* Light grey */
  --text-color: #111827; /* Dark grey text */
  --border-radius: 0.75rem; /* 12px rounded corners */
  --font-family: 'Public Sans Variable', ui-sans-serif, system-ui, sans-serif;
}

/* Notice banner styling */
.klaro .cookie-notice {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  font-family: var(--font-family);
  max-width: 420px;
  bottom: 1rem;
  right: 1rem;
  left: auto;
  position: fixed;
}

.klaro .cookie-notice .cn-body {
  padding: 1.5rem;
}

.klaro .cookie-notice .cn-body p {
  color: var(--text-color);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0 0 1rem 0;
}

.klaro .cookie-notice .cn-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Button styling */
.klaro .cn-ok,
.klaro .cn-decline,
.klaro .cn-learn-more,
.klaro .cm-btn {
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Accept button - White background, no border */
.klaro .cn-ok {
  background-color: white;
  color: var(--text-color);
  border: none;
}

.klaro .cn-ok:hover {
  background-color: #F9FAFB;
}

/* Accept All button - Green background */
.klaro .cn-accept-all,
.klaro .cookie-notice .cn-buttons .cn-ok {
  background-color: var(--primary-color) !important;
  color: white !important;
  border-color: var(--primary-color) !important;
  border: 1px solid var(--primary-color) !important;
}

.klaro .cn-accept-all:hover,
.klaro .cookie-notice .cn-buttons .cn-ok:hover {
  background-color: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
}

/* Modal save button - Keep green */
.klaro .cm-save,
.klaro .cm-btn.cm-btn-success,
.klaro .cookie-modal .cm-btn.cm-btn-success {
  background-color: var(--primary-color) !important;
  color: white !important;
  border-color: var(--primary-color) !important;
}

.klaro .cm-save:hover,
.klaro .cm-btn.cm-btn-success:hover,
.klaro .cookie-modal .cm-btn.cm-btn-success:hover {
  background-color: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
  color: white !important;
}

/* Secondary button (Learn more/Settings) */
.klaro .cn-learn-more,
.klaro .cm-btn {
  background-color: white;
  color: var(--text-color);
  border-color: #D1D5DB;
}

.klaro .cn-learn-more:hover,
.klaro .cm-btn:hover {
  background-color: #F9FAFB;
  border-color: #9CA3AF;
}

/* Decline button */
.klaro .cn-decline {
  background-color: white;
  color: #6B7280;
  border-color: #E5E7EB;
}

.klaro .cn-decline:hover {
  background-color: #F3F4F6;
  color: #374151;
}

/* Modal styling */
.klaro .cookie-modal {
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.klaro .cookie-modal .cm-modal {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  font-family: var(--font-family);
}

.klaro .cookie-modal .cm-header {
  padding: 1.5rem 1.5rem 0;
  border-bottom: none;
}

.klaro .cookie-modal .cm-header h1 {
  color: var(--text-color);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.klaro .cookie-modal .cm-body {
  padding: 1.5rem;
}

.klaro .cookie-modal .cm-footer {
  padding: 0 1.5rem 1.5rem;
  border-top: 1px solid #E5E7EB;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Service list styling */
.klaro .cm-services {
  margin: 1rem 0;
}

.klaro .cm-service {
  border: 1px solid #E5E7EB;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 1rem;
}

.klaro .cm-service .cm-service-title {
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.klaro .cm-service .cm-service-description {
  color: #6B7280;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

/* Toggle switch styling */
.klaro .cm-list-input {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.klaro .cm-list-input input {
  opacity: 0;
  width: 0;
  height: 0;
}

.klaro .cm-list-input .cm-toggle {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #D1D5DB;
  transition: 0.2s;
  border-radius: 24px;
}

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

.klaro .cm-list-input input:checked + .cm-toggle {
  background-color: var(--primary-color);
}

.klaro .cm-list-input input:checked + .cm-toggle:before {
  transform: translateX(20px);
}

/* Close button */
.klaro .cm-modal .cm-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6B7280;
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
}

.klaro .cm-modal .cm-close:hover {
  background-color: #F3F4F6;
  color: var(--text-color);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .klaro .cookie-notice {
    bottom: 0;
    left: 0;
    right: 0;
    max-width: none;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    border-bottom: none;
  }
  
  .klaro .cookie-modal .cm-modal {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
  }
  
  .klaro .cookie-notice .cn-buttons {
    flex-direction: column;
  }
  
  .klaro .cn-ok,
  .klaro .cn-decline,
  .klaro .cn-learn-more {
    width: 100%;
    justify-content: center;
  }
}

/* Purpose badges */
.klaro .cm-purposes {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.klaro .cm-purpose {
  background-color: #F3F4F6;
  color: #374151;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 500;
}

/* Hide Klaro branding if disabled in config */
.klaro .cm-powered-by {
  display: none;
}