/**
 * BitQube Technologies - DPDPA 2023 Compliant Cookie Consent Styles
 * Features: Frosted Glassmorphic Banner, Granular Preferences Modal, Floating Re-consent Trigger.
 * Responsive, Dark/Light Mode compatible, and zero dark-patterns.
 */

/* 1. Floating Cookie Shield Badge (Allows Withdrawal of Consent as per DPDPA Sec 6(4)) */
.cookie-reopen-btn {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card-bg, #ffffff);
  color: var(--primary, #0b5ea8);
  border: 1px solid var(--border-color, rgba(226, 232, 240, 0.9));
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1040;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 1.15rem;
}

.cookie-reopen-btn:hover {
  transform: translateY(-3px) scale(1.08);
  color: var(--accent, #14b8a6);
  border-color: var(--accent, #14b8a6);
  box-shadow: 0 8px 25px rgba(20, 184, 166, 0.25);
}

.cookie-reopen-btn:focus-visible {
  outline: 2px solid var(--accent, #14b8a6);
  outline-offset: 3px;
}

/* 2. Slide-up Bottom Consent Banner */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--nav-bg, rgba(255, 255, 255, 0.96));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color, rgba(226, 232, 240, 0.9));
  box-shadow: 0 -10px 40px rgba(15, 23, 42, 0.12);
  padding: 1.5rem 0;
  z-index: 1050;
  transform: translateY(100%);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  pointer-events: none;
}

.cookie-consent-banner.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.cookie-banner-content {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

@media (min-width: 992px) {
  .cookie-banner-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cookie-banner-text {
  max-width: 820px;
}

.cookie-banner-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cookie-banner-desc {
  font-size: 0.88rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 0;
  line-height: 1.55;
}

.cookie-banner-desc a {
  color: var(--primary, #0b5ea8);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-banner-desc a:hover {
  color: var(--accent, #14b8a6);
}

.cookie-banner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

/* 3. Granular Preferences Modal (DPDPA Section 5 & 6 Itemized Notice) */
.cookie-modal-dialog {
  max-width: 680px;
}

.cookie-category-item {
  background: var(--bg-subtle, #f1f5f9);
  border: 1px solid var(--border-color, rgba(226, 232, 240, 0.9));
  border-radius: 14px;
  padding: 1.15rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s ease;
}

.cookie-category-item:hover {
  border-color: var(--accent, #14b8a6);
}

.cookie-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.cookie-category-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.cookie-category-desc {
  font-size: 0.84rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.cookie-sample-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cookie-sample-tags .badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.25rem 0.55rem;
}

/* Switch styling */
.form-check-input:checked {
  background-color: var(--accent, #14b8a6);
  border-color: var(--accent, #14b8a6);
}

.form-check-input:focus {
  border-color: var(--accent, #14b8a6);
  box-shadow: 0 0 0 0.25rem rgba(20, 184, 166, 0.25);
}

/* Dark mode fine-tuning */
[data-bs-theme="dark"] .cookie-consent-banner {
  background: rgba(10, 15, 29, 0.95);
  border-top-color: rgba(51, 65, 85, 0.6);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
}

[data-bs-theme="dark"] .cookie-category-item {
  background: #141e33;
  border-color: rgba(51, 65, 85, 0.5);
}
