/*!
 * Cookie Banner Library CSS v1.0.0
 * Responsive and accessible styles
 */

/* Font Face Declarations */
@font-face {
  font-family: 'Aeonik Pro';
  src: url('https://cookie-banner-3byfc9bjg-antonina1.vercel.app/font/aeonikpro-regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: optional;
}

@font-face {
  font-family: 'Aeonik Pro';
  src: url('https://cookie-banner-3byfc9bjg-antonina1.vercel.app/font/aeonikpro-medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: optional;
}

@font-face {
  font-family: 'Orbikular';
  src: url('https://cookie-banner-3byfc9bjg-antonina1.vercel.app/font/Orbikular-Variable-Italic-VF (1).ttf') format('truetype-variations');
  font-weight: 300 900;
  font-style: normal;
  font-variation-settings: 'wght' 400;
  font-display: swap;
  font-synthesis: none;
}

/* CSS Variables for theming */
:root {
  /* Colors */
  --cb-primary-color: #232323;
  --cb-primary-light: #F2F2ED;
  --cb-white: #ffffff;
  --cb-backdrop: rgba(0, 0, 0, 0.5);
  --cb-border-color: #e5e7eb;
  --cb-border-light: #E8E8E5;
  --cb-text-color: #232323;
  --cb-green-light: rgba(34, 197, 94, 0.1);
  --cb-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --cb-border-radius: 12px;
  --cb-border-radius-full: 9999px;
  --cb-transition: all 0.2s ease-in-out;
  
  /* Fonts */
  --cb-font-primary: 'Aeonik Pro', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --cb-font-accent: 'Orbikular', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Reset and base styles */
.cb-banner-wrapper *,
.cb-manager-wrapper * {
  box-sizing: border-box;
  font-family: var(--cb-font-primary);
}

/* ========================
   BANNER STYLES 
   ======================== */

.cb-banner-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  pointer-events: none;
}

.cb-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: transparent;
  pointer-events: none;
}

.cb-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 400px;
  max-width: calc(100vw - 48px);
  pointer-events: all;
}

.cb-banner-container {
  padding: 32px;
  border-radius: 24px;
  border: 1px solid #E8E8E5;
  background: #FFF;
  box-shadow: 0 15px 40px 0 rgba(203, 203, 203, 0.25);
}

.cb-banner-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cb-banner-text {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.cb-banner-text-content {
  flex: 1;
}

.cb-banner-text::after {
  content: '';
  width: 56px;
  height: 56px;
  background-image: url('./font/icon/cook.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.cb-banner-title {
  font-family: var(--cb-font-primary);
  font-size: 24px;
  font-weight: 500;
  color: var(--cb-text-color);
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.cb-banner-description {
  font-family: var(--cb-font-primary);
  font-size: 14px;
  font-weight: 400;
  color: #3C3C3C;
  line-height: 1.5;
  margin: 0;
}

.cb-banner-description a {
  color: var(--cb-text-color);
  text-decoration: underline;
  transition: opacity 0.2s;
}

.cb-banner-description a:hover {
  opacity: 0.8;
}

.cb-banner-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cb-banner-secondary-buttons {
  display: flex;
  flex-direction: row;
  gap: 8px;
  width: 100%;
}

/* ========================
   BUTTON STYLES 
   ======================== */

.cb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-family: var(--cb-font-primary);
  font-size: 16px;
  font-weight: 500;
  border-radius: var(--cb-border-radius-full);
  border: none;
  cursor: pointer;
  transition: var(--cb-transition);
  text-decoration: none;
  outline: none;
  min-height: 40px;
}

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

.cb-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cb-btn-accept {
  background-color: var(--cb-primary-color);
  color: var(--cb-white);
  width: 100%;
}

.cb-btn-accept:hover:not(:disabled) {
  opacity: 0.8;
}

.cb-btn-reject {
  background: #F8F8F3;
  color: var(--cb-text-color);
  border: 1px solid #E8E8E5;
  width: 46%;
}

.cb-btn-reject:hover:not(:disabled) {
  opacity: 0.8;
}

.cb-btn-manage {
  background-color: #ffffff;
  color: var(--cb-text-color);
  border: 1px solid #E8E8E5;
  flex: 1;
}

.cb-btn-manage:hover:not(:disabled) {
  opacity: 0.8;
}

.cb-btn-save {
  background-color: var(--cb-primary-color);
  color: var(--cb-white);
  width: 100%;
}

.cb-btn-save:hover:not(:disabled) {
  opacity: 0.8;
}

/* ========================
   MANAGER STYLES 
   ======================== */

.cb-manager-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
}

.cb-manager-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--cb-backdrop);
  transition: opacity 0.3s;
}

.cb-manager {
  position: relative;
  z-index: 1;
  width: 480px;
  height: 100vh;
  max-width: 90vw;
}

.cb-manager-container {
  background-color: var(--cb-white);
  border-radius: 24px 0 0 24px;
  box-shadow: var(--cb-shadow);
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 40px;
}

.cb-manager-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
}

.cb-manager-title {
  font-family: var(--cb-font-primary);
  font-size: 24px;
  font-weight: 500;
  color: var(--cb-text-color);
  margin: 0;
}

