/* DSI Cookie Consent Banner - DSI-themed Responsive Styles */

:root {
  --dsi-cookie-primary: #119fb4;
  --dsi-cookie-bg: #ffffff;
  --dsi-cookie-text: #333333;
}

/* ============================================
   BANNER BAR - Layer 1
   ============================================ */

.dsi-cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  background: var(--dsi-cookie-bg);
  color: var(--dsi-cookie-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  z-index: 9999;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  animation: dsi-cookie-slide-in 0.3s ease-out;
}

.dsi-cookie-banner.dsi-cookie-bottom {
  bottom: 0;
  animation: dsi-cookie-slide-in-bottom 0.3s ease-out;
}

.dsi-cookie-banner.dsi-cookie-top {
  top: 0;
  animation: dsi-cookie-slide-in-top 0.3s ease-out;
}

@keyframes dsi-cookie-slide-in-bottom {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes dsi-cookie-slide-in-top {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes dsi-cookie-slide-in {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.dsi-cookie-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.dsi-cookie-banner__content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.dsi-cookie-banner__icon {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--dsi-cookie-primary);
}

.dsi-cookie-banner__icon svg {
  width: 48px;
  height: 48px;
  fill: rgba(17, 159, 180, 0.12);
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dsi-cookie-banner__icon circle {
  fill: currentColor;
  stroke: none;
}

.dsi-cookie-banner__copy {
  min-width: 0;
}

.dsi-cookie-banner__title {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--dsi-cookie-text);
}

.dsi-cookie-banner__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--dsi-cookie-text);
}

.dsi-cookie-banner__link {
  color: var(--dsi-cookie-primary);
  text-decoration: none;
  font-weight: 500;
}

.dsi-cookie-banner__link:hover {
  text-decoration: underline;
}

.dsi-cookie-banner__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  white-space: nowrap;
}

/* ============================================
   BUTTONS - Common styles
   ============================================ */

.dsi-cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.dsi-cookie-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.dsi-cookie-btn:active {
  transform: translateY(0);
}

.dsi-cookie-btn:focus {
  outline: 2px solid var(--dsi-cookie-primary);
  outline-offset: 2px;
}

/* Primary button - Accept All (teal) */
.dsi-cookie-btn--primary {
  background: var(--dsi-cookie-primary);
  color: white;
}

.dsi-cookie-btn--primary:hover {
  background: #0a8399;
}

/* Secondary button - Refuse All (equal prominence) */
.dsi-cookie-btn--secondary {
  background: #e8e8e8;
  color: #333;
  border: 1px solid #ccc;
}

.dsi-cookie-btn--secondary:hover {
  background: #d8d8d8;
}

/* Outline button - Customize */
.dsi-cookie-btn--outline {
  background: transparent;
  color: var(--dsi-cookie-primary);
  border: 1px solid var(--dsi-cookie-primary);
}

.dsi-cookie-btn--outline:hover {
  background: rgba(17, 159, 180, 0.05);
}

/* ============================================
   MODAL - Layer 2
   ============================================ */

.dsi-cookie-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: dsi-cookie-fade-in 0.2s ease;
}

@keyframes dsi-cookie-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.dsi-cookie-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: -1;
}

.dsi-cookie-modal__container {
  position: relative;
  background: var(--dsi-cookie-bg);
  border-radius: 12px;
  max-width: 560px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 40px 32px 32px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: dsi-cookie-modal-slide-in 0.3s ease;
}

@keyframes dsi-cookie-modal-slide-in {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.dsi-cookie-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.dsi-cookie-modal__close:hover {
  background: #f0f0f0;
  color: #333;
}

.dsi-cookie-modal__close:focus {
  outline: 2px solid var(--dsi-cookie-primary);
}

.dsi-cookie-modal__title {
  margin: 0 0 24px 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--dsi-cookie-text);
}

.dsi-cookie-modal__content {
  margin: 0 0 24px 0;
}

.dsi-cookie-modal__footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  border-top: 1px solid #f0f0f0;
  padding-top: 24px;
}

/* ============================================
   COOKIE CATEGORIES
   ============================================ */

