/* Global UI Enhancements: Dark Mode, Reveal Animations, Accessibility */

/* Light mode - using modern trending color palette */
:root:not([data-theme='dark']) {
  --primary: #1e293b;
  --primary-dark: #334155;
  --primary-darker: #0a0a0a;
  --secondary: #8b5cf6;
  --accent: #84cc16;
  --dark: #0a0a0a;
  --light: #f8fafc;
  --gray: #64748b;
  --card-bg: #ffffff;
  --shadow: 0 10px 30px rgba(139, 92, 246, 0.1);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --light-bg: linear-gradient(135deg, #0a0a0a 0%, #334155 50%, #1e293b 100%);
}

/* Generic dark theme variables used across pages */
:root[data-theme='dark'] {
  --primary: #8b5cf6;
  --secondary: #84cc16;
  --accent: #10b981;
  --dark: #0a0a0a;
  --light: #1e293b;
  --gray: #64748b;
  --card-bg: #334155;
  --shadow: 0 10px 30px rgba(10, 10, 10, 0.4);

  /* Dashboard-oriented vars (if pages use them) */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --light-bg: #1e293b;
}

/* Theme toggle button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.theme-toggle:hover { transform: translateY(-2px); }
.theme-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Reveal animations */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.revealed { opacity: 1; transform: none; }

/* Keep interactive controls visible even if they have '.reveal' */
.btn.reveal,
.cta-button.reveal,
.auth-btn.reveal,
.otp-btn.reveal,
.icon-btn.reveal {
  opacity: 1;
  transform: none;
}

/* Accessibility: reduced motion & focus */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* --- Lightweight utilities (shared) --- */
.display-none { display: none !important; }
.is-hidden { display: none; }
.mt-25 { margin-top: 25px !important; }
.my-25 { margin-top: 25px !important; margin-bottom: 25px !important; }
.mb-20 { margin-bottom: 20px !important; }

/* --- Accent sections & banners --- */
.accent-section {
  margin: 40px 0;
  padding: 25px;
  background: linear-gradient(135deg, rgba(132, 204, 22, 0.1), rgba(139, 92, 246, 0.05));
  border: 3px solid var(--accent);
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(132, 204, 22, 0.3);
}

.info-banner {
  margin-top: 20px;
  padding: 15px;
  background: rgba(132, 204, 22, 0.1);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  max-width: 100%;
  overflow: hidden;
}

.accent-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
  transition: all 0.3s;
}

.checkbox-accent {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: rgba(132, 204, 22, 0.1);
  border: 2px solid var(--accent);
  border-radius: 10px;
  transition: all 0.3s;
}