.cb-manager-close {
  background: #FFF;
  border: 1px solid #E8E8E5;
  color: var(--cb-text-color);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: var(--cb-transition);
  opacity: 0.6;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cb-manager-close:hover {
  opacity: 1;
}

.cb-manager-content {
  flex: 1;
  overflow-y: auto;
}

.cb-manager-description {
  color: var(--cb-text-color);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 16px 0;
}

.cb-manager-categories {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ========================
   CATEGORY STYLES 
   ======================== */

.cb-category {
  background-color: #FFF;
  border-top: 1px solid #E8E8E5;
  padding: 20px 0 0 0;
}

.cb-category-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

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

.cb-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cb-category-title {
  font-family: var(--cb-font-primary);
  font-size: 16px;  
  font-weight: 500;
  color: var(--cb-text-color);
  margin: 0;
}

.cb-always-active {
  background: rgba(199, 239, 255, 0.40);
  color: var(--cb-text-color);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--cb-border-radius-full);
}

.cb-category-description {
  font-size: 14px;
  color: var(--cb-text-color);
  line-height: 1.5;
  margin: 0;
}

/* ========================
   TOGGLE STYLES 
   ======================== */

.cb-toggle-container {
  flex-shrink: 0;
  margin-left: 16px;
}

.cb-toggle {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 14px;
  cursor: pointer;
  transition: var(--cb-transition);
  background-color: #CBCBCB;
}

.cb-toggle-on {
  background-color: var(--cb-primary-color);
}

.cb-toggle-disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

.cb-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  background-color: var(--cb-white);
  border-radius: 50%;
  transition: var(--cb-transition);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cb-toggle-on .cb-toggle-thumb {
  transform: translateX(20px);
}

/* ========================
   MANAGER FOOTER 
   ======================== */

.cb-manager-footer {
  background-color: #FFF;
  display: flex;
  justify-content: center;
  padding: 24px 0 0 0;
}

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

/* Small screens (phones) */
@media (max-width: 640px) {
  .cb-banner {
    bottom: 16px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
  }
  
  .cb-banner-container {
    padding: 24px;
  }
  
  .cb-banner-title {
    font-size: 20px;
  }

  .cb-banner-text::after {
    width: 48px;
    height: 48px;
  }
  
  .cb-banner-description {
    font-size: 13px;
  }
  
  .cb-banner-secondary-buttons {
    flex-direction: column;
  }
  
  .cb-btn {
    padding: 10px 20px;
    font-size: 14px;
    min-height: 36px;
  }

  .cb-btn-accept {
    width: 100%;
  }

  .cb-btn-reject,
  .cb-btn-manage {
    flex: none;
  }

  .cb-btn-reject {
    width: auto;
  }
  
  .cb-manager-wrapper {
    padding: 0;
  }

  .cb-manager {
    width: 100vw;
    max-width: none;
  }
  
  .cb-manager-container {
    padding: 20px;
  }
  
  .cb-category {
    padding: 16px 16px 0 16px;
  }
  
  .cb-category-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .cb-toggle-container {
    margin-left: 0;
    align-self: flex-end;
  }
  
  .cb-manager-actions {
    flex-direction: column;
  }
}

/* Medium screens (tablets) */
@media (min-width: 640px) {
  .cb-banner-buttons {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .cb-btn {
    flex: 0 0 auto;
  }
}

/* Large screens (desktop) */
@media (min-width: 1024px) {
  .cb-banner-container {
    padding: 32px;
  }
  
  .cb-banner-content {
    gap: 16px;
  }
  
  .cb-banner-buttons {
    flex-shrink: 0;
  }
}

/* ========================
   ACCESSIBILITY 
   ======================== */

/* Focus styles */
.cb-btn:focus-visible {
  outline: 2px solid var(--cb-primary-color);
  outline-offset: 2px;
}

.cb-toggle:focus-visible {
  outline: 2px solid var(--cb-primary-color);
  outline-offset: 2px;
}

.cb-manager-close:focus-visible {
  outline: 2px solid var(--cb-primary-color);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --cb-primary-color: #000000;
    --cb-primary-light: #f5f5f5;
    --cb-border-color: #000000;
    --cb-border-light: #000000;
  }
  
  .cb-banner {
    border-top: 2px solid var(--cb-border-color);
  }
  
  .cb-btn {
    border: 2px solid var(--cb-primary-color);
  }
  
  .cb-category {
    border: 1px solid var(--cb-border-color);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cb-btn,
  .cb-toggle,
  .cb-toggle-thumb,
  .cb-manager-backdrop,
  .cb-manager-close {
    transition: none;
  }
}

/* Print styles */
@media print {
  .cb-banner-wrapper,
  .cb-manager-wrapper {
    display: none !important;
  }
}

/* ========================
   THEME VARIATIONS 
   ======================== */

/* Dark theme */
.cb-theme-dark {
  --cb-primary-color: #ffffff;
  --cb-primary-light: #1f2937;
  --cb-white: #111827;
  --cb-text-color: #ffffff;
  --cb-border-color: #374151;
  --cb-border-light: #374151;
  --cb-green-light: rgba(34, 197, 94, 0.2);
}

/* Compact theme */
.cb-theme-compact .cb-banner-container {
  padding: 16px;
}

.cb-theme-compact .cb-banner-title {
  font-size: 18px;
  margin-bottom: 8px;
}

.cb-theme-compact .cb-banner-description {
  font-size: 12px;
}

.cb-theme-compact .cb-btn {
  padding: 12px 24px;
  font-size: 14px;
  min-height: 40px;
}