/* Fancy Button Animation */
.btn-fancy {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Pre-sign-in hero styles */
.pre-signin-hero {
  background: linear-gradient(180deg, rgba(2,6,23,0.95), rgba(20,43,90,0.9));
  color: #fff;
  border-radius: 12px;
}
.pre-signin-hero .hero-inner { max-width: 1100px; }
.pre-signin-hero .hero-title { font-size: 2.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.pre-signin-hero .hero-sub { color: rgba(255,255,255,0.9); font-size: 1.05rem; }
.pre-signin-hero .trust-list { list-style: none; padding: 0; margin: 0; display:flex; gap:1rem; color: rgba(255,255,255,0.85); }
.pre-signin-hero .hero-illustration { max-width: 100%; }
.feature-card { background: rgba(255,255,255,0.06); border: none; color: #fff; }
.feature-card h5 { color: #fff; }

@media (max-width: 767px) {
  .pre-signin-hero .hero-title { font-size: 1.6rem; }
  .pre-signin-hero .hero-sub { font-size: 0.95rem; }
}

.btn-fancy::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 50%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.btn-fancy:hover::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0) translate(-50%, -50%);
        opacity: 1;
    }
    100% {
        transform: scale(20, 20) translate(-50%, -50%);
        opacity: 0;
    }
}

/* New animation for buttons */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #fff;
    visibility: hidden;
    transform: scaleX(0);
    transition: all 0.3s ease-in-out;
}

.nav-link:hover::before {
    visibility: visible;
    transform: scaleX(1);
}

.nav-link:hover {
    transform: translateY(-3px);
}

/* General body and container styles */
body,
html {
  height: 100%;
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(270deg, #ff0000, #ffffff, #0000ff);
  background-size: 600% 600%;
  animation: gradientAnimation 20s ease infinite;
  overflow-x: hidden;
}

@keyframes gradientAnimation {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Roulette container */
#rouletteWheel {
  position: relative;
  width: 350px;
  height: 350px;
  margin: 0 auto;
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  background: #222;
  overflow: hidden; /* ensure orb/ball cannot render outside the wheel */
}

#rouletteCanvas {
    width: 350px;
    height: 350px;
}

/* Ball styling */
#ball-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px; /* Adjust as needed */
    height: 300px; /* Adjust as needed */
    margin-top: -150px;
    margin-left: -150px;
    border-radius: 50%;
    transform-origin: center;
  pointer-events: none;
}

.ball {
  position: absolute;
  /* centered; final position is set via JS to ensure exact radius */
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: 0; /* JS will set transform to offset by radius */
    background: radial-gradient(circle at center, gold 60%, darkorange 100%);
    border-radius: 50%;
    box-shadow: 0 0 10px gold;
    z-index: 10;
  will-change: transform; /* smoother animations */
}


/* Floating dollars container */
#dollarsContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  overflow: visible;
  z-index: 5;
}

/* Dollar animation */
.floating-dollar {
  position: absolute;
  width: 30px;
  height: 30px;
  background: radial-gradient(circle at center, gold 60%, darkorange 100%);
  border-radius: 50%;
  box-shadow: 0 0 8px gold;
  animation-name: fall;
  animation-duration: 10s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes fall {
  0% {
    transform: translateY(-50px) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translateY(110vh) rotate(360deg);
    opacity: 0;
  }
}

/* Registration modal background with American wavy flag effect */
.registration-flag-bg {
  position: relative;
  overflow: hidden;
  background-image: linear-gradient(rgba(255,255,255,0.9), rgba(255,255,255,0.9)), 
                    url('https://upload.wikimedia.org/wikipedia/en/thumb/a/a4/Flag_of_the_United_States.svg/1200px-Flag_of_the_United_States.svg.png');
  background-size: cover;
  background-position: center;
  background-size: 200% 100%;
  animation: flagWave 5s linear infinite;
  border-radius: 0.375rem;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

@keyframes flagWave {
  0% {
    background-position: 0% 0%;
  }

  100% {
    background-position: 200% 0%;
  }
}

/* Popup messages - base styles */
.popup-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px 30px;
  border-radius: 10px;
  z-index: 1050;
  text-align: center;
  font-weight: bold;
  font-size: 1.2rem;
  max-height: 90vh; /* Limit height to 90% of viewport height */
  overflow-y: auto; /* Add scroll if content exceeds max-height */
  max-width: 500px; /* Limit width on larger screens */
}

.popup-message.d-none {
  display: none;
}

/* Welcome Popup Messages */
.welcome-popup {
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);
  border: 2px solid #ffca28;
  animation: welcomeEntrance 1s ease-out forwards, welcomeShake 2s ease-in-out 1s infinite alternate;
}

@keyframes welcomeEntrance {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

@keyframes welcomeShake {
  0%, 100% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  25% {
    transform: translate(-50%, -50%) rotate(3deg);
  }
  75% {
    transform: translate(-50%, -50%) rotate(-3deg);
  }
}

/* Winning Popup Messages */
.winning-popup {
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.5), 0 0 40px rgba(255, 215, 0, 0.6);
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.7);
  border: 2px solid #ffca28;
  animation: winningEntrance 1s ease-out forwards, winningPulse 2s ease-in-out 1s infinite alternate;
}
/* Position and style the testimony section */
#testimonySection {
  position: fixed;
  bottom: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 15px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  max-width: 250px;
  z-index: 1100;
}

.testimony h5 {
  margin-top: 0;
}

@keyframes winningEntrance {
  0% {
    transform: translate(-50%, -50%) scale(0.5) rotate(-10deg);
    opacity: 0;
    filter: blur(10px);
  }
  30% {
    transform: translate(-50%, -50%) scale(1.2) rotate(15deg);
    opacity: 1;
    filter: blur(0);
  }
  60% {
    transform: translate(-50%, -50%) scale(0.9) rotate(-8deg);
  }
  80% {
    transform: translate(-50%, -50%) scale(1.1) rotate(5deg);
  }
  100% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
}

@keyframes winningPulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5), 0 0 40px rgba(255, 215, 0, 0.6);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05) rotate(2deg);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.6), 0 0 60px rgba(255, 215, 0, 0.8);
  }
  100% {
    transform: translate(-50%, -50%) scale(1) rotate(-2deg);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5), 0 0 40px rgba(255, 215, 0, 0.6);
  }
}

/* Customer care dropdown */
.customer-care-dropdown {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1100;
}

#customerCareBtn {
  position: relative;
  z-index: 1101;
}

#customerCareOptions {
  display: none;
  position: absolute;
  bottom: 40px;
  right: 0;
  list-style: none;
  padding: 0;
  margin: 0;
  background: white;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  width: 150px;
  z-index: 1100;
}

#customerCareOptions.show {
  display: block;
}

#customerCareOptions li a {
  display: block;
  padding: 8px 12px;
  color: #333;
  text-decoration: none;
  font-weight: 600;
}

#customerCareOptions li a:hover {
  background-color: #0056b3;
  color: white;
}

/* Countdown timer styling */
#countdownTimer {
  font-weight: bold;
  color: #d6336c;
  font-size: 1.5rem;
  text-align: center;
  display: block;
  margin: 10px auto;
  padding: 10px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
  max-width: 220px;
}

/* Flying eagle animation placeholder */
.flying-eagle {
  position: fixed;
  top: 10%;
  left: -100px;
  width: 100px;
  height: 100px;
  background-image: url('https://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/Bald_Eagle_Portrait.jpg/120px-Bald_Eagle_Portrait.jpg');
  background-size: contain;
  background-repeat: no-repeat;
  animation: flyEagle 20s linear infinite;
  z-index: 4;
}

@keyframes flyEagle {
  0% {
    left: -100px;
    top: 10%;
  }

  50% {
    left: 50vw;
    top: 5%;
  }

  100% {
    left: 110vw;
    top: 10%;
  }
}

/* Mobile responsiveness for pop-ups and game */
@media (max-width: 768px) {
  .popup-message {
    width: 90%;
    font-size: 1rem;
    padding: 15px;
  }

  #rouletteWheel {
    width: 300px;
    height: 300px;
  }

  #rouletteCanvas {
    width: 300px;
    height: 300px;
  }

  #ball-orbit {
    width: 250px;
    height: 250px;
    margin-top: -125px;
    margin-left: -125px;
  }
}

