/* ===== LOADING STATES & ANIMATIONS ===== */

/* Skeleton Loader Base */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(var(--tech-blue-rgb), 0.05) 0%,
    rgba(var(--tech-cyan-rgb), 0.1) 50%,
    rgba(var(--tech-blue-rgb), 0.05) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Skeleton Variants */
.skeleton-text {
  height: 1em;
  margin: 0.5rem 0;
}

.skeleton-text.short {
  width: 40%;
}

.skeleton-text.medium {
  width: 60%;
}

.skeleton-text.long {
  width: 80%;
}

.skeleton-heading {
  height: 2rem;
  width: 60%;
  margin: 1rem 0;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius-md);
}

.skeleton-stat {
  background: linear-gradient(135deg, rgba(var(--tech-blue-rgb), 0.08), rgba(var(--tech-cyan-rgb), 0.04));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  min-height: 80px;
}

/* Skeleton Dashboard Stats */
.skeleton-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 1rem;
}

@media (max-width: 992px) {
  .skeleton-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Skeleton Giveaway Card */
.skeleton-giveaway-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  animation: pulse 2s infinite;
}

.skeleton-giveaway-image {
  height: 200px;
  background: linear-gradient(
    90deg,
    rgba(var(--tech-blue-rgb), 0.08) 0%,
    rgba(var(--tech-cyan-rgb), 0.15) 50%,
    rgba(var(--tech-blue-rgb), 0.08) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-giveaway-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

/* Spinner */
.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 1rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(var(--tech-blue-rgb), 0.1);
  border-top: 4px solid var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.spinner-lg {
  width: 64px;
  height: 64px;
  border-width: 5px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* SVG Loaders - Modern animated spinners */
.svg-loader {
  display: inline-block;
}

.svg-loader svg {
  display: block;
}

.svg-loader path {
  fill: var(--accent-primary, #8b5cf6);
}

.svg-loader-sm svg { width: 24px; height: 24px; }
.svg-loader-md svg { width: 40px; height: 40px; }
.svg-loader-lg svg { width: 56px; height: 56px; }

/* Loader type: circular */
.svg-loader-circular path:first-child {
  opacity: 0.2;
}

/* Loader type: bars */
.svg-loader-bars rect {
  fill: var(--accent-primary, #8b5cf6);
}

/* Loader type: dots (pulse effect) */
.svg-loader-dots rect {
  fill: var(--accent-primary, #8b5cf6);
}

/* Button Loading State — defined in ui-improvements.css */

/* Loading Overlay */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 26, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(var(--tech-blue-rgb), 0.1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 2px;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: progress-shimmer 1.5s infinite;
}

@keyframes progress-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Indeterminate Progress */
.progress-bar.indeterminate .progress-bar-fill {
  width: 40% !important;
  animation: indeterminate 1.5s infinite;
}

@keyframes indeterminate {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(350%);
  }
}

/* Skeleton List Items */
.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.skeleton-list-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(var(--tech-blue-rgb), 0.05), rgba(var(--tech-cyan-rgb), 0.02));
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

/* Shimmer Effect Overlay */
.shimmer-wrapper {
  position: relative;
  overflow: hidden;
}

.shimmer-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(var(--tech-cyan-rgb), 0.2),
    transparent
  );
  animation: shimmer-slide 2s infinite;
}

@keyframes shimmer-slide {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Loading Text Animation */
.loading-text {
  display: inline-block;
  color: var(--text-secondary);
}

.loading-text::after {
  content: '';
  animation: loading-dots 1.5s steps(4) infinite;
}

@keyframes loading-dots {
  0%, 20% {
    content: '';
  }
  40% {
    content: '.';
  }
  60% {
    content: '..';
  }
  80%, 100% {
    content: '...';
  }
}

/* Fade In Animation */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Skeleton Leaderboard */
.skeleton-leaderboard-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem;
  background: linear-gradient(135deg, rgba(var(--tech-blue-rgb), 0.05), rgba(var(--tech-cyan-rgb), 0.02));
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.skeleton-leaderboard-item .skeleton-position {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.skeleton-leaderboard-item .skeleton-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Empty State Improvements */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.empty-state-description {
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.empty-state-action {
  display: inline-block;
  margin-top: 1rem;
}

/* Error State */
.error-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--accent-danger);
}

.error-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.error-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.error-state-description {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Content Loading State */
.content-loading {
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Disable interactions during loading */
.is-loading {
  pointer-events: none;
  opacity: 0.6;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Loading state for specific components */
.dashboard-card.loading {
  position: relative;
  min-height: 200px;
}

.giveaway-card.loading {
  position: relative;
  min-height: 400px;
}

/* Skeleton notification */
.skeleton-notification {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: linear-gradient(135deg, rgba(var(--tech-blue-rgb), 0.05), rgba(var(--tech-cyan-rgb), 0.02));
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.skeleton-notification-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-notification-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
/* ===== RESPONSIVE ENHANCEMENTS & MOBILE PERFECTION ===== */
/* Perfect experience for both desktop and mobile devices */

/* ===== MOBILE-FIRST TOUCH TARGETS ===== */
/* Ensure all interactive elements are at least 44x44px for easy touch */
@media (max-width: 768px) {
  button,
  .btn-primary,
  .btn-secondary,
  .btn-outline,
  .nav-link,
  a[role="button"] {
    min-height: 44px;
    min-width: 44px;
    padding: 0.75rem 1.25rem;
  }

  /* Larger touch targets for icons */
  .btn-notifications,
  .btn-user-avatar {
    min-height: 48px;
    min-width: 48px;
  }
}

/* ===== MOBILE NAVIGATION IMPROVEMENTS ===== */
@media (max-width: 1024px) {
  .nav-container {
    padding: 0 1rem;
    height: auto;
    min-height: 70px;
    flex-direction: column;
    gap: 1rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .nav-logo {
    width: 100%;
    justify-content: center;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .nav-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  /* Ensure icons are properly aligned on mobile */
  .nav-icon,
  .points-icon,
  .notification-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Hide nav link text on very small screens, show only icons */
  @media (max-width: 480px) {
    .nav-link span:not(.nav-icon) {
      display: none;
    }

    .nav-link {
      min-width: 48px;
      padding: 0.75rem;
    }
  }
}

/* ===== MOBILE TYPOGRAPHY OPTIMIZATION ===== */
@media (max-width: 768px) {
  :root {
    /* Adjust font sizes for better mobile readability */
    --mobile-scale: 0.9;
  }

  h1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    line-height: 1.2;
  }

  h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    line-height: 1.3;
  }

  h3 {
    font-size: clamp(1.25rem, 3.5vw, 1.75rem);
    line-height: 1.4;
  }

  p {
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    line-height: 1.6;
  }

  /* Improve text spacing for mobile */
  .user-greeting h1 {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
    margin-bottom: 0.5rem;
  }

  .giveaways-hero h1 {
    font-size: clamp(1.75rem, 6vw, 2.6rem);
  }
}

/* ===== MOBILE SPACING & LAYOUT ===== */
@media (max-width: 768px) {
  .main-grid {
    padding: 1rem 1rem 3rem;
  }

  .dashboard-container {
    padding: 1rem;
  }

  .welcome-section,
  .giveaways-hero {
    padding: 1.25rem;
    gap: 1rem;
  }

  .dashboard-card .card-header,
  .dashboard-card .card-body {
    padding: 1rem;
  }

  /* Stack elements vertically on mobile */
  .welcome-content,
  .giveaways-hero {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .quick-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .giveaways-metrics {
    justify-content: center;
    width: 100%;
  }
}

/* ===== MOBILE CARDS & COMPONENTS ===== */
@media (max-width: 640px) {
  .giveaways-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .giveaway-card {
    max-width: 100%;
  }

  .dashboard-grid {
    gap: 1rem;
  }

  .quick-stats {
    grid-template-columns: 1fr;
  }

  .quick-stat {
    padding: 0.875rem;
  }

  .stat-icon {
    width: 44px;
    height: 44px;
    font-size: 1.75rem;
  }
}

/* ===== MOBILE FORM IMPROVEMENTS ===== */
@media (max-width: 768px) {
  .form-input,
  .form-textarea,
  .form-select {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
  }

  .form-group {
    gap: 0.625rem;
  }

  .profile-form,
  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* ===== ENHANCED TOUCH INTERACTIONS ===== */
/*
 * FIX: On mobile (≤768px), CSS :hover transforms cause iOS click failures.
 * When a card or button moves on :hover (touchstart → ":hover" applied →
 * transform kicks in), the click event fires at the original touch coords
 * while the element has visually shifted — causing misses.
 *
 * We use max-width:768px (not "hover:none") because the hover media query
 * is unreliable: tablets, Samsung DeX, and some Android browsers report
 * hover:hover even without a mouse.
 *
 * ALSO: overflow:hidden + position:relative on .giveaway-card requires
 * cursor:pointer on iOS Safari for child click events to fire correctly.
 */
@media (max-width: 768px) {
  /* Remove hover transforms on ALL interactive elements */
  .giveaway-card:hover .card-flip-inner,
  .giveaway-card:focus-within .card-flip-inner {
    transition: transform 0.6s ease, box-shadow 0.3s ease, border-color 0.3s ease !important;
  }

  .btn-primary:hover,
  .btn-secondary:hover,
  .btn-outline:hover {
    transform: none !important;
  }

  .metric-card:hover {
    transform: none !important;
  }

  .nav-logo:hover {
    transform: none !important;
  }

  .dashboard-card:hover {
    transform: none !important;
  }

  /* iOS Safari fix: overflow:hidden + position:relative blocks child click events
   * without cursor:pointer on the parent. */
  .giveaway-card {
    cursor: pointer;
    /* Eliminate 300ms tap delay on the card and propagate to children */
    touch-action: manipulation;
  }

  /* Active press feedback replaces the lift effect */
  .giveaway-card:not(.is-flipped):active .card-flip-inner {
    transform: scale(0.99) !important;
    transition: transform 0.08s ease !important;
  }

  button:active,
  .btn-primary:active,
  .btn-secondary:active,
  .btn-outline:active {
    transform: scale(0.97) !important;
    transition: transform 0.1s ease !important;
  }

  /* Increase tap target areas */
  .nav-link,
  .filter-btn {
    padding: 0.75rem 1.25rem;
  }
}

/* Keep the hover:none query as a secondary safety net for other devices */
@media (hover: none) and (pointer: coarse) {
  .btn-primary:hover::before {
    display: none;
  }
}

/* ===== TOUCH-ACTION: eliminate 300ms tap delay globally ===== */
button,
a,
[role="button"],
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-tasks,
.btn-read-more,
.btn-enter,
.filter-btn,
.nav-link,
.mobile-nav__item {
  touch-action: manipulation;
}

/* ===== MOBILE NOTIFICATIONS & DROPDOWNS ===== */
@media (max-width: 768px) {
  .notifications-dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(0);
  }

  .notifications-list {
    max-height: calc(70vh - 120px);
  }

  .toast-container {
    top: 1rem;
    right: 1rem;
    left: 1rem;
  }

  .toast {
    min-width: auto;
    width: 100%;
  }
}

/* ===== MOBILE LEADERBOARD ===== */
@media (max-width: 768px) {
  .leaderboard-hero {
    flex-direction: column;
    padding: 1.25rem;
    gap: 1rem;
  }

  .leaderboard-hero h1 {
    font-size: 1.5rem;
  }

  .leaderboard-controls {
    width: 100%;
  }

  .leaderboard-stats-card {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
  }

  .lb-stat {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
  }

  .lb-stat:last-child {
    border-bottom: none;
  }

  .leaderboard-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1rem;
    padding: 0 1rem;
  }

  .leaderboard-table {
    font-size: 0.875rem;
    min-width: 500px;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: 0.75rem 0.5rem;
  }

  /* Hide less important columns on mobile */
  .leaderboard-table th:nth-child(3),
  .leaderboard-table td:nth-child(3),
  .leaderboard-table th:nth-child(6),
  .leaderboard-table td:nth-child(6) {
    display: none;
  }

  .leaderboard-pagination {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }

  .leaderboard-pagination button {
    width: 100%;
  }

  .leaderboard-user-card {
    padding: 1rem;
  }

  .leaderboard-user-stats {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .lb-user-pill {
    flex: 1 1 45%;
    min-width: 0;
    padding: 0.5rem;
    font-size: 0.85rem;
  }

  .rank-badge {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
  }

  .user-avatar {
    width: 36px;
    height: 36px;
  }

  .leaderboard-avatar {
    width: 36px;
    height: 36px;
  }
}

/* ===== SMOOTH SCROLLING ===== */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Prevent horizontal scroll on mobile */
body {
  overflow-x: hidden;
}

/* ===== MOBILE SAFE AREAS (iOS NOTCH) ===== */
@supports (padding: env(safe-area-inset-top)) {
  .navbar {
    padding-top: env(safe-area-inset-top);
  }

  .discord-float-btn {
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: calc(20px + env(safe-area-inset-right));
  }

  .notifications-dropdown {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ===== DESKTOP ENHANCEMENTS (1200px+) ===== */
@media (min-width: 1200px) {
  .main-grid {
    padding: 2.5rem 2rem 4rem;
  }

  .dashboard-container {
    grid-template-columns: 1fr 350px;
    gap: 2rem;
  }

  .giveaways-grid {
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
  }

  .welcome-section,
  .giveaways-hero {
    padding: 2.5rem 3rem;
  }

  /* Larger hover effects on desktop */
  .giveaway-card:not(.is-flipped):hover .card-flip-inner {
    transform: translateY(-6px);
  }

  .dashboard-card:hover {
    transform: translateY(-3px);
  }
}

/* ===== ULTRA-WIDE DESKTOP (1600px+) ===== */
@media (min-width: 1600px) {
  .main-grid {
    max-width: 1600px;
  }

  .giveaways-grid {
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  }

  .dashboard-container {
    grid-template-columns: 1fr 400px;
  }
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .border-flow,
  .pulse-glow,
  .discord-pulse {
    animation: none !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border: rgba(var(--tech-blue-rgb), 0.4);
    --border-hover: rgba(var(--tech-blue-rgb), 0.6);
  }

  .btn-primary,
  .btn-secondary,
  .btn-outline {
    border-width: 2px;
  }
}

/* ===== DARK MODE ENHANCEMENTS (Already dark, but deeper on preference) ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1420;
    --bg-card: #141824;
  }
}

/* ===== LANDSCAPE MOBILE OPTIMIZATION ===== */
@media (max-width: 900px) and (orientation: landscape) {
  .welcome-section,
  .giveaways-hero {
    flex-direction: row;
    padding: 1.5rem;
  }

  .quick-stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .navbar {
    position: sticky;
  }
}

/* ===== TABLET OPTIMIZATION (768px - 1024px) ===== */
@media (min-width: 768px) and (max-width: 1024px) {
  .giveaways-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .quick-stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .welcome-section,
  .giveaways-hero {
    padding: 2rem;
  }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

/*
 * Note: will-change removed to prevent memory overhead.
 * GPU acceleration via translateZ(0) is applied only where truly needed.
 * For animated elements, will-change should be added via JS just before
 * animation starts and removed after completion.
 */

/* Optimize repaints for frequently updated elements */
.notification-badge,
.discord-float-btn {
  transform: translateZ(0);
}

/* ===== PRINT STYLES ===== */
@media print {
  .navbar,
  .nav-actions,
  .discord-float-btn,
  .notifications-dropdown,
  .toast-container {
    display: none !important;
  }

  .dashboard-card,
  .giveaway-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body {
    background: white;
    color: black;
  }
}
/* ===== MICRO-INTERACTIONS & SMOOTH ANIMATIONS ===== */
/* Subtle animations that enhance user experience */

/* ===== LOADING STATES ===== */
/* .skeleton and skeleton-loading keyframe — defined in loading-states.css (canonical) */

/* ===== RIPPLE EFFECT ON CLICK ===== */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(var(--tech-cyan-rgb), 0.4);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease, opacity 0.6s ease;
  opacity: 0;
}

.ripple:active::after {
  width: 300px;
  height: 300px;
  opacity: 1;
  transition: width 0s, height 0s, opacity 0.3s ease;
}

/* ===== SMOOTH PAGE TRANSITIONS ===== */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in-scale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Apply animations to cards */
.giveaway-card,
.dashboard-card {
  animation: fade-in-up 0.4s ease-out;
}

.giveaway-card:nth-child(1) { animation-delay: 0.05s; }
.giveaway-card:nth-child(2) { animation-delay: 0.1s; }
.giveaway-card:nth-child(3) { animation-delay: 0.15s; }
.giveaway-card:nth-child(4) { animation-delay: 0.2s; }
.giveaway-card:nth-child(5) { animation-delay: 0.25s; }
.giveaway-card:nth-child(6) { animation-delay: 0.3s; }

/* ===== NOTIFICATION ENTRANCE ===== */
@keyframes slide-in-from-right {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slide-out-to-right {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.toast {
  animation: slide-in-from-right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.removing {
  animation: slide-out-to-right 0.3s ease-in forwards;
}

/* ===== MODAL ANIMATIONS ===== */
@keyframes modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-slide-up {
  from {
    transform: translateY(50px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal {
  animation: modal-fade-in 0.2s ease;
}

.modal-dialog {
  animation: modal-slide-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== DROPDOWN ANIMATIONS ===== */
@keyframes dropdown-slide-down {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notifications-dropdown {
  animation: dropdown-slide-down 0.3s ease-out;
}

/* Mobile bottom sheet animation */
@media (max-width: 768px) {
  @keyframes bottom-sheet-slide-up {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }

  .notifications-dropdown {
    animation: bottom-sheet-slide-up 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  }
}

/* ===== BUTTON PRESS FEEDBACK ===== */
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-steam {
  transition: transform 0.1s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.btn-primary:active,
.btn-secondary:active,
.btn-outline:active {
  transform: scale(0.97) !important;
}

/* ===== GLOW PULSE ANIMATION ===== */
@keyframes glow-pulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(var(--tech-blue-rgb), 0.2);
  }
  50% {
    box-shadow: 0 0 25px rgba(var(--tech-blue-rgb), 0.4), 0 0 35px rgba(var(--tech-cyan-rgb), 0.2);
  }
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.form-input:focus-visible {
  animation: glow-pulse 2s ease-in-out infinite;
}

/* ===== PROGRESS INDICATORS ===== */
@keyframes progress-bar {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--tech-cyan), transparent);
  z-index: 9999;
  animation: progress-bar 1.5s ease-in-out infinite;
}

/* ===== HOVER LIFT EFFECT ===== */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3), 0 0 30px rgba(var(--tech-blue-rgb), 0.25);
}

/* ===== SMOOTH SCROLL INDICATOR ===== */
@keyframes bounce-down {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

.scroll-indicator {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce-down 2s ease-in-out infinite;
  opacity: 0.6;
  transition: opacity 0.3s ease;
  z-index: 100;
}

.scroll-indicator:hover {
  opacity: 1;
}

/* Hide scroll indicator when scrolled */
.scrolled .scroll-indicator {
  opacity: 0;
  pointer-events: none;
}

/* ===== COUNTER ANIMATION ===== */
@keyframes count-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat-value,
.metric-value {
  animation: count-up 0.6s ease-out;
}

/* ===== CARD FLIP EFFECT (for special items) ===== */
.flip-card {
  perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
}

.flip-card-back {
  transform: rotateY(180deg);
}

/* ===== STAGGER ANIMATION UTILITY ===== */
.stagger-animation > * {
  animation: fade-in-up 0.5s ease-out backwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-animation > *:nth-child(8) { animation-delay: 0.4s; }

/* ===== SHIMMER EFFECT ===== */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(var(--tech-cyan-rgb), 0.1) 50%,
    transparent 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* ===== TYPING INDICATOR ===== */
@keyframes typing-dot {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 0.5rem;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  animation: typing-dot 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

/* ===== SUCCESS CHECKMARK ANIMATION ===== */
@keyframes draw-check {
  0% {
    stroke-dashoffset: 100;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.success-checkmark {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: draw-check 0.5s ease-out forwards;
}

/* ===== PARTICLE EFFECT ON HOVER ===== */
@keyframes particle-float {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateY(-30px) translateX(10px);
    opacity: 0;
  }
}

.particle-effect {
  position: relative;
  overflow: visible;
}

.particle-effect::before,
.particle-effect::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--tech-cyan);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.particle-effect:hover::before {
  animation: particle-float 1s ease-out;
  left: 20%;
  top: 50%;
}

.particle-effect:hover::after {
  animation: particle-float 1.2s ease-out;
  animation-delay: 0.1s;
  left: 80%;
  top: 50%;
}

/* ===== SMOOTH STATE TRANSITIONS ===== */
.page-transition-enter {
  animation: fade-in-up 0.4s ease-out;
}

.page-transition-exit {
  animation: fade-in-up 0.3s ease-in reverse;
}

/* ===== LIGHT THEME ANIMATIONS & EFFECTS ===== */

/* Light theme skeleton loading */
[data-theme="light"] .skeleton {
  background: linear-gradient(
    90deg,
    rgba(139, 92, 246, 0.05) 25%,
    rgba(139, 92, 246, 0.15) 50%,
    rgba(139, 92, 246, 0.05) 75%
  );
}

/* Light theme ripple */
[data-theme="light"] .ripple::after {
  background: rgba(139, 92, 246, 0.3);
}

/* Light theme glow pulse */
@keyframes glow-pulse-light {
  0%, 100% {
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.15);
  }
  50% {
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.3), 0 0 30px rgba(139, 92, 246, 0.15);
  }
}

[data-theme="light"] .btn-primary:focus-visible,
[data-theme="light"] .btn-secondary:focus-visible,
[data-theme="light"] .form-input:focus-visible {
  animation: glow-pulse-light 2s ease-in-out infinite;
}

/* Light theme hover lift */
[data-theme="light"] .hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15), 0 0 30px rgba(124, 58, 237, 0.15);
}

/* Light theme shimmer */
[data-theme="light"] .shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(139, 92, 246, 0.15) 50%,
    transparent 100%
  );
}

/* Light theme particle effect */
[data-theme="light"] .particle-effect::before,
[data-theme="light"] .particle-effect::after {
  background: var(--accent-primary);
}

/* Light theme loading bar */
[data-theme="light"] .loading-bar {
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
}

/* ===== LIGHT THEME SOFT GLOW EFFECTS ===== */

/* Soft gradient background animation for light theme */
@keyframes soft-gradient {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

[data-theme="light"] .giveaways-hero {
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.08),
    rgba(236, 72, 153, 0.05),
    rgba(139, 92, 246, 0.08)
  );
  background-size: 200% 200%;
  animation: soft-gradient 8s ease-in-out infinite;
}

/* Light theme card hover glow */
@keyframes card-glow-light {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }
  50% {
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.15);
  }
}

[data-theme="light"] .giveaway-card:not(.is-flipped):hover .card-flip-inner {
  animation: card-glow-light 2s ease-in-out infinite;
}

/* Light theme floating shapes */
@keyframes float-shape {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 0.5;
  }
  25% {
    transform: translate(10px, -10px) rotate(90deg);
    opacity: 0.7;
  }
  50% {
    transform: translate(0, -20px) rotate(180deg);
    opacity: 0.5;
  }
  75% {
    transform: translate(-10px, -10px) rotate(270deg);
    opacity: 0.7;
  }
}

/* Subtle decorative shapes for light theme */
.light-decorations {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.light-decorations::before,
.light-decorations::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  opacity: 0;
}

[data-theme="light"] .light-decorations::before {
  top: 10%;
  right: 10%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
  animation: float-shape 20s ease-in-out infinite;
  opacity: 1;
}

[data-theme="light"] .light-decorations::after {
  bottom: 10%;
  left: 10%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.06) 0%, transparent 70%);
  animation: float-shape 25s ease-in-out infinite reverse;
  opacity: 1;
}

/* ===== ADVANCED ANIMATIONS ===== */

/* Confetti burst for wins */
@keyframes confetti-fall {
  0% {
    transform: translateY(-100%) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  top: 0;
  pointer-events: none;
  z-index: 9999;
}

.confetti:nth-child(odd) {
  background: var(--accent-primary);
}

.confetti:nth-child(even) {
  background: var(--accent-secondary);
}

/* Trophy bounce for winners */
@keyframes trophy-bounce {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  25% {
    transform: translateY(-20px) scale(1.1);
  }
  50% {
    transform: translateY(0) scale(1);
  }
  75% {
    transform: translateY(-10px) scale(1.05);
  }
}

.trophy-animation {
  animation: trophy-bounce 1s ease-in-out;
}

/* Heartbeat for live indicators */
@keyframes heartbeat {
  0%, 100% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.15);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.15);
  }
  70% {
    transform: scale(1);
  }
}

.heartbeat {
  animation: heartbeat 1.5s ease-in-out infinite;
}

/* Pulse ring for notifications */
@keyframes pulse-ring {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.pulse-ring {
  position: relative;
}

.pulse-ring::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border: 2px solid var(--accent-primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: pulse-ring 1.5s ease-out infinite;
}

/* Shake animation for errors */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

.shake {
  animation: shake 0.5s ease-in-out;
}

/* Bounce in animation */
@keyframes bounce-in {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.bounce-in {
  animation: bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Spotlight effect */
@keyframes spotlight {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.spotlight {
  position: relative;
  overflow: hidden;
}

.spotlight::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: spotlight 3s ease-in-out infinite;
  pointer-events: none;
}

[data-theme="light"] .spotlight::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(139, 92, 246, 0.1) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
}

/* Glow text animation */
@keyframes glow-text {
  0%, 100% {
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
  }
  50% {
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.8), 0 0 30px rgba(139, 92, 246, 0.6);
  }
}

.glow-text {
  animation: glow-text 2s ease-in-out infinite;
}

[data-theme="light"] .glow-text {
  animation: none;
  color: var(--accent-primary);
  font-weight: 600;
}

/* Counter roll animation */
@keyframes counter-roll {
  0% {
    transform: translateY(100%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.counter-roll {
  display: inline-block;
  animation: counter-roll 0.4s ease-out;
}

/* Gradient border animation */
@keyframes gradient-border {
  0%, 100% {
    border-color: var(--accent-primary);
  }
  50% {
    border-color: var(--accent-secondary);
  }
}

.gradient-border-animated {
  animation: gradient-border 3s ease-in-out infinite;
}

/* ===== ACCESSIBILITY: Respect user preferences ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/**
 * UI/UX Improvements - RetroPlay Giveaways
 * Priority fixes for visual consistency, accessibility, and user experience
 */

/* ==========================================================================
   1. BUTTON STATES - Loading and Disabled
   ========================================================================== */

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-outline:disabled,
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.3);
}

.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: btn-loading-spin 0.6s linear infinite;
}

@keyframes btn-loading-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ==========================================================================
   2. TASK COMPLETION FLOW
   ========================================================================== */

.btn-task-verify {
  background: linear-gradient(135deg, var(--accent-success), #16a34a);
  color: white;
  border: 1px solid rgba(34, 197, 94, 0.4);
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.2);
  font-weight: 700;
}

.btn-task-verify:hover:not(:disabled) {
  box-shadow: 0 0 25px rgba(34, 197, 94, 0.4);
  transform: translateY(-2px);
}

.btn-task-verify .timer {
  font-weight: 700;
  animation: pulse-timer 1s ease-in-out infinite;
}

@keyframes pulse-timer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.completed-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border-radius: var(--radius-sm);
  font-weight: 700;
  border: 1px solid rgba(34, 197, 94, 0.3);
  animation: success-bounce 0.4s ease;
}

@keyframes success-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.completed-badge::before {
  content: none;
}

@keyframes check-pop {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   3. ENHANCED EMPTY STATES - Standardized Component
   ========================================================================== */

.empty-state {
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.03), transparent);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
}

/* Empty state with icon (use FontAwesome or custom icon) */
.empty-state-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--accent-primary);
  opacity: 0.5;
  background: rgba(139, 92, 246, 0.1);
  border-radius: 50%;
  animation: empty-float 3s ease-in-out infinite;
}

