/**
 * Cookie Consent Banner Styles
 * 
 * Vanilla CSS (no frameworks) for the cookie consent banner
 * WCAG 2.1 AA compliant with proper contrast ratios and focus indicators
 * 
 * @version 1.0.0
 * @author Citi Entertainment Development Team
 */

/* ============================================
   Banner Container
   ============================================ */

.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #ffffff;
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.15);
  padding: 0;
  z-index: 9999;
  animation: slideUp 0.5s ease-out forwards;
  font-family: 'Citi Sans', Arial, sans-serif;
  border-top: 3px solid #056dae; /* Citi blue accent */
}

.cookie-consent-banner.hidden {
  animation: slideDown 0.5s ease-out forwards;
  pointer-events: none;
}

.cookie-consent-banner__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

/* ============================================
   Content Section
   ============================================ */

.cookie-consent-banner__content {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex: 1;
}

.cookie-consent-banner__icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
}

.cookie-consent-banner__text {
  flex: 1;
}

.cookie-consent-banner__title {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 700;
  color: #003a5d; /* Dark Citi blue */
  line-height: 1.3;
}

.cookie-consent-banner__message {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #333333;
}

/* ============================================
   Actions Section
   ============================================ */

.cookie-consent-banner__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

.cookie-consent-banner__buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cookie-consent-banner__button {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Citi Sans', Arial, sans-serif;
  white-space: nowrap;
}

/* Accept Button - Primary */
.cookie-consent-banner__button--accept {
  background-color: #056dae; /* Citi blue */
  color: #ffffff;
}

.cookie-consent-banner__button--accept:hover {
  background-color: #044d7c; /* Darker blue on hover */
}

.cookie-consent-banner__button--accept:focus {
  outline: 3px solid #fdb71a; /* Citi gold for focus */
  outline-offset: 2px;
}

.cookie-consent-banner__button--accept:active {
  background-color: #033859; /* Even darker blue on click */
  transform: translateY(1px);
}

/* Customize Button - Tertiary (Equal Prominence) */
.cookie-consent-banner__button--customize {
  background-color: #ffffff;
  color: #056dae;
  border: 2px solid #056dae;
}

.cookie-consent-banner__button--customize:hover {
  background-color: #f0f7fb; /* Light blue tint on hover */
  border-color: #044d7c;
  color: #044d7c;
}

.cookie-consent-banner__button--customize:focus {
  outline: 3px solid #fdb71a; /* Citi gold for focus */
  outline-offset: 2px;
}

.cookie-consent-banner__button--customize:active {
  background-color: #e0f0f9;
  transform: translateY(1px);
}

/* Reject Button - Secondary */
.cookie-consent-banner__button--reject {
  background-color: #f5f5f5;
  color: #333333;
  border: 2px solid #cccccc;
}

.cookie-consent-banner__button--reject:hover {
  background-color: #e0e0e0;
  border-color: #999999;
}

.cookie-consent-banner__button--reject:focus {
  outline: 3px solid #fdb71a; /* Citi gold for focus */
  outline-offset: 2px;
  border-color: #056dae;
}

.cookie-consent-banner__button--reject:active {
  background-color: #d0d0d0;
  transform: translateY(1px);
}

/* Learn More Link */
.cookie-consent-banner__learn-more {
  text-align: right;
}

.cookie-consent-banner__link {
  font-size: 13px;
  color: #056dae;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.cookie-consent-banner__link:hover {
  color: #044d7c;
}

.cookie-consent-banner__link:focus {
  outline: 3px solid #fdb71a;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ============================================
   Animations
   ============================================ */

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(100%);
    opacity: 0;
  }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .cookie-consent-banner {
    animation: none;
  }
  
  .cookie-consent-banner.hidden {
    animation: none;
    display: none;
  }
  
  .cookie-consent-banner__button {
    transition: none;
  }
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet */
@media (max-width: 870px) {
  .cookie-consent-banner__container {
    padding: 20px 24px;
    gap: 24px;
  }
  
  .cookie-consent-banner__title {
    font-size: 18px;
  }
  
  .cookie-consent-banner__message {
    font-size: 13px;
  }
}