/* --- Participation selection utilities --- */
.accent-panel {
  background: linear-gradient(135deg, rgba(132, 204, 22, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
  border: 3px solid rgba(132, 204, 22, 0.4);
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 20px;
}

.grid-autofit-250 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.gap-20 { gap: 20px; }

.participation-option {
  cursor: pointer;
  background: rgba(30, 41, 59, 0.95);
  border: 3px solid rgba(132, 204, 22, 0.4);
  border-radius: 15px;
  padding: 20px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 15px;
}
.participation-option.accent-border { border-color: rgba(132, 204, 22, 0.4); }
.participation-option.secondary-border { border-color: rgba(139, 92, 246, 0.4); }

.radio-lg { width: 24px; height: 24px; cursor: pointer; }
.radio-accent { accent-color: var(--accent); }
.radio-secondary { accent-color: var(--secondary); }

#manual payment id modal styles
/* Manual payment id modal (themed) */
.rp-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2,6,23,0.65);
  z-index: 9999;
}
.rp-modal {
  width: min(520px, 96%);
  background: linear-gradient(180deg, rgba(30,41,59,0.95), rgba(139,92,246,0.95));
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.04);
  color: #fff;
  font-family: 'Poppins', sans-serif;
}
.rp-modal h3 {
  margin: 0 0 8px 0;
  font-size: 1.2rem;
  color: var(--accent);
  letter-spacing: 0.2px;
}
.rp-modal p { margin: 0 0 12px 0; color: rgba(255,255,255,0.88); }
.rp-modal .rp-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  color: #fff;
  font-size: 0.98rem;
}
.rp-modal .rp-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:14px; }
.rp-modal .btn { padding:10px 14px; border-radius:8px; cursor:pointer; font-weight:600; }
.rp-modal .btn.cancel { background: transparent; border:1px solid rgba(255,255,255,0.06); color: #fff; }
.rp-modal .btn.primary { background: var(--secondary); color: #fff; border: none; box-shadow: 0 8px 28px rgba(139, 92, 246, 0.16); }
.rp-modal .rp-feedback { margin-top:10px; font-size:0.95rem; color: rgba(255,255,255,0.9); }

@media (max-width: 480px) {
  .rp-modal { padding: 16px; }
  .rp-modal h3 { font-size: 1.05rem; }
}

/* High-end modal entrance/exit and backdrop blur */
@keyframes rp-modal-in {
  0% { transform: translateY(8px) scale(0.98); opacity: 0; }
  60% { transform: translateY(-4px) scale(1.02); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes rp-modal-out {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(8px) scale(0.98); opacity: 0; }
}
.rp-modal-overlay {
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  backdrop-filter: blur(6px) saturate(120%);
  transition: opacity 220ms ease;
  opacity: 1;
}
.rp-modal { animation: rp-modal-in 260ms cubic-bezier(.2,.9,.2,1); }
.rp-modal.hide { animation: rp-modal-out 200ms ease forwards; }

/* Buttons subtle hover */
.rp-modal .btn.primary { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.rp-modal .btn.primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(139,92,246,0.35); }
.rp-modal .btn.cancel { transition: background 0.12s ease, color 0.12s ease; }
.rp-modal .btn.cancel:hover { background: rgba(255,255,255,0.02); }

/* Accessibility: visible focus */
.rp-modal .rp-input:focus, .rp-modal .btn:focus { outline: 3px solid rgba(0,212,255,0.18); outline-offset: 3px; }

/* Section Highlighting for Step-by-Step Guidance */
.section-highlight {
    position: relative;
    border: 3px solid #84cc16 !important;
    background: rgba(132, 204, 22, 0.1) !important;
    border-radius: 15px !important;
    transform: scale(1.02);
    z-index: 1000;
    transition: all 0.3s ease;
}

.section-highlight::before {
    content: '👆 Current Step';
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #84cc16, #10b981);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    animation: indicatorBounce 1.5s ease-in-out infinite;
    z-index: 1001;
}

@keyframes sectionHighlightPulse {
    0%, 100% {
        box-shadow:
            0 0 30px rgba(132, 204, 22, 0.8),
            0 0 60px rgba(132, 204, 22, 0.6),
            0 0 90px rgba(132, 204, 22, 0.4);
        transform: scale(1.02);
    }
    50% {
        box-shadow:
            0 0 50px rgba(132, 204, 22, 1),
            0 0 100px rgba(132, 204, 22, 0.8),
            0 0 150px rgba(132, 204, 22, 0.6);
        transform: scale(1.05);
    }
}

@keyframes indicatorBounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Enhanced Scroll Indicator */
.scroll-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(132, 204, 22, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(132, 204, 22, 0.4);
    animation: scrollIndicatorPulse 1.5s ease-in-out infinite;
    z-index: 1000;
}

@keyframes scrollIndicatorPulse {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Mobile performance overrides: reduce blur/shadows on global UI */
@media (max-width: 768px), (pointer: coarse) {
  .accent-section { box-shadow: none !important; }
  .scroll-indicator { box-shadow: none !important; animation: none !important; }
  .section-highlight { box-shadow: none !important; animation: none !important; transform: none !important; }
  .section-highlight::before { box-shadow: none !important; animation: none !important; }
  .rp-modal-overlay { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .rp-modal { box-shadow: none !important; }
}
