/* ==========================================================================
   Stardust Casino Promotions Stylesheet
   Modern, Mobile-First, Responsive & Performant CSS
   ========================================================================== */

:root {
  /* Colors from original Stardust brand palette */
  --color-bg: #1b0221;
  --color-card-bg: #720672;
  --color-card-border: #990099;
  --color-primary: #0099ff;
  --color-primary-hover: #37afff;
  --color-secondary: #990099;
  --color-secondary-hover: #b300b3;
  --color-text: #ffffff;
  --color-text-muted: rgba(255, 255, 255, 0.7);
  --color-footer-bg: #0d0111;
  --color-footer-border: rgba(255, 255, 255, 0.08);
  --color-tertiary: #5660FF;

  /* Gradients */
  --gradient-header: linear-gradient(90deg, #22032a 0%, #490e58 100%);

  /* Typography */
  --font-primary: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-secondary: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Layout */
  --header-height: 60px;
  --max-content-width: 1400px;
  --card-width: 300px;
  --transition-speed: 0.2s;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-pill: 50px;
}

/* CSS Reset & Global Rules */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  width: 100%;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  width: 100%;
  overflow-x: hidden;
  font-family: var(--font-primary);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ==========================================================================
   Header & Category Bar (Sticky Header Wrapper)
   ========================================================================== */

.sticky-header-container {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.site-header {
  position: relative;
  width: 100%;
  background: var(--gradient-header);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  height: var(--header-height);
}

.header-container {
  width: 100%;
  max-width: var(--max-content-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.site-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity var(--transition-speed) ease;
}

.site-logo:hover {
  opacity: 0.85;
}

.site-logo img {
  height: 30px;
  width: auto;
  max-width: 90px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-actions .btn {
  width: 88px;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  padding: 0;
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
}

/* Button Base Component */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-primary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  transition: background-color var(--transition-speed) ease,
              border-color var(--transition-speed) ease,
              color var(--transition-speed) ease,
              transform var(--transition-speed) ease;
  user-select: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-outline {
  color: #ffffff;
  border: 2px solid #ffffff;
  background-color: transparent;
}

.btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.btn-solid {
  color: #ffffff;
  background-color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-solid:hover {
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

/* ==========================================================================
   Category Bar (Promotions subheader)
   ========================================================================== */

.categorybar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 0.75rem 0;
  background: var(--color-bg);
  width: 100%;
}

.categorybar__container {
  width: 100%;
  max-width: calc(var(--card-width) + 32px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 0 16px;
}

.categorybar-close {
  margin-right: 1rem;
  background-color: transparent;
  border: 2.6px solid #ffffff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  color: #ffffff;
  transition: opacity var(--transition-speed) ease;
}

.categorybar-close:hover {
  opacity: 0.8;
}

.categorybar__category {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-btn {
  min-width: 5rem;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font-primary);
  border-radius: 1.25rem;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  background-color: transparent;
  border: 1px solid var(--color-secondary);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.category-btn.active {
  background-color: var(--color-secondary);
  cursor: default;
  pointer-events: none;
}

.category-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  flex-shrink: 0;
}

/* ==========================================================================
   Main Content & Promotions Grid
   ========================================================================== */

.main-content {
  flex: 1 0 auto;
  width: 100%;
  padding: 12px 16px 48px;
}

.content-container {
  width: 100%;
  max-width: var(--max-content-width);
  margin: 0 auto;
}

.promotions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, var(--card-width)));
  justify-content: center;
  gap: 24px 20px;
}

/* Promo Card Component */
.promo-card {
  width: 100%;
  max-width: var(--card-width);
  margin: 0 auto;
  background-color: var(--color-card-bg);
  border: 2px solid var(--color-card-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.promo-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.promo-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 750 / 320;
  background-color: #2b032d;
  overflow: hidden;
}

.promo-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.promo-card__body {
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-height: 80px;
}

.promo-card__title {
  font-family: var(--font-primary);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-text);
  margin-bottom: 8px;
}

.promo-card__desc {
  font-family: var(--font-primary);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--color-text);
  margin-bottom: 8px;
}

.promo-terms {
  display: inline-block;
  color: #ffffffd9;
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  margin-top: 6px;
  margin-bottom: 5px;
  cursor: pointer;
  transition: opacity var(--transition-speed) ease;
}

.promo-terms:hover {
  opacity: 0.85;
}

.promo-card__actions {
  padding: 10px 16px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 230px;
  max-width: 100%;
  margin: 0 auto;
  gap: 10px;
}

.promo-card__actions .btn {
  width: 100px;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  border-radius: 4px;
  padding: 0;
  font-size: 16px;
  text-transform: none;
  font-family: var(--font-primary);
  font-weight: 500;
  letter-spacing: normal;
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: #ffffff;
}

.btn-secondary:hover {
  background-color: var(--color-secondary-hover);
}

.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
}

/* ==========================================================================
   Footer Component
   ========================================================================== */

.site-footer {
  width: 100%;
  background-color: var(--color-footer-bg);
  border-top: 1px solid var(--color-footer-border);
  padding: 36px 16px 40px;
}

.footer-container {
  width: 100%;
  max-width: var(--max-content-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* Navigation Links */
.footer-nav__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer-nav__link {
  font-family: var(--font-primary);
  font-size: 0.875rem;
  color: #ffffff;
  font-weight: 500;
  transition: color var(--transition-speed) ease;
}

.footer-nav__link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Badges & Payments Section */
.footer-badges-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.payment-methods {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px 20px;
}

.payment-item img {
  height: auto;
  max-height: 28px;
  width: auto;
  object-fit: contain;
  filter: brightness(0.95);
  transition: filter var(--transition-speed) ease;
}

.payment-item img:hover {
  filter: brightness(1.1);
}

.app-store-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.store-badge img {
  height: 42px;
  width: auto;
  border-radius: var(--radius-sm);
  transition: transform var(--transition-speed) ease, opacity var(--transition-speed) ease;
}

.store-badge:hover img {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* Regulatory Logos */
.footer-regulatory {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 8px 0;
}

.regulatory-item img {
  height: auto;
  max-height: 32px;
  width: auto;
  opacity: 0.85;
  transition: opacity var(--transition-speed) ease;
}

.regulatory-item:hover img {
  opacity: 1;
}

/* Legal & Disclaimer Text */
.footer-disclaimer {
  max-width: 960px;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.6;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-disclaimer .copyright {
  font-family: var(--font-primary);
  font-weight: 600;
  color: #FFFFFF;
}

.legal-link {
  color: var(--color-primary);
  text-decoration: underline;
  transition: color var(--transition-speed) ease;
}

.legal-link:hover {
  color: var(--color-primary-hover);
}

/* ==========================================================================
   Modal Dialog Component (Promotion Detail Popup)
   ========================================================================== */

.promo-modal {
  margin: auto;
  border: none;
  background: transparent;
  padding: 0;
  max-width: 480px;
  width: 92%;
}

@media (min-width: 768px) {
  .promo-modal {
    max-width: 684px;
    width: 90%;
  }
}

.promo-modal::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.promo-modal__box {
  background-color: #000000;
  color: #ffffff;
  border: 2px solid var(--color-secondary);
  border-radius: var(--radius-sm);
  padding: 0 0 25px 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
}

.promo-modal__close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.5);
  font-size: 1.5rem;
  line-height: 1;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

.promo-modal__close:hover {
  background: rgba(0, 0, 0, 0.9);
  color: #ffffff;
}

.promotion-detail-content {
  background-color: #000000;
  color: #ffffff;
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

.promotion-detail-content .detail-picture {
  width: 100%;
  display: block;
}

.promotion-detail-content .detail-image {
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.promotion-detail-content .promotion-detail-description {
  min-height: 50px;
  padding: 16px 14px 10px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #ffffff;
}

.promotion-detail-content .promo-detail-actions {
  width: 300px;
  max-width: 100%;
  margin: 16px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.promotion-detail-content .promo-detail-actions .btn {
  width: 100px;
  height: 44px;
  min-height: 44px;
  border-radius: 4px;
  padding: 0;
  font-size: 16px;
  font-weight: 500;
  text-transform: none;
  font-family: var(--font-primary);
}

.promotion-detail-content .promo-detail-actions .back-button {
  background-color: var(--color-tertiary);
  color: #ffffff;
}

.promotion-detail-content .promo-detail-actions .back-button:hover {
  background-color: #4854e0;
}

.promotion-detail-content .terms-title {
  padding: 25px 14px 0;
}

.promotion-detail-content .terms-title a {
  color: #0099ff;
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
}

.promotion-detail-content .terms-title a:hover {
  opacity: 0.85;
}

/* ==========================================================================
   Responsive Breakpoints (Mobile First)
   ========================================================================== */

@media (min-width: 480px) {
  .site-logo img {
    height: 34px;
    max-width: none;
  }

  .header-actions {
    gap: 10px;
  }
}

@media (min-width: 768px) {
  :root {
    --header-height: 64px;
  }

  .site-logo img {
    height: 44px;
  }

  .main-content {
    padding: 36px 24px 64px;
  }

  .promotions-grid {
    gap: 28px 24px;
  }

  .footer-nav__list {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px 24px;
  }

  .footer-badges-section {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 28px 40px;
    flex-wrap: wrap;
  }

  .payment-methods {
    justify-content: center;
  }

  .app-store-badges {
    justify-content: center;
  }
}

@media (min-width: 600px) and (max-width: 1023px) {
  .promotions-grid {
    grid-template-columns: repeat(2, minmax(280px, 320px));
    justify-content: center;
    gap: 24px 20px;
  }

  .promo-card {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }
}

@media (min-width: 600px) and (max-width: 767px) {
  .categorybar__container {
    max-width: 692px;
    padding: 0 16px;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .categorybar__container {
    max-width: 708px;
    padding: 0 24px;
  }
}

@media (min-width: 1024px) {
  .categorybar__container {
    max-width: 1308px;
    padding: 0 24px;
  }

  .main-content {
    padding: 36px 24px 64px;
  }

  .promotions-grid {
    grid-template-columns: repeat(4, minmax(0, 300px));
    justify-content: center;
    gap: 20px;
  }

  .promo-card {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }

  .site-footer {
    padding: 48px 24px 52px;
  }
}