/* Mobile */
@media (max-width: 750px) {
  .cookie-consent-banner__container {
    flex-direction: column;
    align-items: stretch;
    padding: 16px 20px;
    gap: 20px;
  }
  
  .cookie-consent-banner__content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }
  
  .cookie-consent-banner__icon {
    font-size: 36px;
  }
  
  .cookie-consent-banner__title {
    font-size: 18px;
  }
  
  .cookie-consent-banner__message {
    font-size: 14px;
  }
  
  .cookie-consent-banner__actions {
    align-items: stretch;
    width: 100%;
  }
  
  .cookie-consent-banner__buttons {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  
  .cookie-consent-banner__button {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
  }
  
  .cookie-consent-banner__learn-more {
    text-align: center;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .cookie-consent-banner__container {
    padding: 12px 16px;
  }
  
  .cookie-consent-banner__title {
    font-size: 16px;
  }
  
  .cookie-consent-banner__message {
    font-size: 13px;
  }
  
  .cookie-consent-banner__button {
    padding: 12px 16px;
    font-size: 14px;
  }
}

/* ============================================
   High Contrast Mode Support
   ============================================ */

@media (prefers-contrast: high) {
  .cookie-consent-banner {
    border-top-width: 5px;
  }
  
  .cookie-consent-banner__button--accept {
    border: 2px solid #ffffff;
  }
  
  .cookie-consent-banner__button--reject {
    border-width: 3px;
  }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  .cookie-consent-banner,
  .cookie-settings-modal {
    display: none !important;
  }
}

/* ============================================
   Cookie Settings Modal
   ============================================ */

.cookie-settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}

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

/* Modal Overlay */
.cookie-settings-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  cursor: pointer;
}

/* Modal Container */
.cookie-settings-modal__container {
  position: relative;
  background-color: #ffffff;
  border-radius: 8px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideInUp 0.3s ease-out;
}

/* Modal Header */
.cookie-settings-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid #e0e0e0;
}

.cookie-settings-modal__title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #003a5d;
  font-family: 'Citi Sans', Arial, sans-serif;
}

.cookie-settings-modal__close {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #666666;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.cookie-settings-modal__close:hover {
  background-color: #f5f5f5;
  color: #333333;
}

.cookie-settings-modal__close:focus {
  outline: 3px solid #fdb71a;
  outline-offset: 2px;
}

/* Modal Description */
.cookie-settings-modal__description {
  padding: 20px 32px;
  background-color: #f9f9f9;
  border-bottom: 1px solid #e0e0e0;
}

.cookie-settings-modal__description p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #333333;
}

.cookie-settings-modal__description p + p {
  margin-top: 12px;
}

/* Privacy Policy Link */
.cookie-settings-modal__privacy-link {
  font-size: 14px;
}

.cookie-settings-modal__privacy-link a {
  color: #056dae;
  text-decoration: underline;
  font-weight: 500;
}

.cookie-settings-modal__privacy-link a:hover {
  color: #003a5d;
}

.cookie-settings-modal__privacy-link a:focus {
  outline: 2px solid #0056b3;
  outline-offset: 2px;
}

/* Important Notice */
.cookie-settings-modal__notice {
  margin: 0 32px 24px 32px;
  padding: 16px 20px;
  background-color: #f5f5f5;
  border-radius: 8px;
  border: 1px solid #d0d0d0;
}

.cookie-settings-modal__notice p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #333333;
}

.cookie-settings-modal__notice p + p {
  margin-top: 8px;
}

.cookie-settings-modal__notice strong {
  font-weight: 600;
  color: #003a5d;
}

/* Modal Body - wraps description + content + notice */
.cookie-settings-modal__body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Modal Content */
.cookie-settings-modal__content {
  flex: 1;
  padding: 24px 32px;
}

/* Cookie Category */
.cookie-category {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e0e0e0;
}

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

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

.cookie-category__title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.cookie-category__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #003a5d;
}

.cookie-category__badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cookie-category__badge--required {
  background-color: #e8f4f8;
  color: #056dae;
}

.cookie-category__body {
  margin-top: 12px;
}

.cookie-category__description {
  margin: 0 0 16px 0;
  font-size: 14px;
  line-height: 1.6;
  color: #666666;
}

/* Cookie Category Details (Collapsible) */
.cookie-category__details {
  margin-top: 12px;
  border-left: 3px solid #e0e0e0;
  padding-left: 16px;
}

.cookie-category__details-summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #056dae;
  padding: 8px 0;
  user-select: none;
}

.cookie-category__details-summary:hover {
  text-decoration: underline;
}

