:root{
  --bg:#0f1724;
  --card:#0b1220;
  --muted:#94a3b8;
  --accent:#60a5fa;
  --danger:#ef4444;
  --positive:#34d399;
}

html,body{
  height:100%;
  margin:0;
  font-family:Inter,system-ui,Segoe UI,Roboto,Helvetica,Arial;
  background:linear-gradient(180deg,#071022 0%,#071026 100%);
  color:#e6eef8;
}

.container{
  max-width:1200px;
  margin:0 auto;
  position:relative;
  padding:20px;
}

header {
  position:relative;
  z-index:2000;
  padding:16px 0;
  border-bottom:1px solid rgba(255,255,255,0.06);
}

.header-container {
  max-width:1200px;
  margin:0 auto;
  padding:0 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  text-decoration: none;

  /* Modern gradient text */
  background: linear-gradient(
    120deg,
    #93c5fd,
    #3b82f6,
    #60a5fa
  );
  background-size: 200% 200%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;

  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1;

  position: relative;

  /* PERMANENT "hover" look */
  transform: translateY(-1px);
  filter: drop-shadow(0 0 18px rgba(96, 165, 250, 0.6));

  /* Smoothness (still useful for page load / state changes) */
  transition: transform 0.25s ease, filter 0.25s ease;

  /* Gradient animation */
  animation: gradientShift 6s ease infinite;
}

/* Accent underline — permanently visible */
.logo::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    #60a5fa,
    transparent
  );
}

/* Gradient animation */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.logo img { 
  height: 40px; 
  width: auto; 
}

.header-right {
  display:flex;
  align-items:center;
  gap:20px;
  flex-shrink:0;
}

.auth-buttons {
  display:flex;
  gap:12px;
}

.login-btn, .signup-btn { 
  padding:9px 18px; 
  background:transparent; 
  color:#e6eef8; 
  font-weight:600; 
  font-size:14px; 
  border:1px solid rgba(255,255,255,0.2); 
  border-radius:12px; 
  cursor:pointer; 
  transition:all .2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.signup-btn {
  background:var(--accent);
  color:#000;
  border:none;
}

.login-btn:hover, .signup-btn:hover {
  opacity:0.9;
}

/* Auth Modals */
.auth-modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 12000;
}

.auth-modal {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  width: 90%;
  max-width: 420px;
  max-height: 90vh;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 24px 48px rgba(0,0,0,0.6);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: relative;
}

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
  z-index: 1;
}

.auth-modal-close:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

.auth-modal h2 {
  font-size: 26px;
  margin: 0 0 8px 0;
  color: #ffffff;
  padding-right: 20px;
}

.auth-modal p {
  color: var(--muted);
  margin-bottom: 24px;
  font-size: 15px;
  padding-right: 20px;
}

.auth-modal form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-grow: 1;
}

.auth-modal .input-group {
  position: relative;
}

.auth-modal input {
  padding: 14px 40px 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: #e6eef8;
  font-size: 15px;
  width: 100%;
  box-sizing: border-box;
}

.auth-modal input::placeholder {
  color: var(--muted);
}

.auth-modal .toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  width: 24px;
  height: 24px;
}

.auth-modal button[type="submit"] {
  padding: 14px;
  background: var(--accent);
  color: #000;
  font-weight: 600;
  font-size: 16px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-modal .switch-link {
  margin-top: 24px;
  color: var(--muted);
  font-size: 14px;
  flex-shrink: 0;
}

.auth-modal .switch-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-modal .switch-link a:hover {
  text-decoration: underline;
}

.auth-modal .error {
  color: var(--danger);
  font-size: 14px;
  margin-top: 8px;
}

.auth-modal .success {
  color: var(--positive);
  font-size: 14px;
  margin-top: 8px;
}

.forgot-link {
  margin-top: 12px;
  font-size: 14px;
}

.forgot-link a {
  color: var(--accent);
  text-decoration: none;
}

.forgot-link a:hover {
  text-decoration: underline;
}

/* Password Strength */
.password-strength {
  height: 6px;
  border-radius: 3px;
  margin-top: 8px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
}

.password-strength-bar {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease, background 0.3s ease;
}

.strength-weak { background: var(--danger); }
.strength-medium { background: orange; }
.strength-strong { background: var(--positive); }

.strength-text {
  font-size: 13px;
  margin-top: 6px;
  color: var(--muted);
}

/* Google Button */
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  background: #ffffff;
  color: #000;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  margin: 20px 0 10px;
  width: 100%;
}

.google-btn img {
  width: 20px;
  height: 20px;
}

.google-btn:hover {
  opacity: 0.9;
}

/* Spinner for loading state */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #000;
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Settings Modals */
.settings-modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 13000;
}

.settings-modal {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  width: 90%;
  max-width: 460px;
  max-height: 90vh;
  padding: 40px;
  box-shadow: 0 24px 48px rgba(0,0,0,0.6);
  overflow-y: auto;
  position: relative;
}

.settings-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
  z-index: 1;
}

.settings-modal-close:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

