/**
 * TAMX Persistent Announcement Styles (PHASE_AC_2026_05_29)
 * --------------------------------------------------------
 * - Front Modal Card (Overlay) — يظهر عند الدخول
 * - Top Sticky Banner — يظهر بكل الصفحات
 *
 * RTL friendly, dark theme matching tamx-forex aesthetics
 */

/* ============ Top Sticky Banner ============ */
#tamx-ann-banner-root {
  position: sticky;
  top: 0;
  z-index: 1050;
  width: 100%;
}

.tamx-ann-banner {
  background: linear-gradient(90deg, #7c2d12 0%, #b45309 50%, #7c2d12 100%);
  background-size: 200% 100%;
  animation: tamxAnnGradient 8s ease-in-out infinite;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  font-family: inherit;
  direction: rtl;
}

@keyframes tamxAnnGradient {
  0%, 100% { background-position: 0% 0%; }
  50%       { background-position: 100% 0%; }
}

.tamx-ann-banner__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 16px;
  flex-wrap: nowrap;
}

.tamx-ann-banner__icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  animation: tamxAnnPulse 2.4s ease-in-out infinite;
}

@keyframes tamxAnnPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,255,255,0.3); }
  50%       { transform: scale(1.06); box-shadow: 0 0 0 8px rgba(255,255,255,0); }
}

.tamx-ann-banner__text {
  flex: 1 1 auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
  line-height: 1.4;
}

.tamx-ann-banner__title {
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.tamx-ann-banner__sep {
  opacity: 0.55;
  flex-shrink: 0;
}

.tamx-ann-banner__msg {
  opacity: 0.95;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tamx-ann-banner__more {
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
  margin-right: 4px;
}

.tamx-ann-banner__cta {
  flex: 0 0 auto;
  background: #fff;
  color: #7c2d12;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tamx-ann-banner__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tamx-ann-banner__expand,
.tamx-ann-banner__close {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.tamx-ann-banner__expand:hover,
.tamx-ann-banner__close:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: scale(1.05);
}

/* Mobile compaction */
@media (max-width: 640px) {
  .tamx-ann-banner__inner { padding: 8px 12px; gap: 8px; }
  .tamx-ann-banner__icon { width: 30px; height: 30px; font-size: 13px; }
  .tamx-ann-banner__text { font-size: 12.5px; }
  .tamx-ann-banner__title { font-size: 12.5px; }
  .tamx-ann-banner__cta { padding: 5px 10px; font-size: 12px; }
  .tamx-ann-banner__expand,
  .tamx-ann-banner__close { width: 28px; height: 28px; font-size: 11px; }
  /* على الجوال نخفي النص الطويل ونخلي العنوان فقط */
  .tamx-ann-banner__sep,
  .tamx-ann-banner__msg { display: none; }
}

/* ============ Front Modal Card ============ */
body.tamx-ann-modal-open {
  overflow: hidden;
}

.tamx-ann-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.25s ease;
  direction: rtl;
}
.tamx-ann-modal.is-open {
  opacity: 1;
}

.tamx-ann-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.tamx-ann-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  background: linear-gradient(180deg, #0f172a 0%, #070b1a 100%);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 18px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  font-family: inherit;
  color: #fff;
}
.tamx-ann-modal.is-open .tamx-ann-modal__dialog {
  transform: translateY(0) scale(1);
}

/* Hero */
.tamx-ann-modal__hero {
  position: relative;
  min-height: 140px;
  padding: 24px 22px 22px;
  background-size: cover;
  background-position: center;
}

.tamx-ann-modal__hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
}
.tamx-ann-modal__hero-badge i {
  font-size: 11px;
  animation: tamxAnnBadgeShake 3.5s ease-in-out infinite;
}

@keyframes tamxAnnBadgeShake {
  0%, 92%, 100% { transform: rotate(0); }
  94%            { transform: rotate(-12deg); }
  96%            { transform: rotate(12deg); }
  98%            { transform: rotate(-6deg); }
}

.tamx-ann-modal__title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.35;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Body */
.tamx-ann-modal__body {
  padding: 18px 22px 12px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.tamx-ann-modal__msg {
  margin: 0 0 14px 0;
  font-size: 15px;
  line-height: 1.75;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.tamx-ann-modal__cta-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #D4AF37;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 14px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 10px;
  background: rgba(212, 175, 55, 0.08);
  transition: background 0.15s ease, transform 0.15s ease;
}
.tamx-ann-modal__cta-link:hover {
  background: rgba(212, 175, 55, 0.18);
  transform: translateY(-1px);
}

/* Actions */
.tamx-ann-modal__actions {
  padding: 14px 22px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: stretch;
}

.tamx-ann-modal__ack-btn {
  flex: 1;
  background: linear-gradient(135deg, #D4AF37 0%, #b8881f 100%);
  color: #0b0f1c;
  border: none;
  padding: 13px 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.15s ease;
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.28);
  letter-spacing: 0.2px;
}
.tamx-ann-modal__ack-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 10px 26px rgba(212, 175, 55, 0.36);
}
.tamx-ann-modal__ack-btn:active {
  transform: translateY(0);
}

/* Mobile */
@media (max-width: 640px) {
  .tamx-ann-modal { padding: 12px; }
  .tamx-ann-modal__dialog { border-radius: 14px; }
  .tamx-ann-modal__hero { padding: 18px 16px 16px; min-height: 120px; }
  .tamx-ann-modal__title { font-size: 17px; }
  .tamx-ann-modal__body { padding: 14px 16px 8px; }
  .tamx-ann-modal__msg { font-size: 14px; }
  .tamx-ann-modal__actions { padding: 12px 16px 16px; }
  .tamx-ann-modal__ack-btn { padding: 12px 18px; font-size: 14px; }
}
