/* CREATE VARIABLES FOR COLORS AND FONTS */
/* Note: These are fallback values only. Actual theme is set by theme-service.js */

:root {
  --color-bg: #181e29;
  --color-surface: #232a3a;
  --color-accent: #2196f3;
  --color-accent-hover: #05729a;
  --color-accent-alt: #00baff;
  --color-accent-yellow: #ffe600;
  --color-text: #ffffff;
  --color-text-secondary: #bfcfff;
  --color-badge: #181e29;
  --color-shadow: rgba(0, 0, 0, 0.3);
  --color-success: #4caf50;
  --color-info: #2196f3;
  --color-error: #f44336;
  --color-shadow-strong: rgba(0, 0, 0, 0.6);
  --color-shadow-navbar: rgba(0, 0, 0, 0.5);
  --color-shadow-badge: rgba(0, 0, 0, 0.4);
  --color-border: #686868;
  --color-border-base: 255, 255, 255;
  --bg-overlay-opacity: 0.15;
  --font-main: "Montserrat", Arial, sans-serif;
}


/* Fix elastic/rubber-band scrolling on iOS */
html {
  overflow-x: hidden;
  overscroll-behavior-y: none;
  background: var(--color-bg); /* Solid background as ultimate fallback */
  min-height: 100%;
  height: auto;
}

/* Prevent iOS Safari auto-zoom on input focus (triggers when font-size < 16px) */
input, textarea, select {
  font-size: 16px;
}

/*
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background: transparent;
  color: var(--color-text);
  min-height: 100vh;
  box-sizing: border-box;
  position: relative;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
}*/

/* 
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: var(--background-image, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.5;
  z-index: -1; 
  pointer-events: none;
  animation: boomerang 12s ease-in-out infinite;
}*/
/* Reset and base styles */
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background: transparent; /* Keep transparent so animated layer shows */
    color: var(--color-text);
    min-height: 100vh;
    box-sizing: border-box;
    position: relative;
    overflow-x: hidden;
    /* overscroll-behavior-y: none; */
}

/* Solid background layer */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg);
    z-index: -2;
    pointer-events: none;
}
/* Dynamic background image layer (on top of solid background) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--background-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.15;
    z-index: -1; /* Above the solid background (z-index: -2) */
    pointer-events: none;
    animation: boomerang 12s ease-in-out infinite;
}


/* Utility classes */
body.no-scroll {
  overflow: hidden;
  height: 100vh;
}

.slider-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 48px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  overflow: hidden;
}

.slide {
  position: absolute;
  width: 100%;
  text-align: center;
  opacity: 0;
  left: 0;
  top: 0;
  line-height: 48px;
  height: 48px;
  transform: translateX(100%);
  transition:
    opacity 0.5s cubic-bezier(0.77, 0, 0.18, 1),
    transform 0.5s cubic-bezier(0.77, 0, 0.18, 1);
  pointer-events: none;
}

.slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  z-index: 1;
}

.slide.out {
  opacity: 0;
  transform: translateX(-100%);
  z-index: 0;
}

/* Centered logo below slider */
.logo-center {
  margin-top: 64px; /* 48px slider + 16px space */
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  padding: 6px;
  background-color: #16243d;
  box-shadow: 0 10px 12px var(--color-shadow);
}

/* Bottom navbar styles */
.navigation {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--color-surface);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 15px 0;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  box-shadow: 0 -22px 16px var(--color-shadow-navbar);
  z-index: 100;
  transition: transform 0.2s ease;
}

/* Hide navbar when keyboard is open (triggered by JS) */
.navigation.keyboard-open {
  transform: translateY(100%);
}

.nav-button {
  position: relative;
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
  cursor: pointer;
  outline: none;
  transition: color 0.2s;
  text-decoration: none;
}

.navigation a,
.nav-button {
  text-decoration: none;
}
.nav-button.active,
.nav-button:focus {
  color: var(--color-accent-alt);
}

.nav-button:hover:not(.active) {
  color: var(--color-accent-hover);
}

/* Floating Back Button - Top Left Position */
.back-btn {
  position: fixed;
  top: 60px;
  left: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px var(--color-shadow);
  backdrop-filter: blur(10px);
}

.back-btn:hover {
  background: var(--color-accent);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(33, 150, 243, 0.6);
}

.back-btn:active {
  transform: translateY(0);
  transition: all 0.1s ease;
}

/* specific to the /account page shouod be moved there */
/* Floating Inbox Button - Top Right Position */
.inbox-btn {
  position: fixed;
  top: 60px;
  right: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px var(--color-shadow);
  backdrop-filter: blur(10px);
}