.cookie-category__details-summary:focus {
  outline: 2px solid #fdb71a;
  outline-offset: 2px;
  border-radius: 2px;
}

.cookie-category__list {
  margin: 12px 0 0 0;
  padding-left: 20px;
  list-style: disc;
}

.cookie-category__list-item {
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: #666666;
}

.cookie-category__list-item strong {
  color: #333333;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

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

.toggle-switch__slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cccccc;
  transition: 0.3s;
  border-radius: 28px;
}

.toggle-switch__slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-switch__slider {
  background-color: #056dae;
}

.toggle-switch input:checked + .toggle-switch__slider:before {
  transform: translateX(24px);
}

.toggle-switch input:focus + .toggle-switch__slider {
  box-shadow: 0 0 0 3px #fdb71a;
}

.toggle-switch input:disabled + .toggle-switch__slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Locked Toggle (Essential cookies) */
.toggle-switch--locked {
  opacity: 0.7;
  cursor: not-allowed;
}

.toggle-switch--locked input:checked + .toggle-switch__slider {
  background-color: #999999;
}

/* Modal Footer */
.cookie-settings-modal__footer {
  padding: 20px 32px;
  border-top: 1px solid #e0e0e0;
  background-color: #f9f9f9;
}

.cookie-settings-modal__actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.cookie-settings-modal__button {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Citi Sans', Arial, sans-serif;
  white-space: nowrap;
}

/* Primary Button (Save) */
.cookie-settings-modal__button--primary {
  background-color: #056dae;
  color: #ffffff;
}

.cookie-settings-modal__button--primary:hover {
  background-color: #044d7c;
}

.cookie-settings-modal__button--primary:focus {
  outline: 3px solid #fdb71a;
  outline-offset: 2px;
}

.cookie-settings-modal__button--primary:active {
  background-color: #033859;
  transform: translateY(1px);
}

/* Secondary Button (Reject All) */
.cookie-settings-modal__button--secondary {
  background-color: #f5f5f5;
  color: #333333;
  border: 2px solid #cccccc;
}

.cookie-settings-modal__button--secondary:hover {
  background-color: #e0e0e0;
  border-color: #999999;
}

.cookie-settings-modal__button--secondary:focus {
  outline: 3px solid #fdb71a;
  outline-offset: 2px;
}

/* Tertiary Button (Accept All) */
.cookie-settings-modal__button--tertiary {
  background-color: #ffffff;
  color: #056dae;
  border: 2px solid #056dae;
}

.cookie-settings-modal__button--tertiary:hover {
  background-color: #f0f7fb;
  border-color: #044d7c;
}

.cookie-settings-modal__button--tertiary:focus {
  outline: 3px solid #fdb71a;
  outline-offset: 2px;
}

/* ============================================
   Modal Animations
   ============================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ============================================
   Footer Privacy Controls
   ============================================ */

.footer-privacy-controls {
  text-align: right;
  padding: 16px 0;
  margin-top: 12px;
  border-top: 1px solid #e0e0e0;
}

.footer-privacy-controls a {
  color: #056dae;
  text-decoration: underline;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.footer-privacy-controls a:hover {
  color: #003a5d;
  text-decoration: underline;
}

.footer-privacy-controls a:focus {
  outline: 2px solid #0056b3;
  outline-offset: 2px;
}

/* ============================================
   Modal Responsive Design
   ============================================ */

@media (max-width: 768px) {
  .cookie-settings-modal {
    padding: 0;
  }
  
  .cookie-settings-modal__container {
    max-height: 100vh;
    border-radius: 0;
    height: 100%;
  }

  .cookie-settings-modal__header {
    padding: 10px 20px;
  }

  .cookie-settings-modal__description,
  .cookie-settings-modal__content,
  .cookie-settings-modal__footer {
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .cookie-settings-modal__notice {
    margin-left: 20px;
    margin-right: 20px;
    padding: 12px 16px;
  }
  
  .cookie-category__header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .cookie-settings-modal__actions {
    flex-direction: column;
  }
  
  .cookie-settings-modal__button {
    width: 100%;
  }
  
  .footer-privacy-controls {
    text-align: center;
    padding: 12px 0;
  }
  
  .footer-privacy-controls a {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .cookie-settings-modal__title {
    font-size: 20px;
  }
  
  .cookie-category__title {
    font-size: 16px;
  }
}