.settings-modal h2 {
  font-size: 28px;
  margin: 0 0 24px;
  text-align: center;
  padding-right: 20px;
}

.settings-modal form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-modal .input-group {
  position: relative;
}

.settings-modal input {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: #e6eef8;
  font-size: 16px;
  width: 100%;
  box-sizing: border-box;
}

.settings-modal input::placeholder {
  color: var(--muted);
}

.settings-modal .toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
}

.settings-modal button[type="submit"] {
  padding: 14px;
  background: var(--accent);
  color: #000;
  font-weight: 600;
  font-size: 16px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.settings-modal button[type="submit"]:hover {
  opacity: 0.9;
}

.settings-modal .message {
  color: var(--positive);
  text-align: center;
  margin: 16px 0;
  font-weight: 600;
}

.settings-modal .error {
  color: var(--danger);
  text-align: center;
  margin: 16px 0;
  font-weight: 600;
}

.settings-modal .back-link {
  display: block;
  text-align: center;
  margin-top: 24px;
  color: var(--accent);
  text-decoration: none;
  font-size: 15px;
  cursor: pointer;
}

.settings-modal .back-link:hover {
  text-decoration: underline;
}

/* ALL ORIGINAL STYLES BELOW */
.desktop-actions {
  display:flex;
  align-items:center;
  gap:16px;
}

.action-buttons {
  display:flex;
  gap:12px;
}

.deposit-btn,.withdraw-btn { 
  padding:9px 18px;
  background:var(--accent);
  color:#000;
  font-weight:600;
  font-size:14px;
  border:none;
  border-radius:12px;
  cursor:pointer;
  transition:opacity .2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.withdraw-btn {
  background:rgba(255,255,255,0.1);
  color:#e6eef8;
  border:1px solid rgba(255,255,255,0.2);
}

.deposit-btn:hover,.withdraw-btn:hover {
  opacity:0.9;
}

.balance-block { 
  display:flex; 
  align-items:center; 
  justify-content:space-between; 
  padding:10px 14px; 
  background:rgba(255,255,255,0.04); 
  border-radius:12px; 
  border:1px solid rgba(255,255,255,0.08); 
  font-size:13px; 
}

.balance-left {
  display:flex;
  flex-direction:column;
  gap:2px;
}

.balance-main {
  display:flex;
  align-items:baseline;
  gap:6px;
  font-weight:600;
}

.balance-amount {
  font-size:17px;
}

.balance-currency {
  color:var(--muted);
}

.balance-pnl {
  color:var(--danger);
  font-size:12px;
}

.mobile-balance { 
  display:none; 
  min-width:180px; 
  padding:8px 12px; 
  font-size:12px; 
}

.mobile-balance .balance-amount {
  font-size:16px;
}

.user-menu {
  position:relative;
}

.avatar-btn {
  background:none;
  border:none;
  padding:0;
  cursor:pointer;
}

.avatar {
  width:40px;
  height:40px;
  border-radius:50%;
  background:var(--accent);
  color:#000;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  font-size:16px;
  border:2px solid rgba(255,255,255,0.1);
}

.avatar.large {
  width:48px;
  height:48px;
  font-size:18px;
}

.dropdown-menu {
  position:absolute;
  top:56px;
  right:0;
  width:260px;
  background:#0b1220;
  border:1px solid rgba(255,255,255,0.08);
  border-radius:14px;
  box-shadow:0 20px 40px rgba(0,0,0,0.4);
  opacity:0;
  visibility:hidden;
  transform:translateY(-8px);
  transition:all .2s ease;
  z-index:6000;
}

.dropdown-menu.active {
  opacity:1;
  visibility:visible;
  transform:translateY(0);
}

.dropdown-header {
  display:flex;
  align-items:center;
  gap:12px;
  padding:16px;
  border-bottom:1px solid rgba(255,255,255,0.06);
}

.user-info {
  flex:1;
}

.user-name {
  font-weight:600;
  color:#ffffff;
}

.user-email {
  font-size:13px;
  color:var(--muted);
}

.dropdown-items {
  padding:8px 0;
}

.dropdown-item {
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 20px;
  color:#e6eef8;
  text-decoration:none;
  font-size:14px;
  transition:background .2s;
}

.dropdown-item:hover {
  background:rgba(255,255,255,0.06);
}

.dropdown-item.logout {
  color:var(--danger);
  font-weight:600;
}

.mobile-actions { 
  position:fixed; 
  bottom:20px; 
  left:50%; 
  transform:translateX(-50%); 
  display:none; 
  gap:16px; 
  z-index:1000; 
  padding:12px 20px; 
  background:rgba(11,18,32,0.8); 
  backdrop-filter:blur(12px); 
  border:1px solid rgba(255,255,255,0.1); 
  border-radius:30px; 
  box-shadow:0 8px 32px rgba(0,0,0,0.4); 
}

.card{
  background:linear-gradient(180deg,rgba(255,255,255,0.02),rgba(255,255,255,0.01));
  border-radius:12px;
  padding:14px;
  overflow:visible;
  position:relative;
  z-index:1
}

.table-controls{
  background:rgba(0,0,0,0.35);
  backdrop-filter:blur(10px);
  border:1px solid rgba(255,255,255,0.06);
  border-radius:18px;
  padding:16px;
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:14px
}

.search-box{
  flex:1;
  min-width:220px
}

.search-box input{
  width:100%;
  padding:12px 18px;
  border-radius:14px;
  border:none;
  background:rgba(0,0,0,0.45);
  color:#e6eef8;
  font-size:15px;
  outline:none
}

.table-controls select{
  padding:10px 36px 10px 14px;
  border-radius:12px;
  border:none;
  background:rgba(0,0,0,0.45);
  color:#e6eef8;
  cursor:pointer;
  appearance:none;
  background-image:url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='https://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat:no-repeat;
  background-position:right 12px center;
  background-size:12px
}

.table-wrapper{
  overflow-x:auto;
  border-radius:8px;
  -webkit-overflow-scrolling:touch;
}

table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
  min-width:800px;
}

thead th{
  position:sticky;
  top:0;
  background:linear-gradient(180deg,rgba(15,23,38,0.9),rgba(10,15,25,0.9));
  padding:12px;
  text-align:left;
  border-bottom:1px solid rgba(255,255,255,0.03);
  font-weight:600
}

tbody td{
  padding:12px;
  border-bottom:1px solid rgba(255,255,255,0.03);
  vertical-align:middle
}

.sticky-coin{
  position:sticky;
  left:0;
  background:linear-gradient(180deg,#071025,#071021);
  backdrop-filter:blur(6px);
  z-index:8;
  width:220px;
  min-width:220px
}

.coin{
  display:flex;
  gap:10px;
  align-items:center;
  position:relative;
}

.coin img{
  width:32px;
  height:32px;
  border-radius:50%
}

.muted{
  color:var(--muted);
  font-size:12px
}

.positive{
  color:var(--positive)
}

.negative{
  color:var(--danger)
}

.load-more-wrapper{
  display:flex;
  justify-content:center;
  margin-top:22px;
}

#load_more{
  padding:12px 32px;
  font-size:15px;
  font-weight:600;
  color:#e6eef8;
  background:rgba(0,0,0,0.45);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:14px;
  cursor:pointer;
  transition:all 0.25s ease;
  backdrop-filter:blur(8px);
  display: flex;
  align-items: center;
  gap: 8px;
}

#load_more:hover{
  background:rgba(255,255,255,0.08);
  border-color:rgba(96,165,250,0.4);
  box-shadow:0 0 0 2px rgba(96,165,250,0.25);
}