.inbox-btn:hover {
  background: var(--color-accent);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(33, 150, 243, 0.6);
}

.inbox-btn:active {
  transform: translateY(0);
  transition: all 0.1s ease;
}

/* Bell icon ring animation when there are messages */
/* .inbox-btn .fa-bell {
  animation: bellRing 2s ease-in-out infinite;
  transform-origin: top center;
}

@keyframes bellRing {
  0%, 100% {
    transform: rotate(0deg);
  }
  5%, 15% {
    transform: rotate(15deg);
  }
  10%, 20% {
    transform: rotate(-15deg);
  }
  25% {
    transform: rotate(0deg);
  }
} */

/* Inbox Badge - Notification Counter */
/* .inbox-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #f44336;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 10px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(244, 67, 54, 0.6);
  animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.9;
  }
} */

/* Custom Alert/Confirm Modal Styles - Moved to css/components/modals.css */

/* Credits Modal Styles */
.modal-bg {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

/* should be moved in modals.css */
.credits-modal {
  background: var(--color-surface, #232a3a);
  padding: 24px;
  border-radius: 12px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--color-border);
  animation: modalFadeIn 0.25s ease-out;
  position: relative;
  margin: auto;
}

.credits-modal h3 {
  margin: 0 0 12px 0;
  color: var(--color-accent, #2196f3);
  font-size: 1.1rem;
  font-weight: 600;
}

.credits-modal p {
  margin: 0 0 8px 0;
  color: var(--color-text, #fff);
  line-height: 1.5;
  font-size: 0.9rem;
}

.credits-modal .subtitle {
  margin: 0 0 16px 0;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  font-style: italic;
}

.credits-modal a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 600;
}

.credits-modal a:hover {
  color: var(--color-accent-alt);
  text-decoration: underline;
}

.credits-modal button {
  background: linear-gradient(
    135deg,
    var(--color-accent),
    var(--color-accent-hover)
  );
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  width: 100%;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--color-accent) 30%, transparent);
}

.credits-modal button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px
    color-mix(in srgb, var(--color-accent) 40%, transparent);
}

.logo-img {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.logo-img:hover {
  transform: scale(1.05);
}

/* Loading bar styles */
.loading-container {
  position: fixed;
  top: 48px; /* Below the slider banner */
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(var(--color-border-base), 0.1);
  z-index: 1000;
  overflow: hidden;
  display: none;
}

.loading-container.show {
  display: block;
}

.loading-bar {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--color-accent),
    var(--color-accent-alt)
  );
  width: 0%;
  animation: loadingProgress 2s ease-in-out infinite;
  position: relative;
}

.loading-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(var(--color-border-base), 0.4),
    transparent
  );
  animation: loadingShine 1.5s ease-in-out infinite;
}

/* Pagination Container */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 24px;
  padding: 14px 16px;
  background: var(--color-surface, #2c3447);
  border-radius: 12px;
  box-sizing: border-box;
}