/* Fallback emoji icon */
.empty-state:not(:has(.empty-state-icon))::before {
  content: '\1F3AE';
  font-size: 4rem;
  opacity: 0.3;
  filter: grayscale(0.5);
  animation: empty-float 3s ease-in-out infinite;
}

@keyframes empty-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.empty-state-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 0;
}

.empty-state-description {
  max-width: 400px;
  line-height: 1.6;
  font-size: 1rem;
  margin: 0;
}

/* Optional CTA button */
.empty-state-cta {
  margin-top: 0.5rem;
}

.empty-state-cta .btn-primary,
.empty-state-cta .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Size variants */
.empty-state.empty-state--sm {
  padding: 2rem 1.5rem;
  gap: 0.75rem;
}

.empty-state.empty-state--sm .empty-state-icon {
  width: 60px;
  height: 60px;
  font-size: 1.75rem;
}

.empty-state.empty-state--sm .empty-state-title {
  font-size: 1.1rem;
}

.empty-state.empty-state--sm .empty-state-description {
  font-size: 0.9rem;
}

/* Themed variants */
.empty-state.empty-state--success {
  border-color: rgba(34, 197, 94, 0.3);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.05), transparent);
}

.empty-state.empty-state--success .empty-state-icon {
  color: var(--accent-success);
  background: rgba(34, 197, 94, 0.1);
}

