/* 
  Silktide Consent Manager - https://silktide.com/consent-manager/  
*/

/* --------------------------------
  Global Styles
-------------------------------- */
#silktide-wrapper {
  --focus: 0 0 0 2px #ffffff, 0 0 0 4px #000000, 0 0 0 6px #ffffff;
  --fontFamily: Helvetica Neue, Segoe UI, Arial, sans-serif;
  --primaryColor: #69a51b;
  --textColor: #333333;
  --backgroundColor: #FFFFFF;
  --backdropBackgroundColor: #00000066;
  
  position: fixed;
  bottom: 0; right: 0; width: 100%; height: 100%;
  z-index: 99999;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

#silktide-wrapper a {
  color: var(--primaryColor);
  text-decoration: underline;
  cursor: pointer;
}
#silktide-wrapper a:hover { color: var(--textColor); }

#silktide-wrapper a:focus,
#silktide-wrapper button:focus {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 5px;
}

/* --------------------------------
  Buttons
-------------------------------- */
#silktide-wrapper .st-button {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  border: none;
  transition: opacity 0.2s;
}
#silktide-wrapper .st-button--primary { background-color: var(--primaryColor); color: #fff; }
#silktide-wrapper .st-button--primary:hover { opacity: 0.9; }
#silktide-wrapper .st-button--secondary { background-color: #f0f0f0; color: #333; }
#silktide-wrapper .st-button--secondary:hover { background-color: #e0e0e0; }

/* --------------------------------
  Banner
-------------------------------- */
#silktide-banner {
  font-family: var(--fontFamily);
  color: var(--textColor);
  background-color: var(--backgroundColor);
  box-sizing: border-box;
  padding: 32px;
  border-radius: 12px;
  pointer-events: auto;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  max-width: calc(100% - 32px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  animation: silktide-fadeIn 350ms ease-out forwards;
  z-index: 2;
}
#silktide-banner h2 { font-size: 22px; font-weight: 700; margin: 0 0 16px; }
#silktide-banner p { font-size: 15px; line-height: 1.6; margin: 0 0 24px; }
#silktide-banner .actions { display: flex; gap: 12px; flex-wrap: wrap; }
#silktide-banner .actions button { font-size: 15px; padding: 12px 24px; }
#silktide-banner .preferences { margin-left: auto; background: transparent; border: 1px solid #ccc; }

/* --------------------------------
  Modal
-------------------------------- */
#silktide-modal {
  display: none;
  pointer-events: auto;
  overflow-y: auto;
  width: 650px;
  max-width: 95%;
  max-height: 90vh;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  font-family: var(--fontFamily);
  color: var(--textColor);
  background-color: var(--backgroundColor);
  border-radius: 8px;
  flex-direction: column;
  z-index: 2;
}

#silktide-modal header { padding: 20px 24px; border-bottom: 1px solid #eee; }
#silktide-modal h1 { font-size: 18px; font-weight: 700; margin: 0; }
#silktide-modal > p { padding: 20px 24px; font-size: 14px; line-height: 1.5; color: #666; margin: 0; }
#silktide-modal section { padding: 0 24px 20px; }
#silktide-modal footer { padding: 20px 24px; border-top: 1px solid #eee; display: flex; justify-content: flex-end; }

/* Cookie Category & Rows */
#silktide-modal .cookie-category { border: 1px solid #eee; border-radius: 6px; overflow: hidden; margin-bottom: 8px;}

#silktide-modal .cookie-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #f8f9fa;
  padding: 12px 16px;
  cursor: pointer;
}
#silktide-modal .cookie-info { display: flex; align-items: center; gap: 10px; }
#silktide-modal .cookie-name { font-weight: 500; font-size: 14px; }
#silktide-modal .cookie-controls { display: flex; align-items: center; gap: 12px; }
#silktide-modal .status-text { font-size: 12px; color: #666; }
#silktide-modal .status-text.status-enabled { color: var(--textColor); font-weight: 500; }
#silktide-modal .chevron {
  font-weight: bold; font-size: 18px;
  transition: transform 0.2s ease-in-out;
}
#silktide-modal .chevron.expanded { transform: rotate(90deg); }


/* Cookie Details (Expanded View) */
.cookie-details { padding: 16px; background-color: #fff; }
.cookie-description { font-size: 13px; line-height: 1.6; color: #555; margin: 0 0 16px; }
.cookie-table { font-size: 12px; }
.cookie-table > div { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 10px; padding: 8px 0; }
.cookie-table .cookie-table-header { font-weight: 600; border-bottom: 1px solid #ddd; }
.cookie-table .cookie-table-row { border-bottom: 1px solid #eee; }
.cookie-table .cookie-table-row:last-child { border-bottom: none; }


/* Switch Toggle */
#silktide-modal .switch { position: relative; display: inline-block; height: 24px; width: 44px; cursor: pointer; }
#silktide-modal .switch input { opacity: 0; width: 0; height: 0; }
#silktide-modal .switch__pill {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc; transition: .4s; border-radius: 24px;
}
#silktide-modal .switch__dot {
  position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background-color: white; transition: .4s; border-radius: 50%;
}
#silktide-modal .switch input:checked + .switch__pill { background-color: var(--primaryColor); }
#silktide-modal .switch input:checked ~ .switch__dot { transform: translateX(20px); }
#silktide-modal .switch input:disabled + .switch__pill { background-color: #e0e0e0; opacity: 0.7; }
#silktide-modal .switch input:disabled ~ .switch__dot { background-color: #f0f0f0; }

/* Cookie Icon */
#silktide-cookie-icon {
  display: none; position: fixed; bottom: 10px; left: 10px;
  justify-content: center; align-items: center;
  width: 50px; height: 50px; border-radius: 50%; border: none;
  background-color: var(--primaryColor); cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  pointer-events: auto;
  animation: silktide-fadeIn 0.3s ease-in-out forwards;
}
#silktide-cookie-icon svg { width: 24px; height: 24px; }

/* Backdrop */
#silktide-backdrop {
  display: none; position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: var(--backdropBackgroundColor);
  backdrop-filter: blur(2px);
  pointer-events: none;
  z-index: 1;
}

/* Banner */
#silktide-banner {
  font-family: var(--fontFamily);
  color: var(--textColor);
  background-color: var(--backgroundColor);
  box-sizing: border-box;
  padding: 32px;
  border-radius: 12px;
  pointer-events: auto;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  max-width: calc(100% - 32px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  animation: silktide-fadeIn 350ms ease-out forwards;
  z-index: 2;
}

/* Language Switcher */
.language-switcher { position: absolute; top: 16px; right: 16px; display: flex; gap: 8px; z-index: 10; }
.lang-btn {
  background: transparent;
  border: 2px solid transparent;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0.6;
}
.lang-btn:hover { opacity: 1; transform: scale(1.1); }
.lang-btn.active { opacity: 1; border-color: var(--primaryColor); background: rgba(105, 165, 27, 0.1); }

/* Animations */
@keyframes silktide-fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes silktide-slideInDown { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }