/**
 * EASPC Theme Variables
 */
:root {
  --eafc-black: #000000;
  --eafc-near-black: #0a0a0a;
  --eafc-dark-grey: #1a1a1a;
  --eafc-mid-grey: #2a2a2a;
  --eafc-light-grey: #3a3a3a;
  --eafc-border-grey: #2d2d2d;
  --eafc-text-white: #ffffff;
  --eafc-text-grey: #cccccc;
  --eafc-text-muted: #999999;
  --eafc-accent: #f0f0f0;
  --eafc-success: #00ff88;
  --eafc-error: #ff4444;

  /* TOTY Theme Colors */
  --toty-navy: #1E3A8A;
  --toty-gold: #FFD700;
  --toty-blue: #3B5FCF;

  /* Flash Sale Theme Colors */
  --flash-orange: #FF6B35;
  --flash-red: #DC2626;
  --flash-yellow: #FFD700;
  --flash-dark: #1A1A1A;
}
body:not([data-theme="light"]) {
  --bg: var(--eafc-near-black);
  --card: var(--eafc-dark-grey);
  --card-bg: var(--eafc-dark-grey);
  --text-primary: var(--eafc-text-white);
  --text-secondary: var(--eafc-text-grey);
  --border-color: var(--eafc-border-grey);
  --primary: var(--eafc-text-white);
  --primary-600: var(--eafc-light-grey);
  --primary-color: var(--eafc-text-white);
  --success-color: var(--eafc-success);
  --error-color: var(--eafc-error);
  --text: var(--eafc-text-white);
  --muted: var(--eafc-text-muted);
  --border: var(--eafc-border-grey);
  --accent: var(--eafc-accent);
}

/* CHRISTMAS THEME FOR CHAT - ULTRA HIGH SPECIFICITY */
/* Customer messages - Festive red bubble with white text */
body #chat-widget #chat-panel #chat-messages .chat-message.customer-message .message-content,
body #chat-widget #chat-messages .chat-message.customer-message .message-content,
body #chat-panel #chat-messages .chat-message.customer-message .message-content,
#chat-widget #chat-panel #chat-messages .chat-message.customer-message .message-content,
#chat-widget #chat-messages .chat-message.customer-message .message-content,
#chat-panel #chat-messages .chat-message.customer-message .message-content,
#chat-messages .chat-message.customer-message .message-content,
.chat-panel .chat-message.customer-message .message-content,
.chat-widget .chat-message.customer-message .message-content,
div.chat-message.customer-message div.message-content,
.chat-message.customer-message .message-content {
  background: #c41e3a !important; /* Christmas red */
  background-color: #c41e3a !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-weight: 500 !important;
  border-radius: 12px !important;
  padding: 12px 16px !important;
  box-shadow: 0 2px 8px rgba(196, 30, 58, 0.3) !important;
}

/* Admin messages - Christmas green */
body #chat-widget #chat-panel #chat-messages .chat-message.admin-message .message-content,
body #chat-widget #chat-messages .chat-message.admin-message .message-content,
body #chat-panel #chat-messages .chat-message.admin-message .message-content,
#chat-widget #chat-panel #chat-messages .chat-message.admin-message .message-content,
#chat-widget #chat-messages .chat-message.admin-message .message-content,
#chat-panel #chat-messages .chat-message.admin-message .message-content,
#chat-messages .chat-message.admin-message .message-content,
.chat-panel .chat-message.admin-message .message-content,
.chat-widget .chat-message.admin-message .message-content,
div.chat-message.admin-message div.message-content,
.chat-message.admin-message .message-content {
  background: #165b33 !important; /* Christmas green */
  background-color: #165b33 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-weight: 500 !important;
  border-radius: 12px !important;
  padding: 12px 16px !important;
  box-shadow: 0 2px 8px rgba(22, 91, 51, 0.3) !important;
}

/* Bot message override */
#chat-messages .chat-message.bot-message .message-content,
.chat-message.bot-message .message-content {
  background: #165b33 !important; /* Christmas green */
  background-color: #165b33 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Chat header - Festive styling */
.chat-header {
  background: linear-gradient(135deg, #c41e3a 0%, #165b33 100%) !important;
  color: #ffffff !important;
}

.chat-header h3 {
  color: #ffffff !important;
}

/* ========================================
   TOTY THEME STYLES
   ======================================== */

/* TOTY THEME FOR CHAT - ULTRA HIGH SPECIFICITY - Only when theme enabled */
/* Customer messages - TOTY blue bubble with white text */
body.toty-theme-enabled #chat-widget #chat-panel #chat-messages .chat-message.customer-message .message-content,
body.toty-theme-enabled #chat-widget #chat-messages .chat-message.customer-message .message-content,
body.toty-theme-enabled #chat-panel #chat-messages .chat-message.customer-message .message-content,
body.toty-theme-enabled .chat-message.customer-message .message-content {
  background: #3B5FCF !important; /* TOTY blue */
  background-color: #3B5FCF !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-weight: 500 !important;
  border-radius: 12px !important;
  padding: 12px 16px !important;
  box-shadow: 0 2px 8px rgba(59, 95, 207, 0.3) !important;
}

/* Admin messages - TOTY navy */
body.toty-theme-enabled #chat-widget #chat-panel #chat-messages .chat-message.admin-message .message-content,
body.toty-theme-enabled #chat-widget #chat-messages .chat-message.admin-message .message-content,
body.toty-theme-enabled #chat-panel #chat-messages .chat-message.admin-message .message-content,
body.toty-theme-enabled .chat-message.admin-message .message-content {
  background: #1E3A8A !important; /* TOTY navy */
  background-color: #1E3A8A !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-weight: 500 !important;
  border-radius: 12px !important;
  padding: 12px 16px !important;
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.3) !important;
}

/* Bot message override */
body.toty-theme-enabled #chat-messages .chat-message.bot-message .message-content,
body.toty-theme-enabled .chat-message.bot-message .message-content {
  background: #1E3A8A !important; /* TOTY navy */
  background-color: #1E3A8A !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Chat header - TOTY styling */
body.toty-theme-enabled .chat-header {
  background: linear-gradient(135deg, #1E3A8A 0%, #3B5FCF 100%) !important;
  color: #ffffff !important;
}

body.toty-theme-enabled .chat-header h3 {
  color: #ffffff !important;
}

/* Chat send button - TOTY blue */
body.toty-theme-enabled #chat-widget .chat-send-btn,
body.toty-theme-enabled .chat-widget .chat-send-btn,
body.toty-theme-enabled .chat-panel .chat-send-btn,
body.toty-theme-enabled #chat-panel .chat-send-btn,
body.toty-theme-enabled button.chat-send-btn {
  background: #3B5FCF !important;
  background-color: #3B5FCF !important;
  color: #ffffff !important;
}

body.toty-theme-enabled #chat-widget .chat-send-btn:hover,
body.toty-theme-enabled .chat-widget .chat-send-btn:hover,
body.toty-theme-enabled .chat-panel .chat-send-btn:hover,
body.toty-theme-enabled #chat-panel .chat-send-btn:hover,
body.toty-theme-enabled button.chat-send-btn:hover {
  background: #2d4db5 !important;
  background-color: #2d4db5 !important;
  opacity: 1 !important;
}

/* TOTY Promo Badge */
.toty-promo-badge {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
  animation: toty-badge-pulse 2s ease-in-out infinite;
}

.toty-badge-content {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--toty-navy) 0%, var(--toty-blue) 100%);
  padding: 15px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(30, 58, 138, 0.4);
  border: 2px solid var(--toty-gold);
  cursor: pointer;
  transition: all 0.3s ease;
}

.toty-badge-content:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(30, 58, 138, 0.6), 0 0 20px rgba(255, 215, 0, 0.3);
}

.toty-badge-icon {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  animation: toty-trophy-spin 3s ease-in-out infinite;
}

.toty-badge-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toty-badge-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--toty-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toty-badge-discount {
  font-size: 20px;
  font-weight: 800;
  color: var(--eafc-text-white);
  line-height: 1;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.toty-badge-code {
  font-size: 11px;
  color: var(--toty-gold);
  font-weight: 600;
  font-family: monospace;
  letter-spacing: 0.5px;
}

.toty-badge-ends {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

@keyframes toty-badge-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes toty-trophy-spin {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-10deg);
  }
  75% {
    transform: rotate(10deg);
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .toty-promo-badge {
    bottom: 10px;
    left: 10px;
  }

  .toty-badge-content {
    padding: 12px 16px;
    gap: 10px;
  }

  .toty-badge-icon {
    font-size: 28px;
  }

  .toty-badge-title {
    font-size: 12px;
  }

  .toty-badge-discount {
    font-size: 18px;
  }

  .toty-badge-code {
    font-size: 10px;
  }

  .toty-badge-ends {
    font-size: 9px;
  }
}

/* Hide TOTY elements when theme is disabled */
body:not(.toty-theme-enabled) .toty-promo-badge {
  display: none !important;
}

/* TOTY Apply Coupon Button - Only when theme is enabled */
body.toty-theme-enabled #apply-coupon {
  background: linear-gradient(135deg, var(--toty-navy) 0%, var(--toty-blue) 100%) !important;
  border: 2px solid var(--toty-gold) !important;
  color: var(--eafc-text-white) !important;
  font-weight: 600 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
  transition: all 0.3s ease !important;
}

body.toty-theme-enabled #apply-coupon:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(30, 58, 138, 0.5), 0 0 12px rgba(255, 215, 0, 0.2) !important;
  border-color: var(--toty-gold) !important;
}

/* ========================================
   FLASH SALE PROMO BADGE
   ======================================== */

.flash-sale-promo-badge {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
  animation: flash-badge-pulse 1.5s ease-in-out infinite;
}

.flash-badge-content {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--flash-red) 0%, var(--flash-orange) 100%);
  padding: 15px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.5), 0 0 20px rgba(255, 107, 53, 0.3);
  border: 2px solid var(--flash-yellow);
  cursor: pointer;
  transition: all 0.3s ease;
}

.flash-badge-content:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(220, 38, 38, 0.7), 0 0 30px rgba(255, 215, 0, 0.5);
  border-color: var(--flash-yellow);
}

.flash-badge-icon {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  animation: flash-bolt-spin 2s ease-in-out infinite;
}

.flash-badge-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.flash-badge-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--flash-yellow);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  animation: flash-text-shimmer 2s ease-in-out infinite;
}

.flash-badge-discount {
  font-size: 20px;
  font-weight: 800;
  color: var(--eafc-text-white);
  line-height: 1;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.flash-badge-code {
  font-size: 11px;
  color: var(--flash-yellow);
  font-weight: 600;
  font-family: monospace;
  letter-spacing: 0.5px;
}

.flash-badge-ends {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

@keyframes flash-badge-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

@keyframes flash-bolt-spin {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(-15deg) scale(1.1);
  }
  50% {
    transform: rotate(0deg) scale(1.2);
  }
  75% {
    transform: rotate(15deg) scale(1.1);
  }
}

@keyframes flash-text-shimmer {
  0%, 100% {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 0 8px rgba(255, 215, 0, 0.3);
  }
  50% {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 0 15px rgba(255, 215, 0, 0.6);
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .flash-sale-promo-badge {
    bottom: 10px;
    left: 10px;
  }

  .flash-badge-content {
    padding: 12px 16px;
    gap: 10px;
  }

  .flash-badge-icon {
    font-size: 28px;
  }

  .flash-badge-title {
    font-size: 12px;
  }

  .flash-badge-discount {
    font-size: 18px;
  }

  .flash-badge-code {
    font-size: 10px;
  }

  .flash-badge-ends {
    font-size: 9px;
  }
}

/* Hide Flash Sale elements when theme is disabled */
body:not(.flash-sale-theme-enabled) .flash-sale-promo-badge {
  display: none !important;
}

/* Flash Sale Apply Coupon Button - Only when theme is enabled */
body.flash-sale-theme-enabled #apply-coupon {
  background: linear-gradient(135deg, var(--flash-red) 0%, var(--flash-orange) 100%) !important;
  border: 2px solid var(--flash-yellow) !important;
  color: var(--eafc-text-white) !important;
  font-weight: 600 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
  transition: all 0.3s ease !important;
}

body.flash-sale-theme-enabled #apply-coupon:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.6), 0 0 15px rgba(255, 215, 0, 0.3) !important;
  border-color: var(--flash-yellow) !important;
}

/* ========================================
   FLASH SALE LIGHTNING STRIKE EFFECT
   ======================================== */

.flash-lightning-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.1s ease-out;
}

.flash-lightning-overlay.active {
  opacity: 1;
}

.flash-lightning-bolt {
  position: absolute;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom,
    transparent 0%,
    rgba(255, 255, 255, 0.8) 20%,
    rgba(255, 255, 255, 1) 30%,
    rgba(255, 255, 255, 0.9) 40%,
    rgba(255, 255, 255, 0.7) 50%,
    rgba(255, 255, 255, 0.9) 60%,
    rgba(255, 255, 255, 1) 70%,
    rgba(255, 255, 255, 0.8) 80%,
    transparent 100%
  );
  box-shadow: 
    0 0 20px rgba(255, 255, 255, 0.8),
    0 0 40px rgba(255, 215, 0, 0.6),
    0 0 60px rgba(255, 107, 53, 0.4),
    -2px 0 10px rgba(255, 255, 255, 0.5),
    2px 0 10px rgba(255, 255, 255, 0.5);
  left: 50%;
  transform: translateX(-50%);
  animation: lightning-strike 0.3s ease-out;
  filter: blur(1px);
}

.flash-lightning-bolt::before,
.flash-lightning-bolt::after {
  content: '';
  position: absolute;
  width: 3px;
  height: 40%;
  background: linear-gradient(to bottom,
    transparent 0%,
    rgba(255, 255, 255, 0.9) 30%,
    rgba(255, 255, 255, 1) 50%,
    rgba(255, 255, 255, 0.8) 70%,
    transparent 100%
  );
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.7);
  filter: blur(0.5px);
}

.flash-lightning-bolt::before {
  left: -30px;
  top: 20%;
  transform: rotate(-15deg);
}

.flash-lightning-bolt::after {
  right: -30px;
  top: 40%;
  transform: rotate(15deg);
}

.flash-screen-flash {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  animation: screen-flash 0.2s ease-out;
}

@keyframes lightning-strike {
  0% {
    opacity: 0;
    transform: translateX(-50%) scaleY(0);
  }
  10% {
    opacity: 1;
    transform: translateX(-50%) scaleY(0.1);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scaleY(1);
  }
  90% {
    opacity: 0.8;
    transform: translateX(-50%) scaleY(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) scaleY(1);
  }
}

@keyframes screen-flash {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 0.4;
  }
  40% {
    opacity: 0.2;
  }
  100% {
    opacity: 0;
  }
}

/* Hide lightning effect when theme is disabled */
body:not(.flash-sale-theme-enabled) .flash-lightning-overlay {
  display: none !important;
}