#load_more:active{
  transform:translateY(1px);
}

#back_to_top{
  position:fixed;
  bottom: 100px !important; /* Position above buttons */
  right:26px;
  width:46px;
  height:46px;
  border-radius:50%;
  background:#ffffff;
  color:#000000;
  border:1px solid rgba(255,255,255,0.12);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:10001;
  cursor:pointer;
  font-size:20px;
  font-weight:bold;
  transition:all .25s ease;
}

#back_to_top:hover{
  background:#f0f0f0;
  transform:translateY(-3px);
}

.newsletter-footer{ 
  margin-top:80px; 
  padding:60px 20px; 
  background:#0b1220; 
  text-align:center; 
}

.newsletter-footer h2{
  font-size:28px;
  font-weight:600;
  margin:0 0 16px 0;
  color:#ffffff;
}

.newsletter-form{
  max-width:520px;
  margin:0 auto;
  display:flex;
  height:56px;
  border-radius:12px;
  overflow:hidden;
  background:rgba(255,255,255,0.05);
  border:1px solid rgba(255,255,255,0.08);
}

.newsletter-form input{
  flex:1;
  padding:0 24px;
  background:transparent;
  border:none;
  color:#e6eef8;
  font-size:16px;
  outline:none;
}

.newsletter-form input::placeholder{
  color:#64748b
}

