/* TempMy Inbox Pages (rebuilt) */
/* Scoped to .tmx-* to avoid affecting other pages. */

#tm-toast-container{
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  pointer-events: none;
}
#tm-toast-container .tmx-toast{ pointer-events: auto; }
:dir(rtl) #tm-toast-container{
  left: auto;
  right: 16px;
  align-items: flex-end;
}

/* Force LTR rendering for emails/domains inside RTL UI */
.tmx-ltr{
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
}

.tmx-inbox{
  padding: 18px 0 54px;
}

.tmx-inbox-app{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 22px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
  overflow: hidden;
}

.tmx-inbox-app__top{
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(var(--tm-primary-rgb,255,165,0), .10);
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.tmx-inbox-app__title{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 15px;
}

.tmx-inbox-app__meta{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tmx-pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.05);
  font-size: 12px;
  line-height: 1;
}
.tmx-pill__label{ opacity: .75; }
.tmx-pill__value{ font-weight: 800; }

.tmx-inbox-grid{
  display: grid;
  gap: 14px;
  padding: 14px;
  grid-template-columns: 1fr;
}

@media (min-width: 992px){
  .tmx-inbox-app.is-free .tmx-inbox-grid{
    grid-template-columns: 1fr 1.35fr;
    align-items: start;
  }
  .tmx-inbox-app.is-pro .tmx-inbox-grid{
    grid-template-columns: 320px 1fr 1.35fr;
    align-items: start;
  }
}

.tmx-card{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 18px;
  background: rgba(255,255,255,.92);
  overflow: hidden;
}

.tmx-card__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.tmx-card__title{
  font-weight: 800;
  font-size: 14px;
}

.tmx-card__meta{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(0,0,0,.55);
}

.tmx-card__body{
  padding: 12px;
}

.tmx-email-field{ width: 100%; }

.tmx-email-input{
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
}

.tmx-actions,
.tmx-toolbar{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tmx-toolbar{ align-items: center; }

.tmx-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: rgba(0,0,0,.05);
  color: inherit;
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  text-decoration: none !important;
}

.tmx-btn i{ font-size: 14px; }

