/* ==========================================================================
   NFL BITE - ADJUSTABLE AD SPACES & AD MANAGEMENT SYSTEM
   ========================================================================== */

:root {
  --ad-primary: #fb7185;
  --ad-bg-placeholder: #f8fafc;
  --ad-border-color: #e2e8f0;
  --ad-badge-bg: #ffe4e6;
  --ad-badge-text: #e11d48;
}

/* Base Ad Slot Container */
.ad-slot-wrapper {
  width: 100%;
  margin: 16px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  position: relative;
  transition: all 0.25s ease;
}

.ad-slot-wrapper.hidden {
  display: none !important;
}

/* Ad Header Label */
.ad-slot-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 5px;
  user-select: none;
}

.ad-slot-label .ad-edit-hint {
  cursor: pointer;
  color: var(--ad-primary);
  text-decoration: underline;
  margin-left: 4px;
}

/* Ad Container */
.ad-container {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  max-width: 100%;
  background: transparent;
  border-radius: 10px;
  box-sizing: border-box;
  position: relative;
}

/* Elegant Placeholder Box for Ad Placement */
.ad-placeholder-box {
  width: 100%;
  height: 100%;
  min-height: 80px;
  background: linear-gradient(135deg, #ffffff 0%, #fff1f2 100%);
  border: 1.5px dashed #fda4af;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  color: #64748b;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
  box-shadow: 0 2px 6px rgba(251, 113, 133, 0.05);
}

.ad-placeholder-box:hover {
  background: #ffe4e6;
  border-color: #fb7185;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(251, 113, 133, 0.12);
}

.ad-placeholder-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ad-placeholder-title span.badge {
  background: #fb7185;
  color: #fff;
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 800;
}

.ad-placeholder-dim {
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
  font-family: monospace;
}

.ad-placeholder-cta {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ad-primary);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

/* Floating Center Ad Overlay (Like nflwebcast.live) */
.ad-overlay-center {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 99999;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(4px);
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInOverlay 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ad-overlay-center.hidden {
  display: none !important;
}

.ad-overlay-box {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 95vw;
}

.ad-overlay-close-btn {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0f172a;
  color: #fff;
  border: 2px solid #fff;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  transition: transform 0.2s ease, background 0.2s ease;
  z-index: 100000;
}

.ad-overlay-close-btn:hover {
  background: #fb7185;
  transform: scale(1.1);
}

/* Sticky Footer Ad (Bottom Bar like nflwebcast.live) */
.ad-sticky-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99990;
  padding: 6px 12px;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease;
}

.ad-sticky-footer.hidden {
  display: none !important;
}

.ad-sticky-close {
  position: absolute;
  top: 4px;
  right: 12px;
  background: #e2e8f0;
  color: #475569;
  border-radius: 9999px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ad-sticky-close:hover {
  background: #fb7185;
  color: #fff;
}

/* In-Grid Sponsor / Ad Card */
.ad-grid-card {
  grid-column: 1 / -1;
  width: 100%;
  margin: 6px 0;
  display: flex;
  justify-content: center;
}

/* Floating Ad Settings Button (For Site Owner to Adjust Ads) */
.ad-manager-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(135deg, #fb7185, #f43f5e);
  color: #fff;
  padding: 10px 18px;
  border-radius: 9999px;
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 0.86rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(244, 63, 94, 0.35);
  cursor: pointer;
  z-index: 99995;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: none;
}

.ad-manager-fab:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 28px rgba(244, 63, 94, 0.45);
}

.ad-manager-fab svg {
  animation: spinSlow 12s linear infinite;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

/* Ad Manager Modal */
.ad-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.ad-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.ad-modal-dialog {
  background: #ffffff;
  border-radius: 20px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: scale(0.96) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.ad-modal-backdrop.active .ad-modal-dialog {
  transform: scale(1) translateY(0);
}

.ad-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ad-modal-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 1.3rem;
  font-weight: 900;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ad-modal-title span.pill {
  background: #ffe4e6;
  color: #e11d48;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 9999px;
}

.ad-modal-close {
  background: #f1f5f9;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ad-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.ad-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ad-intro-card {
  background: #fff1f2;
  border-left: 4px solid #fb7185;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.5;
}

.ad-slot-item-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
  background: #f8fafc;
  transition: border-color 0.2s ease;
}

.ad-slot-item-card:hover {
  border-color: #cbd5e1;
}

.ad-slot-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ad-slot-name {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 0.98rem;
  font-weight: 800;
  color: #0f172a;
}

.ad-slot-key {
  font-size: 0.75rem;
  color: #94a3b8;
  font-family: monospace;
}

/* Switch Toggle */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #fb7185;
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.ad-slot-controls-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}

.ad-control-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ad-control-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #475569;
}

.ad-control-input, .ad-control-select, .ad-control-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.84rem;
  font-family: var(--font-main);
  background: #ffffff;
  color: #0f172a;
  outline: none;
  transition: border-color 0.2s ease;
}

.ad-control-input:focus, .ad-control-select:focus, .ad-control-textarea:focus {
  border-color: #fb7185;
  box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.15);
}

.ad-control-textarea {
  font-family: monospace;
  font-size: 0.78rem;
  resize: vertical;
  min-height: 60px;
}

.ad-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ad-save-btn {
  background: linear-gradient(135deg, #fb7185, #f43f5e);
  color: #fff;
  padding: 10px 22px;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ad-save-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.35);
}

.ad-reset-btn {
  background: #e2e8f0;
  color: #475569;
  padding: 10px 18px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

.ad-reset-btn:hover {
  background: #cbd5e1;
  color: #0f172a;
}

/* Responsive Rules for Ads */
@media (max-width: 768px) {
  .ad-slot-controls-row {
    grid-template-columns: 1fr;
  }
  .ad-manager-fab {
    bottom: 80px;
    right: 14px;
    padding: 8px 14px;
    font-size: 0.78rem;
  }
}

