/**
 * Aagento Bridge Intelligence - Modern Cookie Consent System
 * Compliant with GDPR / CCPA with zero layout shift and lightweight styling.
 */

.aagento-cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  max-width: 430px;
  width: calc(100vw - 3rem);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(50, 95, 244, 0.25);
  border-radius: 18px;
  padding: 1.5rem;
  z-index: 99999;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #f1f5f9;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.aagento-cookie-banner.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.aagento-cookie-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.aagento-cookie-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(50, 95, 244, 0.25), rgba(96, 197, 120, 0.2));
  border: 1px solid rgba(50, 95, 244, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.aagento-cookie-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #ffffff;
  margin: 0;
}

.aagento-cookie-body {
  font-size: 0.86rem;
  line-height: 1.55;
  color: #94a3b8;
  margin-bottom: 1.15rem;
}

.aagento-cookie-body a {
  color: #60a5fa;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.aagento-cookie-body a:hover {
  color: #93c5fd;
}

/* Granular Toggle Section */
.aagento-cookie-preferences {
  display: none;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.15rem;
  gap: 0.75rem;
  flex-direction: column;
}

.aagento-cookie-preferences.is-open {
  display: flex;
}

.aagento-pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.aagento-pref-info {
  display: flex;
  flex-direction: column;
}

.aagento-pref-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: #f1f5f9;
}

.aagento-pref-desc {
  font-size: 0.75rem;
  color: #64748b;
}

/* Toggle Switch */
.aagento-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

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

.aagento-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #334155;
  border-radius: 24px;
  transition: 0.25s;
}

.aagento-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.25s;
}

.aagento-switch input:checked + .aagento-slider {
  background: linear-gradient(135deg, #2f55d4, #3b82f6);
}

.aagento-switch input:checked + .aagento-slider:before {
  transform: translateX(18px);
}

.aagento-switch input:disabled + .aagento-slider {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Action Buttons */
.aagento-cookie-actions {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
}

.aagento-cookie-btn {
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.aagento-cookie-btn-primary {
  background: linear-gradient(135deg, #2f55d4, #3b82f6);
  color: #ffffff;
  flex: 1 1 auto;
  box-shadow: 0 4px 14px rgba(47, 85, 212, 0.35);
}

.aagento-cookie-btn-primary:hover {
  background: linear-gradient(135deg, #243bb5, #2563eb);
  box-shadow: 0 6px 18px rgba(47, 85, 212, 0.5);
  transform: translateY(-1px);
}

.aagento-cookie-btn-outline {
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.aagento-cookie-btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.aagento-cookie-btn-text {
  background: transparent;
  color: #94a3b8;
  padding: 0.6rem 0.65rem;
  font-size: 0.8rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.aagento-cookie-btn-text:hover {
  color: #f1f5f9;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .aagento-cookie-banner {
    bottom: 0.75rem;
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    max-width: none;
    padding: 1.25rem;
  }

  .aagento-cookie-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .aagento-cookie-btn {
    width: 100%;
  }

  .aagento-cookie-btn-text {
    text-align: center;
  }
}
