/* Modal Styles */
.modal{
  position:fixed;
  inset:0;
  z-index:1000;
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
}

.modal.active{
  display:flex;
}

.modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,0.8);
  backdrop-filter:blur(4px);
}

.modal-content{
  position:relative;
  background:linear-gradient(180deg,rgba(255,255,255,0.08),rgba(255,255,255,0.04));
  backdrop-filter:blur(16px) saturate(120%);
  border:1px solid rgba(255,255,255,0.12);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  width:min(500px,90vw);
  max-height:85vh;
  overflow-y:auto;
}

.modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:20px 24px;
  border-bottom:1px solid rgba(255,255,255,0.08);
}

.modal-header h3{
  margin:0;
  font-size:18px;
  font-weight:700;
}

.modal-close{
  background:none;
  border:none;
  color:var(--muted);
  font-size:24px;
  cursor:pointer;
  padding:4px;
  border-radius:6px;
  transition:all .2s ease;
}

.modal-close:hover{
  background:rgba(255,255,255,0.1);
  color:var(--text);
}

.modal-body{
  padding:16px 24px;
}

.modal-footer{
  display:flex;
  gap:12px;
  justify-content:flex-end;
  padding:16px 24px;
  border-top:1px solid rgba(255,255,255,0.08);
}

/* Risk Toggle Section */
.risk-section{
  margin-bottom:16px;
  padding:16px;
  background:rgba(0,0,0,0.2);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:12px;
}

.risk-modes{
  display:flex;
  justify-content:space-between;
  margin-bottom:12px;
  gap:12px;
}

.risk-mode{
  flex:1;
  text-align:center;
  padding:10px;
  border-radius:8px;
  transition:all .2s ease;
  cursor:pointer;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.02);
}

.risk-mode.active{
  background:rgba(0,255,162,0.1);
  border:1px solid rgba(0,255,162,0.3);
}

.risk-mode.risky.active{
  background:rgba(255,92,128,0.1);
  border:1px solid rgba(255,92,128,0.3);
}

.risk-mode-title{
  font-size:14px;
  font-weight:700;
  margin-bottom:4px;
}

.risk-mode-desc{
  font-size:12px;
  color:var(--muted);
  line-height:1.3;
}

.risk-warning{
  background:linear-gradient(135deg,rgba(255,165,0,0.1),rgba(255,69,0,0.08));
  border:1px solid rgba(255,165,0,0.3);
  border-radius:8px;
  padding:12px;
  margin-top:12px;
  display:none;
}

.risk-warning.show{
  display:block;
}

.risk-warning-text{
  font-size:13px;
  color:#ffa500;
  font-weight:600;
  margin:0;
  display:flex;
  align-items:center;
  gap:8px;
}

.risk-multiplier{
  color:#ff5c80;
  font-weight:700;
}

/* Input groups */
.input-group{
  margin-bottom:16px;
}

.input-group label{
  display:block;
  margin-bottom:8px;
  font-weight:600;
  font-size:14px;
}

.input-wrapper{
  position:relative;
  display:flex;
  align-items:center;
}

.input-prefix{
  position:absolute;
  left:12px;
  color:var(--muted);
  font-weight:600;
  z-index:1;
}

.input-wrapper input{
  width:100%;
  padding:12px 12px 12px 28px;
  background:rgba(0,0,0,0.3);
  border:1px solid rgba(255,255,255,0.12);
  border-radius:10px;
  color:var(--text);
  font-size:16px;
  transition:all .2s ease;
}

.input-wrapper input:focus{
  outline:none;
  border-color:rgba(0,255,162,0.5);
  box-shadow:0 0 0 3px rgba(0,255,162,0.1);
}

.input-help{
  margin-top:6px;
  font-size:12px;
  color:var(--muted);
}

.fee-note{
  color:#ffa500;
}

.error-text{
  color:#ff5c80;
  font-size:12px;
  font-weight:600;
}

/* Trade summary */
.trade-summary{
  background:rgba(0,0,0,0.2);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:10px;
  padding:12px;
  margin-top:12px;
}

.summary-row{
  display:flex;
  justify-content:space-between;
  margin-bottom:8px;
  font-size:14px;
}

.summary-row:last-child{
  margin-bottom:0;
}

.summary-row.total{
  font-weight:700;
  font-size:16px;
  padding-top:8px;
  border-top:1px solid rgba(255,255,255,0.12);
  margin-top:8px;
  margin-bottom:0;
}

/* Holdings info */
.holdings-info{
  background:rgba(0,255,162,0.05);
  border:1px solid rgba(0,255,162,0.2);
  border-radius:10px;
  padding:16px;
  margin-bottom:20px;
}

.info-row{
  display:flex;
  justify-content:space-between;
  margin-bottom:8px;
  font-size:14px;
}

.info-row:last-child{
  margin-bottom:0;
}

/* Character Switch Modal */
.switch-character-info{
  display:flex;
  align-items:center;
  gap:16px;
  background:rgba(0,255,162,0.05);
  border:1px solid rgba(0,255,162,0.2);
  border-radius:12px;
  padding:20px;
  margin-bottom:16px;
}

.switch-avatar{
  font-size:32px;
  width:60px;
  height:60px;
  border-radius:50%;
  background:rgba(0,255,162,0.1);
  border:2px solid rgba(0,255,162,0.3);
  display:flex;
  align-items:center;
  justify-content:center;
}

.switch-details h4{
  margin:0 0 4px;
  font-size:18px;
  font-weight:700;
}

.switch-details p{
  margin:0;
  color:var(--accent);
  font-size:16px;
  font-weight:600;
}

.switch-warning{
  color:var(--muted);
  text-align:center;
  margin:0;
  line-height:1.5;
}

/* Modal button variations */
.btn.primary.buy{
  background:linear-gradient(135deg,rgba(0,255,162,0.3),rgba(0,194,255,0.25));
  border:1px solid rgba(0,255,162,0.6);
  color:#ffffff;
}

.btn.primary.sell{
  background:linear-gradient(135deg,rgba(255,92,128,0.3),rgba(255,92,128,0.25));
  border:1px solid rgba(255,92,128,0.6);
  color:#ffffff;
}

.btn.primary.buy:hover{
  border-color:rgba(0,255,162,0.8);
  box-shadow:0 6px 20px rgba(0,255,162,0.2);
}

.btn.primary.sell:hover{
  border-color:rgba(255,92,128,0.8);
  box-shadow:0 6px 20px rgba(255,92,128,0.2);
}

.btn.primary.risky{
  background:linear-gradient(135deg,rgba(255,92,128,0.3),rgba(255,69,0,0.25));
  border:1px solid rgba(255,92,128,0.6);
}

.btn.primary.risky:hover{
  border-color:rgba(255,92,128,0.8);
  box-shadow:0 6px 20px rgba(255,92,128,0.2);
}