.newsletter-form button{
  padding:0 32px;
  background:var(--accent);
  color:#000000;
  font-weight:600;
  font-size:16px;
  border:none;
  cursor:pointer;
  border-radius:0 0 12px 12px;
  transition:background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.newsletter-form button:hover{
  background:#7bbaff
}

.newsletter-footer .disclaimer{
  margin-top:24px;
  font-size:14px;
  color:#94a3b8;
  line-height:1.5;
}

.newsletter-footer .disclaimer a{
  color:var(--accent);
  text-decoration:none
}

.newsletter-footer .copyright{
  margin-top:40px;
  font-size:14px;
  color:#64748b;
}

.simple-footer{ 
  margin-top:140px; 
  padding:40px 20px; 
  background:#0b1220; 
  text-align:center; 
  font-size:13px; 
  color:#64748b; 
  border-top:1px solid rgba(255,255,255,0.06); 
  display:none; 
}

.simple-footer a{
  color:var(--accent);
  text-decoration:none;
}

.simple-footer a:hover{
  text-decoration:underline;
}

.skeleton-row{
  animation:shimmer 1.2s linear infinite;
  background:linear-gradient(90deg,#08111a,#0b1220,#08111a);
  height:52px;
  border-radius:6px;
  margin-bottom:8px
}

@keyframes shimmer{
  0%{
    background-position:-200px 0
  }
  100%{
    background-position:200px 0
  }
}

@keyframes blink {
  0%{
    opacity:1;
  }
  50%{
    opacity:0.3;
  }
  100%{
    opacity:1;
  }
}

.blink {
  animation: blink 1s ease-in-out 3;
}

.swap-btn {
  display: none;
  padding: 3px 8px;
  background: var(--accent);
  color: #000;
  font-weight: 600;
  font-size: 11px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity .2s;
  align-self: center;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.swap-btn:hover {
  opacity: 0.9;
}

body.logged-in .swap-btn { 
  display: flex; 
}

/* ==================== UPDATED PROFESSIONAL DEPOSIT MODAL ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  box-sizing: border-box;
}

.modal {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.6);
  position: relative;
  animation: modalSlideIn 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(96, 165, 250, 0.3) rgba(255, 255, 255, 0.05);
}

.modal::-webkit-scrollbar {
  width: 6px;
}

.modal::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.modal::-webkit-scrollbar-thumb {
  background: rgba(96, 165, 250, 0.3);
  border-radius: 3px;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
  z-index: 1;
}

.modal-close:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

.modal-header {
  margin-bottom: 24px;
  text-align: left;
}

.modal-header h3 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-header h3 i {
  color: var(--accent);
  font-size: 22px;
}

.modal-header p {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.modal-body {
  text-align: left;
}

.network-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.network-warning i {
  color: #f59e0b;
  font-size: 18px;
  margin-top: 2px;
  flex-shrink: 0;
}

.network-warning-content h4 {
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 6px 0;
}

.network-warning-content p {
  color: #f59e0b;
  font-size: 13px;
  margin: 0;
  line-height: 1.4;
}

.amount-display {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(59, 130, 246, 0.05));
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  text-align: center;
}

.amount-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.amount-value {
  font-size: 32px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.amount-value span {
  background: linear-gradient(90deg, #60a5fa, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.amount-sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

.qr-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  text-align: center;
}

.qr-container {
  margin: 0 auto 20px;
  width: 200px;
  height: 200px;
  background: #ffffff;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.qr-container img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.qr-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.qr-btn {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: #e6eef8;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.qr-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(96, 165, 250, 0.3);
}

.qr-btn.download {
  background: var(--accent);
  color: #000;
  border: none;
}

.qr-btn.download:hover {
  opacity: 0.9;
}

.address-section {
  margin-bottom: 24px;
}

.address-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.address-label span {
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
}

.address-label small {
  color: var(--muted);
  font-size: 12px;
}

.address-display {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px 60px 16px 16px;
  font-family: 'Courier New', monospace;
  font-size: 15px;
  word-break: break-all;
  color: #ffffff;
  line-height: 1.4;
  max-height: 80px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(96, 165, 250, 0.3) transparent;
}

.address-display::-webkit-scrollbar {
  width: 4px;
}

.address-display::-webkit-scrollbar-track {
  background: transparent;
}

.address-display::-webkit-scrollbar-thumb {
  background: rgba(96, 165, 250, 0.3);
  border-radius: 2px;
}

.copy-btn-absolute {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s ease;
}

.copy-btn-absolute:hover {
  opacity: 0.9;
  transform: translateY(-50%) scale(1.05);
}

.copy-feedback {
  color: var(--positive);
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
  text-align: center;
  animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0; }
  20%, 80% { opacity: 1; }
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.info-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.info-item i {
  font-size: 20px;
  color: var(--accent);
  margin-bottom: 8px;
  display: block;
}

.info-item h5 {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 4px 0;
}

.info-item p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
  line-height: 1.3;
}

.modal-footer {
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.terms {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.4;
}

.terms a {
  color: var(--accent);
  text-decoration: none;
}

.terms a:hover {
  text-decoration: underline;
}

.action-buttons {
  display: flex;
  gap: 12px;
}

.action-btn {
  flex: 1;
  padding: 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
  border: none;
}

.action-btn.primary {
  background: var(--accent);
  color: #000;
}

.action-btn.primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(96, 165, 250, 0.3);
}

.action-btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #e6eef8;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.action-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.action-btn i {
  font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .modal {
    padding: 24px;
    max-height: 95vh;
  }
  
  .modal-header h3 {
    font-size: 22px;
  }
  
  .amount-value {
    font-size: 28px;
  }
  
  .qr-container {
    width: 180px;
    height: 180px;
    padding: 14px;
  }
  
  .qr-actions {
    flex-direction: column;
  }
  
  .qr-btn {
    width: 100%;
    justify-content: center;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .address-display {
    padding: 14px 56px 14px 14px;
    font-size: 14px;
  }
  
  .copy-btn-absolute {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .action-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .modal {
    padding: 20px;
    border-radius: 20px;
  }
  
  .modal-close {
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
  }
  
  .modal-header h3 {
    font-size: 20px;
  }
  
  .amount-value {
    font-size: 24px;
  }
  
  .qr-container {
    width: 160px;
    height: 160px;
    padding: 12px;
  }
  
  .network-warning {
    padding: 14px;
  }
}

/* Ensure no horizontal scroll */
.modal * {
  max-width: 100%;
  box-sizing: border-box;
}

/* Smooth scrolling for iOS */
.modal {
  -webkit-overflow-scrolling: touch;
}

.list-modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 11000;
}

.list-modal {
  background: #0b1220;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  width: 90%;
  max-width: 640px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0,0,0,0.6);
}

.list-modal-header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.list-modal-title {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
}

.list-modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 28px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.list-modal-close:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

.list-modal-body {
  padding: 20px 28px;
  max-height: 70vh;
  overflow-y: auto;
}

.list-modal-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.list-modal-item:last-child {
  border-bottom: none;
}

.list-modal-item img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.list-modal-name {
  flex: 1;
  font-weight: 600;
  font-size: 16px;
}

.list-modal-price {
  color: var(--muted);
  font-size: 15px;
}

.list-modal-change {
  font-size: 15px;
  text-align: right;
  min-width: 80px;
}

.market-summary { 
  margin-bottom: 24px; 
}

body.logged-in .market-summary { 
  display: none; 
}

.market-stats { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 16px; 
  margin-bottom: 16px; 
}

.market-stat { 
  background: rgba(255,255,255,0.04); 
  border: 1px solid rgba(255,255,255,0.08); 
  border-radius: 12px; 
  padding: 16px; 
}

.market-stat-value { 
  font-size: 22px; 
  font-weight: 700; 
}

.market-stat-label { 
  font-size: 13px; 
  color: var(--muted); 
  margin-top: 4px; 
}

.market-change { 
  font-size: 14px; 
  margin-top: 8px; 
}

.trending-gainers-wrapper { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 16px; 
}

.trending-gainers { 
  background: rgba(255,255,255,0.04); 
  border: 1px solid rgba(255,255,255,0.08); 
  border-radius: 12px; 
  padding: 16px; 
}

.section-title { 
  font-size: 15px; 
  font-weight: 600; 
  margin-bottom: 12px; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  color: #ffffff; 
}

.section-title a { 
  font-size: 12px; 
  color: var(--accent); 
  text-decoration: none; 
  cursor: pointer; 
}

.coin-item { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
  margin-bottom: 10px; 
  font-size: 14px; 
}

.coin-item img { 
  width: 24px; 
  height: 24px; 
  border-radius: 50%; 
}

.coin-name { 
  flex: 1; 
  font-weight: 600; 
}

.coin-price { 
  color: var(--muted); 
}

.coin-change { 
  font-size: 13px; 
  margin-left: auto; 
}

.news-widget { 
  margin-top: 32px; 
  padding: 0; 
  display: block; 
}

body.logged-in .news-widget { 
  display: none; 
}

.news-widget-header {
  padding: 24px 24px 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.news-title h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 12px;
}

.news-title p {
  margin: 4px 0 0 0;
  color: var(--muted);
  font-size: 14px;
}

.news-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

#newsCategory {
  padding: 10px 36px 10px 16px;
  border-radius: 12px;
  border: none;
  background: rgba(0,0,0,0.45);
  color: #e6eef8;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='https://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
  font-size: 14px;
}

