/**
 * Silktide Cookie Consent Manager
 * CSS styles
 */

#silktide-wrapper {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #333;
  box-sizing: border-box;
}

#silktide-wrapper *,
#silktide-wrapper *::before,
#silktide-wrapper *::after {
  box-sizing: inherit;
}

/* Backdrop */
#silktide-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999998;
  display: none;
}

/* Banner */
#silktide-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #fff;
  color: #333;
  padding: 1rem;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 8px 8px 0 0;
}

@media (min-width: 768px) {
  #silktide-banner {
    max-width: 750px;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 1rem;
    border-radius: 8px;
  }
}

#silktide-banner p {
  margin: 0 0 1rem 0;
}

#silktide-banner a {
  color: #0066cc;
  text-decoration: underline;
}

#silktide-banner .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: center;
}


#silktide-banner .st-button {
  border: none;
  background-color: #0066cc;
  color: white;
  font-weight: bold;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s;
}

#silktide-banner .st-button:hover {
  background-color: #004d99;
}

#silktide-banner .preferences {
  background: none;
  border: none;
  color: #0066cc;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

#silktide-banner .preferences:hover {
  color: #004d99;
}


/* Cookie Icon */
#silktide-cookie-icon {
  position: fixed;
  bottom: 20px;
  border: none;
  background-color: #0066cc;
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 999997;
  transition: background-color 0.2s;
}

#silktide-cookie-icon:hover {
  background-color: #004d99;
}

#silktide-cookie-icon svg {
  width: 24px;
  height: 24px;
  fill: white;
}

#silktide-cookie-icon.bottomLeft {
  left: 20px;
}

#silktide-cookie-icon.bottomRight {
  right: 20px;
}

/* Modal */
#silktide-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  color: #333;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  z-index: 999999;
  display: none;
  flex-direction: column;
  width: 95%;
  max-width: 600px;
  max-height: 80vh;
  border-radius: 8px;
  overflow-y: auto;
}

#silktide-modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  position: sticky;
  top: 0;
  background-color: #fff;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eee;
}

#silktide-modal header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: bold;
}

#silktide-modal .modal-close {
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 30px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#silktide-modal .modal-close svg {
  width: 16px;
  height: 16px;
  fill: #666;
}

#silktide-modal .modal-close:hover svg {
  fill: #333;
}

#silktide-modal p {
  margin: 0 0 1rem 0;
}

#silktide-modal a {
  color: #0066cc;
  text-decoration: underline;
}

#silktide-modal footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
  position: sticky;
  bottom: 0;
  background-color: #fff;
}

#silktide-modal .st-button {
  border: none;
  background-color: #0066cc;
  color: white;
  font-weight: bold;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s;
}

#silktide-modal .st-button:hover {
  background-color: #004d99;
}

/* Cookie Types */
#cookie-preferences {
  margin: 1rem 0;
}

#cookie-preferences fieldset {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
}

#cookie-preferences legend {
  font-weight: bold;
  padding: 0 0.5rem;
}

.cookie-type-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.cookie-type-description {
  flex: 1;
}

.cookie-type-description p {
  margin: 0;
}

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

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

.switch__pill {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}

.switch__dot {
  position: absolute;
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.switch__off, .switch__on {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  transition: .4s;
}

.switch__off {
  right: 8px;
  color: white;
  opacity: 1;
}

.switch__on {
  left: 8px;
  color: white;
  opacity: 0;
}

input:checked + .switch__pill {
  background-color: #0066cc;
}

input:checked + .switch__pill + .switch__dot {
  transform: translateX(30px);
}

input:checked ~ .switch__off {
  opacity: 0;
}

input:checked ~ .switch__on {
  opacity: 1;
}

input:disabled + .switch__pill {
  opacity: 0.6;
  cursor: not-allowed;
}
