.ccb-banner {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 2147483647 !important;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
  color: #1f2937;
  font-family: inherit;
  direction: rtl;
  will-change: transform;
}

.ccb-hidden {
  display: none !important;
}

.ccb-banner:not(.ccb-hidden) {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}

.ccb-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.ccb-banner-text {
  flex: 1 1 200px;
  min-width: 0;
  margin-inline-end: 8px;
}

.ccb-banner-title {
  font-weight: 600;
  margin-bottom: 2px;
  font-size: 0.9rem;
}

.ccb-banner-desc {
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.4;
}

.ccb-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}

.ccb-btn {
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 0.8rem;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
}

.ccb-btn:active {
  transform: scale(0.98);
}

.ccb-btn-primary {
  background: #10b981;
  color: #ffffff;
  border-color: #059669;
}

.ccb-btn-primary:hover {
  background: #059669;
}

.ccb-btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border-color: #d1d5db;
}

.ccb-btn-secondary:hover {
  background: #e5e7eb;
}

.ccb-btn-outline {
  background: transparent;
  color: #4b5563;
  border-color: #9ca3af;
}

.ccb-btn-outline:hover {
  background: rgba(0, 0, 0, 0.05);
}

.ccb-banner-close {
  background: transparent;
  border: none;
  color: #6b7280;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  margin-inline-start: 8px;
  line-height: 1;
  transition: color 0.15s;
  flex-shrink: 0;
}

.ccb-banner-close:hover {
  color: #1f2937;
}

/* Modal */
.ccb-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  direction: rtl;
}

.ccb-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
}

.ccb-modal-dialog {
  position: relative;
  max-width: 640px;
  width: 100%;
  margin: 16px;
  background: #020617;
  color: #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ccb-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.ccb-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.ccb-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 1.4rem;
  cursor: pointer;
}

.ccb-modal-close:hover {
  color: #e5e7eb;
}

.ccb-modal-body {
  padding: 16px 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.ccb-modal-intro {
  font-size: 0.9rem;
  color: #cbd5f5;
  margin-bottom: 12px;
}

.ccb-category {
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.ccb-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ccb-category-title {
  font-weight: 600;
}

.ccb-category-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.15);
  color: #bbf7d0;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.ccb-category-desc {
  margin-top: 6px;
  font-size: 0.8rem;
  color: #9ca3af;
}

.ccb-modal-footer {
  padding: 12px 20px 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.4);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Switch */
.ccb-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

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

.ccb-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #4b5563;
  border-radius: 999px;
  transition: 0.2s;
}

.ccb-switch-slider::before {
  position: absolute;
  content: '';
  height: 18px;
  width: 18px;
  inset-block-start: 2px;
  inset-inline-start: 2px;
  background-color: white;
  border-radius: 999px;
  transition: 0.2s;
}

.ccb-switch input:checked + .ccb-switch-slider {
  background-color: #22c55e;
}

.ccb-switch input:checked + .ccb-switch-slider::before {
  inset-inline-start: 20px;
}

/* YouTube placeholder */
.ccb-yt-placeholder {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  overflow: hidden;
  border-radius: 12px;
  background: #020617;
}

.ccb-yt-placeholder img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
}

.ccb-yt-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 12px;
  gap: 8px;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.5));
  text-align: center;
}

.ccb-yt-text {
  color: #e5e7eb;
  font-size: 0.9rem;
  max-width: 280px;
}

.ccb-yt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

@media (max-width: 640px) {
  .ccb-banner {
    right: 0;
    left: 0;
    padding: 6px 8px;
  }

  .ccb-banner-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }

  .ccb-banner-text {
    flex: 0 0 auto;
    margin-inline-end: 0;
    padding-inline-start: 20px;
    position: relative;
  }

  .ccb-banner-title {
    font-size: 0.75rem;
    margin-bottom: 2px;
    line-height: 1.3;
  }

  .ccb-banner-desc {
    font-size: 0.7rem;
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .ccb-banner-actions {
    flex-direction: row;
    gap: 6px;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    width: 100%;
  }

  .ccb-banner-actions .ccb-btn {
    padding: 4px 8px;
    font-size: 0.7rem;
    white-space: nowrap;
    text-align: center;
    line-height: 1.3;
    flex: 0 0 auto;
  }

  .ccb-banner-close {
    position: absolute;
    top: 3px;
    left: 8px;
    margin: 0;
    padding: 2px 5px;
    font-size: 1rem;
    line-height: 1;
  }
}

@media (max-width: 480px) {
  .ccb-banner {
    right: 0;
    left: 0;
    padding: 5px 6px;
  }

  .ccb-banner-inner {
    gap: 4px;
  }

  .ccb-banner-text {
    padding-inline-start: 18px;
  }

  .ccb-banner-title {
    font-size: 0.7rem;
    margin-bottom: 1px;
  }

  .ccb-banner-desc {
    font-size: 0.65rem;
    -webkit-line-clamp: 2;
  }

  .ccb-banner-actions {
    gap: 5px;
    flex-wrap: nowrap;
    width: 100%;
  }

  .ccb-banner-actions .ccb-btn {
    padding: 3px 6px;
    font-size: 0.65rem;
    flex: 0 0 auto;
  }

  .ccb-banner-close {
    top: 3px;
    left: 6px;
    font-size: 0.9rem;
  }
}