@media (max-width: 480px) {
  #rouletteWheel {
    width: 250px;
    height: 250px;
  }

  #rouletteCanvas {
    width: 250px;
    height: 250px;
  }

  #ball-orbit {
    width: 200px;
    height: 200px;
    margin-top: -100px;
    margin-left: -100px;
  }

  /* Keep the ball centered and let JS apply the radial offset so it never leaves the wheel */
  .ball {
    width: 15px;
    height: 15px;
    top: 50%;
    left: 50%;
    margin: 0;
    /* transform is applied from JS to place the ball on the correct orbit radius */
  }
}


/* New animation for default welcome popup */
@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.animated-popup {
  animation: fadeInScale 0.5s ease-out forwards;
}

/* Dashboard Specific Styles */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    background-color: #f0f2f5; /* Light gray background */
}

.sidebar {
    width: 280px;
    background: linear-gradient(135deg, #007bff, #0056b3); /* Blue gradient */
    color: white;
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-card {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    width: 100%;
}

.profile-picture {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.profile-card h3 {
    margin-top: 15px;
    font-size: 1.8rem;
    font-weight: 600;
}

.balance-display {
    font-size: 1.2rem;
    margin-top: 10px;
    font-weight: 500;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    width: 100%;
}

.sidebar-nav li {
    margin-bottom: 10px;
}

.sidebar-nav a,
.sidebar-nav button {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
}

.sidebar-nav a:hover,
.sidebar-nav button:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.sidebar-nav a i,
.sidebar-nav button i {
    margin-right: 10px;
    font-size: 1.3rem;
}

.main-content {
    flex-grow: 1;
    padding: 30px;
    background-color: #f0f2f5;
}

.main-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.main-header h1 {
    font-size: 2.5rem;
    color: #333;
    font-weight: 700;
}

.dashboard-section {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.dashboard-section h2 {
    font-size: 2rem;
    color: #007bff;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
}

.dashboard-section h2 i {
    margin-right: 15px;
    font-size: 2.2rem;
}

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

.profile-info-grid p {
    margin-bottom: 5px;
    font-size: 1.1rem;
    color: #555;
}

.profile-info-grid strong {
    color: #333;
}

/* Wallet Cards */
.wallet-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.wallet-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.wallet-header {
    background-color: #f8f9fa;
    padding: 18px 25px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

.wallet-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
    display: flex;
    align-items: center;
}

.wallet-header h3 i {
    margin-right: 12px;
    color: #007bff;
    font-size: 1.7rem;
}

.dropdown-icon {
    transition: transform 0.3s ease;
    font-size: 1.2rem;
    color: #666;
}

.wallet-header.active .dropdown-icon {
    transform: rotate(180deg);
}

.wallet-content {
    padding: 20px 25px;
    display: none; /* Hidden by default */
    border-top: 1px solid #eee;
    background-color: #fff;
}

.wallet-content.show {
    display: block; /* Shown when active */
    animation: fadeInDown 0.4s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wallet-item {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    background-color: #fdfdfd;
}

.wallet-item h4 {
    font-size: 1.2rem;
    color: #0056b3;
    margin-bottom: 10px;
}

.address-input {
    background-color: #e9ecef;
    cursor: text;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
}

.copy-btn {
    background-color: #007bff;
    color: white;
    border: none;
    transition: background-color 0.2s ease;
}

.copy-btn:hover {
    background-color: #0056b3;
    color: white;
}

/* KYW Form */
.kyw-form .form-label {
    font-weight: 600;
    color: #444;
}

.kyw-form .form-control {
    border-radius: 8px;
    padding: 10px;
}

.kyw-form button[type="submit"] {
    background-color: #28a745;
    border-color: #28a745;
    font-size: 1.1rem;
    padding: 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.kyw-form button[type="submit"]:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

/* Testimony Section */
#userTestimonyFormDashboard textarea {
    border-radius: 8px;
    padding: 10px;
}

#userTestimonyFormDashboard button[type="submit"] {
    background-color: #17a2b8;
    border-color: #17a2b8;
    font-size: 1.1rem;
    padding: 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

#userTestimonyFormDashboard button[type="submit"]:hover {
    background-color: #138496;
    border-color: #117a8b;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .sidebar {
        width: 220px;
        padding: 15px;
    }

    .profile-picture {
        width: 100px;
        height: 100px;
    }

    .profile-card h3 {
        font-size: 1.5rem;
    }

    .balance-display {
        font-size: 1rem;
    }

    .sidebar-nav a,
    .sidebar-nav button {
        font-size: 1rem;
        padding: 10px 12px;
    }

    .sidebar-nav a i,
    .sidebar-nav button i {
        font-size: 1.1rem;
    }

    .main-content {
        padding: 20px;
    }

    .main-header h1 {
        font-size: 2rem;
    }

    .dashboard-section {
        padding: 20px;
    }

    .dashboard-section h2 {
        font-size: 1.7rem;
    }

    .dashboard-section h2 i {
        font-size: 1.8rem;
    }

    .wallet-header h3 {
        font-size: 1.3rem;
    }

    .wallet-header h3 i {
        font-size: 1.5rem;
    }

    .wallet-content {
        padding: 15px;
    }

    .wallet-item h4 {
        font-size: 1.1rem;
    }

    .address-input {
        font-size: 0.85rem;
    }

    .copy-btn {
        font-size: 0.9rem;
        padding: 8px 12px;
    }

    .kyw-form button[type="submit"],
    #userTestimonyFormDashboard button[type="submit"] {
        font-size: 1rem;
        padding: 10px;
    }
}

@media (max-width: 768px) {
    .dashboard-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 15px 0;
        flex-direction: row;
        justify-content: space-around;
        flex-wrap: wrap;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .profile-card {
        width: auto;
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .profile-picture {
        width: 80px;
        height: 80px;
    }

    .profile-card h3 {
        font-size: 1.3rem;
        margin-top: 5px;
    }

    .balance-display {
        font-size: 0.9rem;
        margin-top: 5px;
    }

    .sidebar-nav {
        width: 100%;
        margin-top: 15px;
    }

    .sidebar-nav ul {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
    }

    .sidebar-nav li {
        margin: 5px 10px;
    }

    .sidebar-nav a,
    .sidebar-nav button {
        padding: 8px 10px;
        font-size: 0.8rem;
        border-radius: 5px;
    }

    .sidebar-nav a i,
    .sidebar-nav button i {
        margin-right: 5px;
        font-size: 1rem;
    }

    .main-content {
        padding: 15px;
    }

    .main-header h1 {
        font-size: 1.8rem;
        text-align: center;
    }

    .dashboard-section {
        padding: 15px;
        margin-bottom: 20px;
    }

    .dashboard-section h2 {
        font-size: 1.5rem;
        margin-bottom: 15px;
        justify-content: center;
    }

    .dashboard-section h2 i {
        font-size: 1.6rem;
    }

    .profile-info-grid {
        grid-template-columns: 1fr;
    }

    .wallet-header h3 {
        font-size: 1.2rem;
    }

    .wallet-header h3 i {
        font-size: 1.3rem;
    }

    .wallet-content {
        padding: 15px;
    }

    .wallet-item h4 {
        font-size: 1.1rem;
    }

    .address-input {
        font-size: 0.85rem;
    }

    .copy-btn {
        font-size: 0.9rem;
        padding: 8px 12px;
    }

    .kyw-form button[type="submit"],
    #userTestimonyFormDashboard button[type="submit"] {
        font-size: 1rem;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .sidebar-nav ul {
        flex-direction: column;
        align-items: center;
    }

    .sidebar-nav li {
        width: 90%;
        margin: 5px 0;
    }

    .sidebar-nav a,
    .sidebar-nav button {
        justify-content: center;
    }

    .profile-card {
        flex-direction: column;
    }

    .profile-picture {
        margin-bottom: 10px;
    }

    .profile-card h3,
    .balance-display {
        text-align: center;
    }
}

/* Ensure Tawk.to widget is always visible on all screens */
#tawk-messenger-bubble-container,
#tawk-messenger-chat-panel {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 999999 !important; /* Ensure it's on top */
}

/* Confetti Animation */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 9999;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #f00; /* Default color, will be overridden by JS */
    animation: fall 5s ease-out forwards;
    opacity: 0;
}

@keyframes fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

#loginModal .modal-content {
  position: relative;
  overflow: hidden;
  background-image: linear-gradient(rgba(255,255,255,0.9), rgba(255,255,255,0.9)), 
                    url('https://upload.wikimedia.org/wikipedia/en/thumb/a/a4/Flag_of_the_United_States.svg/1200px-Flag_of_the_United_States.svg.png');
  background-size: cover;
  background-position: center;
  background-size: 200% 100%;
  animation: flagWave 5s linear infinite;
  border-radius: 0.375rem;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.overlay-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.d-none {
    display: none;
}