.empty-state.empty-state--warning {
  border-color: rgba(245, 158, 11, 0.3);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), transparent);
}

.empty-state.empty-state--warning .empty-state-icon {
  color: var(--accent-warning);
  background: rgba(245, 158, 11, 0.1);
}

.empty-state.empty-state--info {
  border-color: rgba(99, 102, 241, 0.3);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), transparent);
}

.empty-state.empty-state--info .empty-state-icon {
  color: var(--accent-info);
  background: rgba(99, 102, 241, 0.1);
}

/* ==========================================================================
   4. FORM VALIDATION FEEDBACK
   ========================================================================== */

.form-input.invalid,
.form-textarea.invalid,
.form-select.invalid {
  border-color: var(--accent-danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
  animation: input-shake 0.4s ease;
}

.form-input.valid,
.form-textarea.valid,
.form-select.valid {
  border-color: var(--accent-success);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

@keyframes input-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.form-error {
  color: var(--accent-danger);
  font-size: 0.85rem;
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  animation: fade-in-down 0.3s ease;
}

.form-error::before {
  content: '\26A0\FE0F';
  font-size: 0.9rem;
}

/* Field-level error messages */
.field-error[hidden] { display: none; }
.field-error {
  display: block;
  color: var(--accent-danger);
  font-size: 0.8rem;
  margin-top: 0.25rem;
  animation: fade-in-down 0.2s ease;
}

/* Input error state — red border when a field fails validation */
.form-input--error,
.form-textarea--error,
.form-select--error {
  border-color: var(--accent-danger) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.form-input--error:focus,
.form-textarea--error:focus,
.form-select--error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
}

/* Password strength indicator */
.password-strength {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.password-strength .strength-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.password-strength .strength-fill {
  height: 100%;
  width: 0;
  transition: width 0.3s ease, background 0.3s ease;
  border-radius: 2px;
}

.password-strength .strength-label {
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 70px;
  text-align: right;
}

.form-success {
  color: var(--accent-success);
  font-size: 0.85rem;
  margin-top: 0.35rem;
}

@keyframes fade-in-down {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   5. ACCESSIBILITY - FOCUS INDICATORS
   ========================================================================== */

.giveaway-card:focus-within .card-flip-inner {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(139, 92, 246, 0.2);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}

*:focus-visible {
  outline: 3px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.25), 0 0 20px rgba(139, 92, 246, 0.2);
}

.giveaway-card:focus-within .card-flip-inner,
.dashboard-card:focus-within {
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(139, 92, 246, 0.25);
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible {
  box-shadow: var(--shadow-glow), 0 0 0 4px rgba(139, 92, 246, 0.3);
}

/* ==========================================================================
   6. MOBILE NAVIGATION
   ========================================================================== */

@media (max-width: 768px) {
  .nav-container {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.5rem;
  }

  .nav-container::-webkit-scrollbar {
    display: none;
  }

  .nav-links {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.35rem;
  }

  .nav-link {
    flex-shrink: 0;
    font-size: 0.85rem;
    padding: 0.5rem 0.85rem;
  }
}

/* ==========================================================================
   7. LOADING STATE CONSISTENCY
   ========================================================================== */

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(139, 92, 246, 0.1);
  border-top: 4px solid var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.3);
}

.content-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  gap: 1rem;
}

.content-loader-text {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
  animation: pulse-text 2s ease-in-out infinite;
}

@keyframes pulse-text {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ==========================================================================
   8. VISUAL HIERARCHY
   ========================================================================== */

.section-heading {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
}

.card-header p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
  line-height: 1.5;
}

.task-list {
  gap: 1rem;
}

.task-item {
  padding: 1rem;
}

/* ==========================================================================
   9. REDUCED MOTION SUPPORT
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   10. PUSH NOTIFICATIONS BELL
   ========================================================================== */

.push-bell-wrapper {
  display: flex;
  align-items: center;
}

.push-bell-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary, rgba(255, 255, 255, 0.7));
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  position: relative;
  flex-shrink: 0;
}

.push-bell-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary, #fff);
  transform: scale(1.08);
}

.push-bell-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.push-bell-btn--active {
  color: var(--accent-primary, #7c3aed);
}

.push-bell-btn--active:hover {
  background: rgba(124, 58, 237, 0.12);
  color: var(--accent-primary, #7c3aed);
}

[data-theme="light"] .push-bell-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary, #1a1a2e);
}

/* ===== Confirm Dialog — replaces window.confirm() ===== */
#rp-confirm-dialog {
  background: var(--bg-card);
  border: 1px solid rgba(var(--tech-blue-rgb), 0.25);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  max-width: 400px;
  width: calc(100% - 2rem);
  color: var(--text-primary);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

#rp-confirm-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.rp-cd-msg {
  margin: 0 0 1.5rem;
  color: var(--text-primary);
  font-size: 0.975rem;
  line-height: 1.55;
}

.rp-cd-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}