.refresh-news {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.refresh-news:hover {
  background: rgba(96,165,250,0.15);
  transform: scale(1.05);
}

.news-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
  padding: 0 24px 24px 24px;
}

.news-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.news-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  border-color: rgba(96,165,250,0.3);
}

.news-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.news-item h4 {
  margin: 0 0 12px 0;
  font-size: 17px;
  line-height: 1.4;
  color: #ffffff;
  flex-grow: 1;
}

.news-item p {
  margin: 0 0 16px 0;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.news-sentiment {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.sentiment-positive { 
  color: var(--positive); 
}

.sentiment-negative { 
  color: var(--danger); 
}

.sentiment-neutral { 
  color: var(--muted); 
}

.read-more {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s ease;
}

.read-more:hover {
  gap: 10px;
}

.news-skeleton {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.skeleton-news-item {
  height: 200px;
  background: linear-gradient(90deg, #08111a, #0b1220, #08111a);
  border-radius: 16px;
  animation: shimmer 1.5s linear infinite;
}

.news-footer {
  padding: 20px 24px 28px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.view-all-news {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 12px;
  background: rgba(96,165,250,0.1);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-all-news:hover {
  background: rgba(96,165,250,0.2);
}

.stats-section {
  margin: 60px 0;
}

.stats-title {
  font-size: 32px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 40px;
  background: linear-gradient(90deg, #ffffff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stats-wrapper {
  position: relative;
}

.stats-container {
  display: flex;
  overflow-x: auto;
  gap: 24px;
  padding: 20px 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.stats-container::-webkit-scrollbar {
  display: none;
}

.stats-container {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.stat-box {
  background-color: var(--card);
  border-radius: 24px;
  padding: 24px 32px;
  text-align: center;
  min-width: 220px;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.stat-box:nth-child(1) { background-color: #065f46; }
.stat-box:nth-child(2) { background-color: #4c1d95; }
.stat-box:nth-child(3) { background-color: #1e40af; }
.stat-box:nth-child(4) { background-color: #702459; }

.stat-value {
  font-size: 36px;
  font-weight: 800;
  color: #a5f3fc;
  margin-bottom: 8px;
}

.stat-title {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 8px;
}

.stat-sub {
  font-size: 14px;
  color: #a78bfa;
}

.nav-arrows {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}

.nav-left {
  left: 10px;
}

.nav-right {
  right: 10px;
}

.hero {
  padding: 100px 20px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  margin: 0 0 20px 0;
  line-height: 1.2;
  background: linear-gradient(90deg, #ffffff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 20px;
  color: #cbd5e1;
  max-width: 680px;
  margin: 0 auto 40px auto;
  line-height: 1.5;
}

.hero-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-btn {
  padding: 14px 32px;
  font-size: 17px;
  font-weight: 600;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.hero-btn-primary {
  background: var(--accent);
  color: #000;
  border: none;
}

.hero-btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-3px);
}

.hero-btn-secondary {
  background: transparent;
  color: #e6eef8;
  border: 1px solid rgba(255,255,255,0.2);
}

.hero-btn-secondary:hover {
  background: rgba(255,255,255,0.08);
  transform: translateY(-3px);
}

body.logged-in .hero { 
  display: none; 
}

@media (max-width: 768px) {
  .hero {
    padding: 80px 20px 60px;
  }
  
  .hero h1 {
    font-size: 36px;
  }
  
  .hero p {
    font-size: 18px;
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .hero-btn {
    width: 100%;
    max-width: 300px;
  }
  
  .stats-section {
    margin: 40px 0;
  }
  
  .stats-title {
    font-size: 28px;
  }
  
  .nav-arrows {
    display: flex;
  }
  
  .stat-box {
    min-width: 180px;
    padding: 20px 24px;
  }
  
  .stat-value {
    font-size: 32px;
  }
}

#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 0;
}

@media (max-width: 768px) {
  .market-stats { 
    grid-template-columns: 1fr; 
  }
  
  .trending-gainers-wrapper { 
    grid-template-columns: 1fr; 
  }
  
  .header-container {
    padding:0 12px;
  }
  
  .logo img {
    height: 36px;
  }
  
  .desktop-actions {
    display:none !important;
  }
  
  .mobile-balance {
    display:flex;
  }
  
  .mobile-actions.logged-in {
    display:flex;
  }
  
  .avatar {
    width:36px;
    height:36px;
    font-size:15px;
  }
  
  table th:nth-child(1), table td:nth-child(1) {
    display:none;
  }
  
  .container {
    padding:12px 0;
  }
  
  .card {
    padding:14px 0;
  }
  
  .table-wrapper {
    width:100vw;
    margin-left:-12px;
    padding:0 12px;
    box-sizing:border-box;
  }
  
  .swap-btn { 
    padding: 2px 6px; 
    font-size: 10px; 
    border-radius: 5px; 
  }
  
  .news-widget-header { 
    padding: 20px 16px 0 16px; 
    flex-direction: column; 
    align-items: stretch; 
    gap: 16px; 
  }
  
  .news-controls { 
    justify-content: space-between; 
    width: 100%; 
  }
  
  #newsCategory { 
    flex: 1; 
  }
  
  .news-container { 
    grid-template-columns: 1fr; 
    padding: 0 16px 20px 16px; 
  }
  
  .news-footer { 
    padding: 16px; 
    flex-direction: column; 
    gap: 16px; 
    text-align: center; 
  }
  
  .skeleton-news-item { 
    height: 180px; 
  }
  
  .list-modal { 
    width: 95%; 
  }
  
  .list-modal-header { 
    padding: 20px 20px 12px; 
  }
  
  .list-modal-body { 
    padding: 16px 20px; 
  }
}

@media (max-width: 640px){
  .table-controls{
    padding:12px;
    border-radius:12px
  }
  
  table{
    min-width:700px
  }
}

@media(max-width:900px){
  .sticky-coin{
    width:160px;
    min-width:160px
  }
}

@media (max-width: 600px){
  .newsletter-form{
    flex-direction:column;
    height:auto
  }
  
  .newsletter-form input{
    border-radius:12px 12px 0 0;
    padding:18px 24px
  }
  
  .newsletter-form button{
    border-radius:0 0 12px 12px;
    padding:18px
  }
}

@media (max-width: 768px) {
  #coins-table td:nth-child(4) {
    white-space: nowrap;
    vertical-align: middle;
  }
}

/* Settings Submenu - Click to Open Below (Mobile & Desktop Friendly) */
#settingsSubmenu {
  display: none;
  background: #0b1220;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  padding: 8px 0;
  margin-top: 8px;
  width: 100%;
  position: relative;
  left: 0;
}

#settingsSubmenu.active {
  display: block;
}

.submenu-item {
  display: block;
  padding: 14px 24px; /* Increased touch target */
  color: #e6eef8;
  text-decoration: none;
  font-size: 15px;
  transition: background 0.2s;
  touch-action: manipulation; /* Better mobile tap response */
  cursor: pointer;
}

.submenu-item:hover,
.submenu-item:active {
  background: rgba(255,255,255,0.06);
}

/* Arrow indicator */
#settingsTrigger::after {
  content: '▼';
  margin-left: 8px;
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.2s ease;
}

#settingsTrigger.active::after {
  content: '▲';
  transform: rotate(180deg);
}

/* ==================== REAL SUPPORT SYSTEM CSS ==================== */

/* Support Modal Styles - IMPROVED FOR BETTER FIT */
.support-modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 14000;
  padding: 10px;
  box-sizing: border-box;
}

.support-modal {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  width: 95%;
  max-width: 800px;
  height: 90vh;
  max-height: 90vh;
  padding: 0;
  box-shadow: 0 24px 48px rgba(0,0,0,0.6);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.support-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
  z-index: 10;
}

.support-modal-close:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

.support-tabs {
  display: flex;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 0;
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.support-tabs::-webkit-scrollbar {
  display: none;
}

.support-tab {
  flex: 1;
  min-width: 120px;
  padding: 18px 12px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.support-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: linear-gradient(to bottom, rgba(96,165,250,0.05), transparent);
}

.support-tab:hover:not(.active) {
  color: #ffffff;
  background: rgba(255,255,255,0.03);
}

.support-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  min-height: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.support-tab-content {
  display: none;
  height: 100%;
  animation: fadeIn 0.3s ease;
  flex: 1;
  overflow: hidden;
}

.support-tab-content.active {
  display: flex;
  flex-direction: column;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* My Tickets Tab */
.tickets-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.tickets-header h3 {
  margin: 0;
  font-size: 20px;
  color: #ffffff;
}

.tickets-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
}

.stat-badge.open {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

.stat-badge.in-progress {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}

.stat-badge.closed {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.3);
  color: #34d399;
}

.tickets-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.ticket-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 18px;
  transition: all 0.3s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.ticket-item:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(96,165,250,0.3);
  transform: translateY(-2px);
}

.ticket-item.unread {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
}

.ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.ticket-title {
  font-weight: 600;
  font-size: 16px;
  color: #ffffff;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ticket-id {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  background: rgba(96,165,250,0.1);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  margin-left: 8px;
}

.ticket-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.ticket-status-open {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.ticket-status-in_progress {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.ticket-status-resolved, .ticket-status-closed {
  background: rgba(34, 197, 94, 0.15);
  color: #34d399;
}

.ticket-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 13px;
  flex-wrap: wrap;
  gap: 8px;
}

.ticket-category {
  color: var(--muted);
  background: rgba(255,255,255,0.05);
  padding: 4px 10px;
  border-radius: 10px;
}

.ticket-date {
  color: var(--muted);
}

.ticket-unread {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
}

.unread-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.loading-tickets, .loading-chat {
  text-align: center;
  padding: 60px 0;
  color: var(--muted);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.loading-tickets .spinner, .loading-chat .spinner {
  margin: 0 auto 16px;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
}

.no-tickets, .no-chat-selected {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.no-tickets i, .no-chat-selected i {
  font-size: 48px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.no-tickets h4, .no-chat-selected h4 {
  color: #ffffff;
  margin: 0 0 8px 0;
}

.no-tickets p, .no-chat-selected p {
  margin: 0 0 24px 0;
}

.create-first-ticket {
  padding: 12px 24px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.2s;
}

.create-first-ticket:hover {
  opacity: 0.9;
}

/* New Ticket Tab */
#newticketTab {
  overflow-y: auto;
}

.tab-description {
  color: var(--muted);
  margin: 0 0 24px 0;
  font-size: 14px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: #e6eef8;
  font-size: 15px;
  box-sizing: border-box;
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(96,165,250,0.2);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='https://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 44px;
}

.char-count {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.char-count.warning {
  color: #f59e0b;
}

.char-count.error {
  color: #ef4444;
}

.form-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: rgba(96,165,250,0.1);
  border-radius: 8px;
  margin: 20px 0;
  font-size: 13px;
  color: #60a5fa;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.btn-secondary {
  padding: 12px 24px;
  background: rgba(255,255,255,0.05);
  color: #e6eef8;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
}

.form-actions button[type="submit"] {
  padding: 12px 32px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.2s;
}

.form-actions button[type="submit"]:hover {
  opacity: 0.9;
}

/* Chat Tab - UPDATED: Changed from X icon to "Close Ticket" text button */
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.chat-header h3 {
  margin: 0;
  font-size: 18px;
  color: #ffffff;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticket-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-badge {
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* UPDATED: Changed from icon-only button to text button */
.close-ticket-btn {
  padding: 8px 16px;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}

.close-ticket-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

.close-ticket-btn:active {
  transform: translateY(0);
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: rgba(255,255,255,0.1);
  color: #ffffff;
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.chat-message {
  display: flex;
  gap: 12px;
  max-width: 80%;
  animation: slideIn 0.3s ease;
  flex-shrink: 0;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-message.agent {
  align-self: flex-start;
}

.chat-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 4px;
}

.chat-message.agent .message-avatar {
  background: #8b5cf6;
  color: #ffffff;
}

.chat-message.user .message-avatar {
  background: #34d399;
  color: #000;
}

.message-bubble {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px 16px;
  position: relative;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.chat-message.user .message-bubble {
  background: rgba(96,165,250,0.15);
  border-color: rgba(96,165,250,0.3);
}

.chat-message.agent .message-bubble {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.3);
}

.message-sender {
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 4px;
  color: #ffffff;
}

.chat-message.user .message-sender {
  color: #60a5fa;
}

.chat-message.agent .message-sender {
  color: #8b5cf6;
}

.message-text {
  color: #ffffff;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 6px;
  word-break: break-word;
}

.message-time {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}

.chat-input-area {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 16px;
  flex-shrink: 0;
}

.chat-input {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.chat-input textarea {
  flex: 1;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: #e6eef8;
  font-size: 14px;
  resize: none;
  font-family: inherit;
  transition: border-color 0.2s;
  min-height: 56px;
  max-height: 120px;
  box-sizing: border-box;
}

.chat-input textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(96,165,250,0.2);
}

.chat-input textarea::placeholder {
  color: var(--muted);
}

.chat-input button {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--accent);
  color: #000;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-input button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-input button:not(:disabled):hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.chat-notice {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  flex-shrink: 0;
}

/* Error/Success Messages */
.error, .success {
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  margin: 16px 0;
  flex-shrink: 0;
}

.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #34d399;
}

/* Responsive */
@media (max-width: 768px) {
  .support-modal {
    width: 98%;
    height: 95vh;
    max-height: 95vh;
    border-radius: 16px;
  }
  
  .support-modal-overlay {
    padding: 5px;
  }
  
  .support-tabs {
    padding: 0;
  }
  
  .support-tab {
    font-size: 12px;
    padding: 14px 8px;
    gap: 6px;
    min-width: 100px;
  }
  
  .support-content {
    padding: 16px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .tickets-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .tickets-stats {
    width: 100%;
    justify-content: space-between;
  }
  
  .chat-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .ticket-status {
    width: 100%;
    justify-content: space-between;
  }
  
  .close-ticket-btn {
    padding: 6px 12px;
    font-size: 13px;
  }
  
  .chat-message {
    max-width: 90%;
  }
  
  .message-bubble {
    max-width: calc(100% - 44px);
  }
}

@media (max-width: 480px) {
  .support-modal {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .support-modal-overlay {
    padding: 0;
  }
  
  .support-tab {
    font-size: 11px;
    padding: 12px 6px;
    gap: 4px;
    min-width: 90px;
  }
  
  .support-content {
    padding: 12px;
  }
  
  .tickets-header h3 {
    font-size: 18px;
  }
  
  .chat-header h3 {
    font-size: 16px;
  }
  
  .ticket-item {
    padding: 14px;
  }
  
  .ticket-title {
    font-size: 14px;
  }
  
  .close-ticket-btn {
    padding: 5px 10px;
    font-size: 12px;
    gap: 4px;
  }
  
  .chat-input textarea {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 13px;
  }
  
  .chat-input button {
    width: 48px;
    height: 48px;
  }
  
  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 12px 14px;
    font-size: 14px;
  }
}

/* Prevent horizontal scroll on mobile */
.support-modal * {
  max-width: 100%;
}

/* Ensure proper scrolling on iOS */
.support-content {
  -webkit-overflow-scrolling: touch;
}

.chat-messages {
  -webkit-overflow-scrolling: touch;
}

.tickets-list {
  -webkit-overflow-scrolling: touch;
}

/* Hide "RookSwap" text next to logo when logged in on mobile */
@media (max-width: 768px) {
  body.logged-in .logo span {
    display: none;
  }
  
  body.logged-in .logo {
    gap: 0; /* Remove gap since we only have the image */
  }
  
  /* Optionally make the logo image a bit larger to compensate */
  body.logged-in .logo img {
    height: 42px; /* Slightly larger since we have more space */
  }
  
  /* Adjust header layout for logged in state */
  body.logged-in .header-container {
    gap: 8px;
  }
  
  /* Ensure mobile balance and user menu have enough space */
  body.logged-in .mobile-balance {
    padding: 10px 14px;
  }
  
  body.logged-in .user-menu {
    flex-shrink: 0;
  }
  
  /* Make sure the dropdown stays within viewport */
  body.logged-in .dropdown-menu {
    right: 0;
    left: auto;
    width: 260px;
    max-width: calc(100vw - 24px);
  }
}

/* Simple mobile modal offset */
@media (max-width: 768px) {
  .modal,
  .support-modal {
    margin-top: 10px; /* Push modal down below browser UI */
    transform: translateY(0);
    height: calc(100% - 10px); /* Adjust height to account for offset */
  }
}