.tmx-btn--primary{
  background: var(--tm-primary, var(--color1,#ffa500));
  color: var(--tm-on-primary, #111);
  border-color: rgba(0,0,0,.08);
}

.tmx-btn--ghost{
  background: #fff;
  border-color: rgba(0,0,0,.12);
}

.tmx-btn--danger{
  background: #fff;
  border-color: rgba(220,53,69,.55);
  color: #dc3545;
}

.tmx-btn--block{
  width: 100%;
  justify-content: center;
}

.tmx-btn:disabled{
  opacity: .6;
  cursor: not-allowed;
}

/* Loading state (used by refresh buttons while fetching) */
.tmx-btn.is-loading{
  opacity: .85;
  pointer-events: none;
}
.tmx-btn.is-loading::after{
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,.22);
  border-top-color: rgba(0,0,0,.65);
  display: inline-block;
  animation: tmx-spin .7s linear infinite;
}
.tmx-btn--primary.is-loading::after{
  border-color: rgba(255,255,255,.35);
  border-top-color: rgba(255,255,255,.9);
}

@keyframes tmx-spin{
  from{ transform: rotate(0deg); }
  to{ transform: rotate(360deg); }
}

.tmx-select,
.tmx-input{
  height: 44px;
  padding: 0 12px;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
}

.tmx-input{ width: 140px; }

.tmx-toggle{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 44px;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  position: relative;
  cursor: pointer;
}

.tmx-toggle input{
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.tmx-toggle__ui{
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: rgba(0,0,0,.14);
  position: relative;
  flex-shrink: 0;
}

.tmx-toggle__ui:after{
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform .2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

.tmx-toggle input:checked + .tmx-toggle__ui{
  background: rgba(var(--tm-primary-rgb,255,165,0), .65);
}
.tmx-toggle input:checked + .tmx-toggle__ui:after{
  transform: translateX(16px);
}

.tmx-toggle__label{
  font-size: 13px;
  font-weight: 700;
}

.tmx-status{
  margin-top: 10px;
  font-size: 12px;
  color: rgba(0,0,0,.6);
  min-height: 16px;
}

.tmx-alert{
  border: 1px solid rgba(220,53,69,.35);
  background: rgba(220,53,69,.06);
  color: #b02a37;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 10px;
}

.tmx-alert__row{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.tmx-alert__msg{
  flex: 1;
  font-weight: 800;
}

.tmx-alert__hint{
  margin-top: 6px;
  font-size: 12px;
  color: rgba(176,42,55,.92);
}

.tmx-btn--sm{
  height: 36px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 13px;
}

.tmx-skeleton{
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.tmx-skel-row{
  height: 56px;
  border-radius: 14px;
  background: rgba(0,0,0,.06);
  overflow: hidden;
  position: relative;
}

.tmx-skel-row:after{
  content: '';
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: rgba(255,255,255,.45);
  transform: skewX(-20deg);
  animation: tmx-shimmer 1.1s infinite;
}

@keyframes tmx-shimmer{
  0%{ left: -40%; }
  100%{ left: 120%; }
}

.tmx-message-list{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tmx-msg{
  display: block;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.08);
  background: #fff;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.tmx-msg:hover{ background: rgba(0,0,0,.02); }

.tmx-msg__from{
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 2px;
}

.tmx-msg__subject{
  font-size: 13px;
  color: rgba(0,0,0,.75);
}

.tmx-msg__meta{
  margin-top: 6px;
  font-size: 12px;
  color: rgba(0,0,0,.55);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tmx-msg__dot{ opacity: .55; }

.tmx-msg__badge{
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(var(--tm-primary-rgb,255,165,0), .18);
  color: rgba(0,0,0,.78);
  font-weight: 800;
}

:dir(rtl) .tmx-msg__badge{
  right: auto;
  left: 10px;
}

.tmx-msg.is-new{
  border-color: rgba(var(--tm-primary-rgb,255,165,0), .55);
}

/* Focus rings (match global theme) */
.tmx-btn:focus-visible,
.tmx-email-input:focus-visible,
.tmx-select:focus-visible,
.tmx-input:focus-visible{
  outline: none;
  box-shadow: var(--tm-ring, 0 0 0 .2rem rgba(255,165,0,.22));
}
.tmx-toggle:focus-within{
  box-shadow: var(--tm-ring, 0 0 0 .2rem rgba(255,165,0,.22));
}

.tmx-empty{
  text-align: center;
  padding: 16px 10px;
  color: rgba(0,0,0,.6);
}

.tmx-empty__sub{
  margin-top: 6px;
  font-size: 13px;
}

.tmx-empty__address{
  font-weight: 900;
  color: rgba(0,0,0,.78);
  word-break: break-all;
}

.tmx-empty__actions{
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tmx-empty__hint{
  display: block;
  margin-top: 10px;
  font-size: 12px;
  color: rgba(0,0,0,.55);
}

.tmx-empty__icon{
  font-size: 20px;
  margin-bottom: 8px;
  opacity: .7;
}

.tmx-inbox-list{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tmx-inbox-list__item{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #fff;
}

.tmx-inbox-list__item.is-active{
  border-color: rgba(var(--color1-rgb,255,165,0), .55);
}

.tmx-inbox-list__email{
  font-size: 12px;
  font-weight: 800;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tmx-inbox-list__actions{
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* P5 — Pro inbox management (search / quick switch / badges) */
.tmx-inbox-search{
  width: 100%;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.14);
  padding: 0 12px;
  font-size: 13px;
  background: #fff;
}

.tmx-inbox-search:focus{
  outline: none;
  border-color: rgba(var(--color1-rgb,255,165,0), .55);
  box-shadow: 0 0 0 4px rgba(var(--color1-rgb,255,165,0), .18);
}

.tmx-open-inbox-form{
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.tmx-inbox-list__mainBtn{
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: start;
  cursor: pointer;
}

.tmx-inbox-list__mainBtn:disabled{
  cursor: default;
  opacity: .9;
}

.tmx-inbox-list__mainBtn:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px rgba(var(--color1-rgb,255,165,0), .18);
  border-radius: 12px;
}

.tmx-inbox-list__sub{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.tmx-badge{
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(0,0,0,.03);
  color: rgba(0,0,0,.72);
}

.tmx-badge--premium{
  border-color: rgba(var(--color1-rgb,255,165,0), .55);
  background: rgba(var(--color1-rgb,255,165,0), .14);
}

.tmx-inbox-list__expires{
  font-size: 11px;
  color: rgba(0,0,0,.55);
}

.tmx-pro-switch{
  margin-bottom: 10px;
}

@media (min-width: 992px){
  /* Sidebar exists on desktop; keep the switcher for mobile/tablet only */
  .tmx-pro-switch{ display: none; }
}

.tmx-divider{
  height: 1px;
  background: rgba(0,0,0,.08);
  margin: 12px 0;
}

.tmx-muted{
  color: rgba(0,0,0,.55);
  font-size: 12px;
}

#tmProInboxNoResults{
  margin-top: 8px;
  text-align: center;
}

.tmx-chip{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(0,0,0,.1);
  background: rgba(0,0,0,.03);
}

.tmx-field{ margin-bottom: 10px; }
.tmx-label{
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  color: rgba(0,0,0,.65);
}

/* Toast */
.tmx-toast{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,.85);
  color: #fff;
  margin-top: 10px;
  max-width: 420px;
}

.tmx-toast__msg{ font-size: 13px; }
.tmx-toast__close{
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.tmx-toast--success{ background: rgba(25,135,84,.92); }
.tmx-toast--error{ background: rgba(220,53,69,.92); }
.tmx-toast--info{ background: rgba(13,110,253,.92); }

/* Mobile */
@media (max-width: 575.98px){
  .tmx-inbox-app__top{ align-items: flex-start; }

  /* Actions: reduce scrolling while keeping Delete safe */
  .tmx-actions{
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .tmx-actions .tmx-btn{ width: 100%; }
  .tmx-actions .tmx-btn--primary{ grid-column: 1 / -1; }
  .tmx-actions .tmx-btn--danger{ grid-column: 1 / -1; }

  /* Toolbar stays stacked for clarity */
  .tmx-toolbar .tmx-btn,
  .tmx-toolbar .tmx-toggle,
  .tmx-toolbar .tmx-select,
  .tmx-toolbar .tmx-input{ width: 100%; }
  .tmx-toolbar{ align-items: stretch; }
}