/* Pagination Buttons */
.pagination-btn {
  background: transparent;
  color: var(--color-text, #fff);
  border: 1px solid rgba(var(--color-border-base), 0.2);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(33, 150, 243, 0.2);
  border-color: var(--color-accent, #2196f3);
  color: var(--color-accent, #2196f3);
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Pagination Info (center section) */
.pagination-info {
  color: var(--color-text-secondary, #bfcfff);
  font-size: 0.8rem;
  font-weight: 500;
  flex: 1;
  text-align: center;
  /* display: flex; */
  flex-direction: column;
  gap: 4px;
}

.pagination-range {
  font-size: 0.8rem;
  color: var(--color-text-secondary, #bfcfff);
}

.pagination-range span {
  color: var(--color-text, #fff);
  font-weight: 600;
}

.pagination-pages {
  font-size: 0.75rem;
  color: rgba(191, 207, 255, 0.7);
}

.pagination-info #current-page {
  color: var(--color-accent, #2196f3);
  font-weight: 700;
}

.pagination-info #total-pages {
  color: var(--color-text, #fff);
  font-weight: 600;
}

/* Legacy pagination-controls (for backward compatibility) */
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-info {
  color: #bfcfff;
  font-weight: 500;
  min-width: 100px;
  text-align: center;
  font-size: 0.95rem;
}

/* ===================================
   SCROLL TO TOP BUTTON 
   =================================== */
.scroll-to-top {
  position: fixed;
  bottom: 90px; /* Above navigation bar */
  right: 20px;
  width: 50px;
  height: 50px;
  background: linear-gradient(
    135deg,
    var(--color-accent),
    var(--color-accent-hover)
  );
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 9999;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(33, 150, 243, 0.6);
  background: linear-gradient(
    135deg,
    var(--color-accent-hover),
    var(--color-accent)
  );
}

.scroll-to-top:active {
  transform: translateY(-2px);
}

/* ==================== */
/* RESPONSIVE            */
/* ==================== */

@media (max-width: 768px) {
  .scroll-to-top {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    bottom: 80px;
    right: 16px;
  }
}

/* ==================== */
/* ANIMATION            */
/* ==================== */

/* Filter Animation Keyframes */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    max-height: 500px;
  }
}

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

@keyframes customSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes loadingProgress {
  0% {
    width: 0%;
    opacity: 0.7;
  }
  50% {
    width: 70%;
    opacity: 1;
  }
  100% {
    width: 100%;
    opacity: 0.7;
  }
}

@keyframes loadingShine {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Boomerang animation keyframes - Enhanced movement */
@keyframes boomerang {
  0% {
    transform: scale(1) translateX(0) translateY(0);
  }
  25% {
    transform: scale(1.08) translateX(4%) translateY(-4%);
  }
  50% {
    transform: scale(1.15) translateX(0) translateY(0);
  }
  75% {
    transform: scale(1.08) translateX(-4%) translateY(4%);
  }
  100% {
    transform: scale(1) translateX(0) translateY(0);
  }
}

/* Spin animation - Used for wheel of fortune easter egg */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ============================================
   GENERIC EMPTY & ERROR STATES
   ============================================ */

/* Base empty/error state container */
.empty-state,
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-secondary, #bfcfff);
  background: var(--color-surface);
  border-radius: 14px;
  box-shadow: none;
  border: none;
}

/* State icons */
.empty-state-icon {
  font-size: 64px;
  color: var(--color-text-secondary);
  opacity: 0.3;
  margin-bottom: 20px;
}

.error-state-icon {
  font-size: 64px;
  color: #ef4444;
  opacity: 0.8;
  margin-bottom: 20px;
}

/* Titles */
.empty-state-title,
.error-state-title {
  margin: 0 0 12px 0;
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  font-weight: 400;
}

/* Backward compatibility for h3 without class */
.empty-state h3,
.error-state h3 {
  margin: 0 0 12px 0;
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  font-weight: 400;
}

/* Messages */
.empty-state-message,
.error-state-message {
  margin: 0 0 24px 0;
  opacity: 1;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

/* Backward compatibility for p without class */
.empty-state p,
.error-state p {
  margin: 0 0 24px 0;
  opacity: 1;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

/* Optional action button */
.empty-state-btn,
.empty-state-action,
.error-state-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--color-accent, #2196f3), var(--color-accent-hover, #1976d2));
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  margin-top: 0;
}

/* Button icons need higher specificity to override state icons */
.empty-state .empty-state-btn i,
.empty-state .empty-state-action i,
.error-state .error-state-action i {
  font-size: 1rem !important;
  opacity: 1 !important;
  margin: 0 !important;
  color: white !important;
}

.empty-state-btn:hover,
.empty-state-action:hover,
.error-state-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.empty-state-btn:active,
.empty-state-action:active,
.error-state-action:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Error action button variant (red) */
.error-state-action {
  background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
}

.error-state-action:hover {
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* ============================================
   SKELETON LOADING — GLOBAL
   Single source of truth — do NOT redefine .skeleton or @keyframes shimmer in page CSS
   ============================================ */

/* Base skeleton element — applies shimmer to any element */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(var(--color-border-base), 0.03) 0%,
    rgba(var(--color-border-base), 0.08) 50%,
    rgba(var(--color-border-base), 0.03) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

/* Skeleton content wrapper — hidden by default, shown when parent has .loading */
.skeleton-content {
  display: none;
  padding: 20px;
}

/* Common skeleton utility sizes (used across tos, privacy, info, contact...) */
.skeleton-text        { height: 16px; margin: 10px 0; }
.skeleton-text-full   { width: 100%; }
.skeleton-text-large  { width: 95%; }
.skeleton-text-medium { width: 85%; }
.skeleton-text-small  { width: 70%; }

.skeleton-heading     { height: 32px; width: 45%; margin-bottom: 16px; }
.skeleton-title       { height: 40px; width: 60%; margin: 0 auto 12px; }
.skeleton-subtitle    { height: 20px; width: 30%; margin: 0 auto 32px; }
.skeleton-breadcrumb  { height: 48px; width: 100%; margin-bottom: 24px; }
.skeleton-section     { margin-bottom: 32px; }
.skeleton-list-item   { height: 16px; width: 90%; margin: 8px 0 8px 20px; }
.skeleton-box         { height: 80px; width: 100%; margin: 16px 0; }
.skeleton-table       { height: 200px; width: 100%; margin: 16px 0; }
