/* ------------------------------
   Modal backdrop
------------------------------ */
#cookieConsentModal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  padding: 16px;
}

#cookieConsentModal.show {
  display: flex;
  opacity: 1;
}

/* ------------------------------
   Modal box
------------------------------ */
#cookieConsentModal > div {
  width: 100%;
  max-width: 600px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#cookieConsentModal.show > div {
  transform: scale(1);
  opacity: 1;
}

/* ------------------------------
   Header
------------------------------ */
.header {
  background: #f3f3f3;
  padding: 16px;
  text-align: center;
  border-bottom: 1px solid #ddd;
}

.header .title {
  font-weight: bold;
  font-size: 18px;
}

.header .subtitle {
  font-size: 12px;
  color: #555;
  margin-top: 4px;
}

/* ------------------------------
   Tabs
------------------------------ */
.tab-buttons {
  display: flex;
  text-align: center;
  flex-wrap: wrap;
}

.tab-btn {
  flex: 1;
  padding: 10px 0;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  cursor: pointer;
  font-size: 14px;
  transition: color 0.2s, border-color 0.2s;
  min-width: 80px;
}

.tab-btn.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.tab-content {
  display: none;
  margin-top: 12px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-content.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ------------------------------
   Modal content scroll
------------------------------ */
.modal-content {
  max-height: 40vh;
  overflow-y: auto;
  padding: 16px;
  transition: max-height 0.3s ease;
}

/* ------------------------------
   Category Switches
------------------------------ */
.category-switches {
  padding: 16px;
  border-top: 1px solid #ddd;
}

.switch-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  transition: transform 0.2s ease;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0;
  right: 0; bottom: 0;
  background-color: #ccc;
  border-radius: 24px;
  transition: background-color 0.3s ease;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  top: 2px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

input:checked + .slider {
  background-color: #2563eb;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.switch.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ------------------------------
   Footer buttons
------------------------------ */
.modal-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid #ddd;
}

.modal-footer button {
  flex: 1;
  padding: 10px;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

#denyAll {
  border: 2px solid #dc2626;
  color: #dc2626;
  background: transparent;
}

#denyAll:hover {
  background: #fee2e2;
}

#allowSelected {
  border: 2px solid #2563eb;
  color: #2563eb;
  background: transparent;
}

#allowSelected:hover {
  background: #dbeafe;
}

#allowAll {
  background: #2563eb;
  color: #fff;
  border: 2px solid #2563eb;
}

#allowAll:hover {
  background: #1e40af;
}

/* ------------------------------
   Responsive adjustments
------------------------------ */
@media (max-width: 480px) {
  .modal-footer {
    flex-direction: column;
  }

  .switch-row span {
    margin-bottom: 4px;
  }

  .modal-content {
    max-height: 35vh;
    padding: 12px;
  }

  .tab-btn {
    font-size: 12px;
    padding: 8px 0;
  }
}
