/* Cookie Consent Banner and Modal Styles */

/* Base container for variables */
.rexo-cookie-wrapper {
  --rc-bg-light: rgba(255, 255, 255, 0.9);
  --rc-bg-dark: rgba(15, 18, 22, 0.95);
  --rc-text-light: #444444;
  --rc-text-dark: #c8c8c8;
  --rc-title-light: #1e1e1e;
  --rc-title-dark: #ffffff;
  --rc-border-light: rgba(0, 0, 0, 0.08);
  --rc-border-dark: rgba(255, 255, 255, 0.08);
  --rc-shadow-light: 0 15px 35px rgba(0, 0, 0, 0.1);
  --rc-shadow-dark: 0 20px 50px rgba(0, 0, 0, 0.4);
  --rc-primary: #1a5f7a; /* RexoERP Blue Theme color */
  --rc-primary-hover: #124b61;
  --rc-secondary-light: #f1f3f5;
  --rc-secondary-hover-light: #e9ecef;
  --rc-secondary-dark: #2a2e33;
  --rc-secondary-hover-dark: #343a40;
}

/* Banner Styling */
.rexo-cookie-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: calc(100% - 48px);
  max-width: 540px;
  background: var(--rc-bg-light);
  border: 1px solid var(--rc-border-light);
  border-radius: 16px;
  box-shadow: var(--rc-shadow-light);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 16px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

body.dark .rexo-cookie-banner {
  background: var(--rc-bg-dark);
  border-color: var(--rc-border-dark);
  box-shadow: var(--rc-shadow-dark);
}

.rexo-cookie-banner.show {
  opacity: 1;
  transform: translateY(0);
}

/* Close Button (X) */
.rexo-cookie-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--rc-text-light);
  opacity: 0.6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  z-index: 10;
}

body.dark .rexo-cookie-close {
  color: var(--rc-text-dark);
}

.rexo-cookie-close:hover {
  opacity: 1;
  background: var(--rc-secondary-light);
}

body.dark .rexo-cookie-close:hover {
  background: var(--rc-secondary-dark);
}

/* Banner Text */
.rexo-cookie-text {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--rc-text-light);
  margin-top: 10px;
  padding-right: 16px;
}

body.dark .rexo-cookie-text {
  color: var(--rc-text-dark);
}

/* Banner Actions Container */
.rexo-cookie-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

/* General Button Styles */
.rexo-cookie-btn {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  text-align: center;
  padding: 12.5px 24px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  outline: none;
  width: 100%;
  display: inline-block;
  text-decoration: none;
}

/* Accept All (Primary) */
.rexo-cookie-btn-primary {
  background: var(--rc-primary);
  color: #ffffff !important;
}

.rexo-cookie-btn-primary:hover {
  background: var(--rc-primary-hover);
  transform: translateY(-1.5px);
}

/* Reject All (Secondary) */
.rexo-cookie-btn-secondary {
  background: var(--rc-secondary-light);
  color: var(--rc-title-light) !important;
}

body.dark .rexo-cookie-btn-secondary {
  background: var(--rc-secondary-dark);
  color: var(--rc-text-dark) !important;
}

.rexo-cookie-btn-secondary:hover {
  background: var(--rc-secondary-hover-light);
  transform: translateY(-1.5px);
}

body.dark .rexo-cookie-btn-secondary:hover {
  background: var(--rc-secondary-hover-dark);
}

/* Settings Button (Outline/Link Style) */
.rexo-cookie-btn-link {
  background: transparent;
  color: var(--rc-primary) !important;
  border: 1px solid var(--rc-primary);
  padding: 11.5px 24px;
}

.rexo-cookie-btn-link:hover {
  background: rgba(26, 95, 122, 0.05);
  transform: translateY(-1.5px);
}

body.dark .rexo-cookie-btn-link:hover {
  background: rgba(26, 95, 122, 0.15);
}

/* Modal Overlay Styling */
.rexo-cookie-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.rexo-cookie-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* Modal Window */
.rexo-cookie-modal {
  background: var(--rc-bg-light);
  border: 1px solid var(--rc-border-light);
  border-radius: 20px;
  box-shadow: var(--rc-shadow-light);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  max-width: 600px;
  width: 100%;
  padding: 32px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

body.dark .rexo-cookie-modal {
  background: var(--rc-bg-dark);
  border-color: var(--rc-border-dark);
  box-shadow: var(--rc-shadow-dark);
}

.rexo-cookie-overlay.show .rexo-cookie-modal {
  transform: scale(1);
}

/* Modal Header */
.rexo-cookie-modal-header {
  padding-right: 32px;
}

.rexo-cookie-modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--rc-title-light);
  margin: 0 0 8px 0;
}

body.dark .rexo-cookie-modal-title {
  color: var(--rc-title-dark);
}

.rexo-cookie-modal-desc {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--rc-text-light);
  margin: 0;
}

body.dark .rexo-cookie-modal-desc {
  color: var(--rc-text-dark);
}

/* Modal Scrollable Content: Preferences List */
.rexo-cookie-preferences {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Single Preference Card */
.rexo-cookie-pref-item {
  border-bottom: 1px solid var(--rc-border-light);
  padding-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

body.dark .rexo-cookie-pref-item {
  border-color: var(--rc-border-dark);
}

.rexo-cookie-pref-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.rexo-cookie-pref-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.rexo-cookie-pref-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rexo-cookie-pref-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--rc-title-light);
  margin: 0;
}

body.dark .rexo-cookie-pref-title {
  color: var(--rc-title-dark);
}

/* Custom Badges (e.g., Always Active) */
.rexo-cookie-badge {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rexo-cookie-pref-desc {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.45;
  color: var(--rc-text-light);
  margin: 0;
}

body.dark .rexo-cookie-pref-desc {
  color: var(--rc-text-dark);
}

/* Toggle Switch Styling */
.rexo-cookie-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.rexo-cookie-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.rexo-cookie-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 34px;
}

body.dark .rexo-cookie-slider {
  background-color: #475569;
}

.rexo-cookie-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.rexo-cookie-switch input:checked + .rexo-cookie-slider {
  background-color: var(--rc-primary);
}

.rexo-cookie-switch input:focus + .rexo-cookie-slider {
  box-shadow: 0 0 1px var(--rc-primary);
}

.rexo-cookie-switch input:checked + .rexo-cookie-slider:before {
  transform: translateX(22px);
}

/* Disabled Switch appearance */
.rexo-cookie-switch input:disabled + .rexo-cookie-slider {
  background-color: #94a3b8;
  opacity: 0.65;
  cursor: not-allowed;
}

body.dark .rexo-cookie-switch input:disabled + .rexo-cookie-slider {
  background-color: #334155;
}

/* Modal Actions Footer styling */
.rexo-cookie-modal-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

@media (min-width: 576px) {
  .rexo-cookie-banner {
    padding: 28px;
  }
  .rexo-cookie-actions {
    flex-direction: row;
    justify-content: flex-end;
  }
  .rexo-cookie-actions .rexo-cookie-btn {
    width: auto;
    flex: 1;
  }
  .rexo-cookie-actions .rexo-cookie-btn-link {
    flex: none;
  }

  .rexo-cookie-modal-footer {
    flex-direction: row;
    justify-content: flex-end;
  }
  .rexo-cookie-modal-footer .rexo-cookie-btn {
    width: auto;
    flex: 1;
  }
}