.dsi-cookie-category {
  margin-bottom: 20px;
  padding: 16px 0;
  border-bottom: 1px solid #f0f0f0;
}

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

.dsi-cookie-category__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.dsi-cookie-category__name {
  font-weight: 500;
  color: var(--dsi-cookie-text);
  font-size: 14px;
}

.dsi-cookie-category__description {
  margin: 0;
  font-size: 13px;
  color: #666;
  line-height: 1.5;
}

/* Locked category (necessary) */
.dsi-cookie-category--locked .dsi-cookie-toggle {
  opacity: 0.5;
  pointer-events: none;
}

/* ============================================
   TOGGLE SWITCH
   ============================================ */

.dsi-cookie-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.dsi-cookie-toggle input[type="checkbox"] {
  display: none;
}

.dsi-cookie-toggle__slider {
  display: inline-block;
  width: 44px;
  height: 24px;
  background: #ccc;
  border-radius: 12px;
  position: relative;
  transition: background 0.3s ease;
}

.dsi-cookie-toggle__slider::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: left 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dsi-cookie-toggle input[type="checkbox"]:checked + .dsi-cookie-toggle__slider {
  background: var(--dsi-cookie-primary);
}

.dsi-cookie-toggle input[type="checkbox"]:checked + .dsi-cookie-toggle__slider::after {
  left: 22px;
}

.dsi-cookie-toggle input[type="checkbox"]:focus + .dsi-cookie-toggle__slider {
  box-shadow: 0 0 0 3px rgba(17, 159, 180, 0.1);
}

/* ============================================
   BADGES
   ============================================ */

.dsi-cookie-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.dsi-cookie-badge--always-on {
  background: #d4edda;
  color: #155724;
}

/* ============================================
   FLOATING ACTION BUTTON
   ============================================ */

.dsi-cookie-fab {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--dsi-cookie-primary);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  transition: all 0.2s ease;
  animation: dsi-cookie-fab-pop 0.4s ease;
}

@keyframes dsi-cookie-fab-pop {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.dsi-cookie-fab:hover {
  background: #0a8399;
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.dsi-cookie-fab:active {
  transform: scale(0.95);
}

.dsi-cookie-fab:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}

.dsi-cookie-fab__icon {
  width: 24px;
  height: 24px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  .dsi-cookie-banner__inner {
    flex-direction: column;
    padding: 16px;
  }

  .dsi-cookie-banner__actions {
    width: 100%;
    flex-direction: column;
    justify-content: stretch;
  }

  .dsi-cookie-banner__content {
    width: 100%;
    align-items: flex-start;
  }

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

  .dsi-cookie-modal__container {
    width: 95%;
    max-height: 90vh;
    padding: 32px 20px 20px;
  }

  .dsi-cookie-fab {
    bottom: 16px;
    left: 16px;
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 480px) {
  .dsi-cookie-banner {
    font-size: 13px;
  }

  .dsi-cookie-banner__title {
    font-size: 14px;
  }

  .dsi-cookie-banner__text {
    font-size: 13px;
  }

  .dsi-cookie-banner__content {
    gap: 12px;
  }

  .dsi-cookie-banner__icon {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
  }

  .dsi-cookie-banner__icon svg {
    width: 40px;
    height: 40px;
  }

  .dsi-cookie-btn {
    padding: 8px 16px;
    font-size: 13px;
  }

  .dsi-cookie-modal__title {
    font-size: 18px;
  }
}

/* ============================================
   ANIMATIONS & TRANSITIONS
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .dsi-cookie-banner,
  .dsi-cookie-banner.dsi-cookie-bottom,
  .dsi-cookie-banner.dsi-cookie-top,
  .dsi-cookie-btn,
  .dsi-cookie-modal,
  .dsi-cookie-modal__container,
  .dsi-cookie-fab,
  .dsi-cookie-toggle__slider,
  .dsi-cookie-toggle__slider::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ============================================
   ACCESSIBILITY - High Contrast Mode
   ============================================ */

@media (prefers-contrast: more) {
  .dsi-cookie-btn--secondary {
    border: 2px solid #333;
  }

  .dsi-cookie-toggle__slider {
    border: 1px solid #333;
  }
}
