/* ===== Cookie Consent Banner (365Trac) =====
   Styled to match the 365Trac theme: red primary (#DF0000),
   teal accent (#2280a8), Inter font, pill-shaped buttons. */

.cookie-overlay {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.cookie-overlay.hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.cookie-banner {
  background: #ffffff;
  border-top: 3px solid #DF0000;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
  padding: 24px 32px;
  max-width: 900px;
  margin: 0 auto;
  border-radius: 16px 16px 0 0;
}

.cookie-banner h3 {
  margin: 0 0 8px 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}

.cookie-banner p {
  margin: 0 0 20px 0;
  font-size: 0.9rem;
  color: #333333;
  line-height: 1.6;
}

.cookie-banner a {
  color: #2280a8;
  text-decoration: underline;
}

/* Button row */
.cookie-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.cookie-btn {
  padding: 12px 28px;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  line-height: 1;
}

.cookie-btn:active { transform: scale(0.98); }

.cookie-btn-accept {
  background: #DF0000;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.cookie-btn-accept:hover {
  box-shadow: 0 4px 12px rgba(223, 0, 0, 0.28);
  transform: translateY(-1px);
}

.cookie-btn-reject {
  background: #f3f4f6;
  color: #1a1a1a;
}
.cookie-btn-reject:hover {
  background: #e5e7eb;
}

.cookie-btn-manage {
  background: transparent;
  color: #2280a8;
  border: 1px solid #2280a8;
}
.cookie-btn-manage:hover {
  background: #2280a8;
  color: #fff;
}

/* Preferences panel */
.cookie-preferences {
  display: none;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.cookie-preferences.open {
  display: block;
}

.cookie-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid #f0f2f5;
}

.cookie-category:last-child {
  border-bottom: none;
}

.cookie-category-info {
  flex: 1;
}

.cookie-category-info h4 {
  margin: 0 0 4px 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a1a;
}

.cookie-category-info p {
  margin: 0;
  font-size: 0.8rem;
  color: #666666;
}

/* Toggle switch */
.cookie-toggle {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
  margin-left: 16px;
}

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

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

.cookie-toggle .slider:before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}

.cookie-toggle input:checked + .slider {
  background: #DF0000;
}

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

.cookie-toggle input:disabled + .slider {
  background: #DF0000;
  opacity: 0.5;
  cursor: not-allowed;
}

.cookie-toggle input:disabled + .slider:before {
  transform: translateX(22px);
}

/* Save preferences button */
.cookie-btn-save {
  margin-top: 16px;
  background: #DF0000;
  color: #fff;
  padding: 12px 28px;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.cookie-btn-save:hover {
  box-shadow: 0 4px 12px rgba(223, 0, 0, 0.28);
  transform: translateY(-1px);
}

.cookie-btn-save:active { transform: scale(0.98); }

/* Small cookie icon button (shows after banner dismissed) */
.cookie-settings-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 99998;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #DF0000;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(223, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.cookie-settings-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(223, 0, 0, 0.4);
}

.cookie-settings-btn.hidden {
  display: none;
}

/* Responsive */
@media (max-width: 600px) {
  .cookie-banner {
    padding: 20px 16px;
    border-radius: 12px 12px 0 0;
  }
  .cookie-buttons {
    flex-direction: column;
  }
  .cookie-btn {
    width: 100%;
    text-align: center;
  }
}
