.demo-container {
    position: static;
    max-width: 95vw;
    width: 100%;
    padding-left: 2.5vw;
    padding-right: 2.5vw;
    z-index: 10;
    overflow: hidden;
    margin: auto;
    background-color: transparent;
    border-radius: 20px;
    box-sizing: border-box;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    text-rendering: optimizeLegibility;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

    @keyframes logoAppear {
        0% {
            opacity: 0;
            transform: scale(0.8);
        }
        100% {
            opacity: 1;
            transform: scale(1);
        } 
    }
    
    @keyframes logoPulse {
        0% {
            box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
        }
        70% {
            box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
        }
        100% {
            box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
        }
    }
    
    .demo-content .hiai {
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: "Work Sans", sans-serif;
        font-size: 35px;
        gap: 8px;
        margin-bottom: 20px;
        animation: logoAppear 0.8s ease-out forwards;
    }
    
    .hiai .hi, .hiai .ai {
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 400;
    }
    
    .hiai .hi {
        border: 2px solid #2563eb;
        border-radius: 50%;
        height: 60px;
        width: 60px;
        box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3), 
                    0 0 0 2px rgba(37, 99, 235, 0.1);
        background-color: white;
        color: #2563eb;
        transition: transform 0.3s, box-shadow 0.3s;
        animation: logoPulse 2.5s infinite;
    }
    
    .hiai .hi:hover {
        transform: scale(1.05);
        box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4),
                    0 0 0 3px rgba(37, 99, 235, 0.15);
    }
    
    .hiai .ai {
        color: #2563eb;
        font-weight: 500;
        transition: transform 0.3s;
    }
    
    .hiai:hover .ai {
        transform: translateX(2px);
    }

    /* Inbox header (.ehead h2 .hiai): scoped so it doesn't affect the splash-logo .hiai above. */
    .ehead .hiai {
        font-family: "Work Sans", sans-serif;
    }

/* New Demo Overlay */
    .demo-card {
      position: relative;
      width: 100%;
      max-width: 380px;
      margin: 1rem auto;
      background: #ffffff;
      border-radius: 24px;
      border: 1px solid #e5e7eb;
      box-sizing: border-box;
      transition: 
        max-width 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        margin 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        border-radius 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
    }

    .demo-card.expanded {
      max-width: min(95vw, 2700px);
      height: calc(100vh - 30px);
      margin: 15px auto;
      border-radius: 8px;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
      border-color: transparent;
    }
      
      .demo-card.expanded .demo-badge{
          opacity: 0;
           pointer-events: none;
      }
      .demo-card.hidden{
          visibility: hidden;
        pointer-events: none;
      }
    .demo-badge {
      position: absolute;
      top: -12px;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 6px 12px;
      margin: 0;
      background: #ffffff;
      color: #6b7280;
      font-size: 12px;
      font-weight: 500;
      border-radius: 20px;
      border: 1px solid #e5e7eb;
      opacity: 1;
      transition: opacity 0.2s ease;
      box-sizing: border-box;
    }


    .demo-badge svg {
      width: 12px;
      height: 12px;
    }
@keyframes demo-badge-pulse {
  0%, 100% {
    color: #6b7280;
      opacity: 0.8;
    filter: drop-shadow(0 0 0px transparent);
  }
  50% {
    color: #3b82f6;
      opacity: 1;
    filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.6));
  }
}

.demo-badge svg {
  width: 12px;
  height: 12px;
  animation: demo-badge-pulse 2s ease-in-out infinite;
}
    .demo-content {
      padding: 2.5rem 2rem 2rem;
      margin: 0;
      opacity: 1;
      transition: opacity 0.3s ease;
      box-sizing: border-box;
    }

    .demo-content.hidden {
      opacity: 0;
      pointer-events: none;
    }

    .demo-logo {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      position: absolute;
      margin: 0 0 1.5rem 0;
      padding: 0;
      top: 15px;
      left: 15px;
    }

    .demo-logo-circle {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-family: "Work Sans", sans-serif;
      font-size: 1.2rem;
      border: 1px solid #ccc;
      border-radius: 50px;
      width: 32px;
      height: 32px;
      margin: 0;
      padding: 0;
      text-align: center;
      box-sizing: border-box;
    }

    .demo-header {
      text-align: center;
      margin: 0 0 2rem 0;
      padding: 0;
    }

    .demo-header h2 {
      font-size: 2.2rem;
      font-weight: 600;
      color: #1f2937;
      margin: 20px 0 4px 0;
      padding-top: 5px;
      padding-bottom: 5px;
    }

    .demo-header p {
      font-size: 16px;
      font-weight: 500;
      color: #3b82f6;
      margin: 0;
      padding: 0;
    }

    .demo-divider {
      height: 1px;
      background: #e5e7eb;
      margin: 0 0 1.5rem 0;
      padding: 0;
      border: none;
    }

    .demo-features {
      list-style: none;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 12px;
      margin: 0 0 2rem 0;
      padding: 0;
    }

    .demo-feature-item {
      display: flex;
      align-items: center;
      gap: 12px;
      font-size: 14px;
      color: #1f2937;
      margin: 0;
      padding: 0;
    }

    .demo-feature-icon {
      flex-shrink: 0;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background: #d1fae5;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    .demo-feature-icon svg {
      width: 12px;
      height: 12px;
      color: #059669;
    }

    .demo-cta-button {
      width: 100%;
      padding: 14px 24px;
      margin: 0;
      background: #166fff;
      color: #ffffff;
      font-family: inherit;
      font-size: 16px;
      font-weight: 600;
      border: none;
      border-radius: 12px;
      cursor: pointer;
      transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
      box-sizing: border-box;
    }

    .demo-cta-button:hover:not(:disabled) {
      transform: translateY(-2px);
      background: #2563eb;
      box-shadow: 0 8px 24px -4px rgba(59, 130, 246, 0.4);
    }

    .demo-cta-button:disabled {
      opacity: 0.8;
      cursor: wait;
    }

    /* Spinning loader animation for button */
    @keyframes spin {
      from { transform: rotate(0deg); }
      to { transform: rotate(360deg); }
    }

    .demo-trust-text {
      text-align: center;
      font-size: 12px;
      color: #6b7280;
      margin: 1rem 0 0 0;
      padding: 0;
    }

/* demo page wrapper */
.demo-wrapper{
    min-height: calc(100vh - 80px);
    display: flex;
    justify-content: center;
}
@media(max-width: 1000px){
    .demo-wrapper .demo-container{
        margin-top: 150px;
        margin-bottom: 150px;
    }
}
/* Hide main content initially */
.account-list, .email-list {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.5s ease-out;
}

/* Classes for animated entry */
.account-list.visible {
    opacity: 1;
    transform: translateX(0);
	z-index: 2;
}

/* highlighted steps */
.account-list.visible.tutorial-highlight{
	position: relative; 
	background-color: #fff;
}


.settingbtn.tutorial-highlight {
    position: relative;
    background-color: white;
    pointer-events: auto; 
}




.account-list.tutorial-highlight::after{
	display: none;
}

.email-list.tutorial-highlight::after{
	display: none;
}
.email-content-demo.tutorial-highlight::after{
	display: none;
}
.container.tutorial {
	overflow: visible;
}

.container.tutorial .enav{
	background-color: transparent;
	position: static !important;
}



@media(max-width: 1000px){
    .container.tutorial .email-panel{
        opacity: 0;
        visibility: hidden;
    }
    .container.tutorial.email-open .list-panel{
        opacity: 0;
        visibility: hidden;
    }
    
    .container.tutorial.email-open .email-panel{
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .container.tutorial .email-list::after {
        border-top-right-radius: 10px;
        border-bottom-right-radius: 10px;
    }

}


.container.tutorial .email-content{
	background-color: transparent;
}


.email-list.visible {
    opacity: 1;
    transform: translateX(0);
}
.email-content{
    opacity: 0;
}
.email-content.visible {
    opacity: 1;
}

.container.tutorial {
    position: relative;
}

/* Semi-transparent overlay via pseudo-element */
.container.tutorial .account-list::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    pointer-events: none;
    opacity: 1;
    z-index: 6;
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}
.container.tutorial .email-list::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    pointer-events: none;
    opacity: 1;
    z-index: 6;
}
.container.tutorial .email-panel::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    pointer-events: none;
    opacity: 1;
    z-index: 6;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    max-height: 97vh;
}

/* Highlighted elements and their contents stay above overlay */
.container.tutorial .tutorial-highlight {
    position: relative;
    background: white;
    border-radius: 6px;
    background-color: white;
    z-index: 999;
    pointer-events: auto;
    opacity: 1; 
    transition: opacity 0.3s ease; /* 0.3s transition with 1s delay */
    animation: highlightPulse 3s infinite; /* Animation starts after 1s */
}

.tutorial-enabled {
    transition: opacity 0.3s ease; /* 0.3s transition with 1s delay */
    animation: highlightPulse 3s infinite; /* Animation starts after 1s */
}

.container.tutorial .modal{
    border-radius: 10px;
}

/* Keep tooltip fully visible */
.tutorial-tooltip {
    opacity: 1;
}
.tutorial-tooltip[data-no-transition] {
    transition: none;
}

.tutorial-tooltip {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    background: linear-gradient(to bottom right, #ffffff, #fafafa);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 
                0 2px 4px rgba(0, 0, 0, 0.05);
    max-width: 360px;
    z-index: 10000 !important;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.tutorial-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.tutorial-content {
    color: #1a1a1a;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 450;
    letter-spacing: -0.01em;
}

.tutorial-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    color: #666666;
    font-size: 13px;
    font-weight: 500;
}
  
.tutorial-dots {
    display: flex;
    gap: 6px;
}

.tutorial-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e5e7eb;
    transition: all 0.3s ease;
}

.tutorial-dot.active {
    background: #2563eb;
    transform: scale(1.2);
}

.tutorial-buttons {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.tutorial-prev{
    color: #444444;
}

.tutorial-btn {
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    letter-spacing: -0.01em;
}

.tutorial-btn:hover {
    transform: translateY(-1px);
}

.tutorial-btn:active {
    transform: translateY(1px);
}

.tutorial-next {
    background: #2563eb;
    color: white;
    flex-grow: 1;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.tutorial-next:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.25);
}

.tutorial-skip {
    background: #f5f5f5;
    color: #666666;
}

.tutorial-skip:hover {
    background: #eeeeee;
    color: #333333;
}

@keyframes highlightPulse {
    0% { 
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15),
                    0 0 0 2px rgba(37, 99, 235, 0.3);
    }
    50% { 
        box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.1),
                    0 0 0 4px rgba(37, 99, 235, 0.2);
    }
    100% { 
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15),
                    0 0 0 2px rgba(37, 99, 235, 0.3);
    }
}

/* Tooltip positioning animations */
.tutorial-tooltip[data-popper-placement^='top'] {
    transform: translateY(12px) scale(0.98);
}

.tutorial-tooltip[data-popper-placement^='bottom'] {
    transform: translateY(-12px) scale(0.98);
}

.tutorial-tooltip[data-popper-placement^='left'] {
    transform: translateX(12px) scale(0.98);
}

.tutorial-tooltip[data-popper-placement^='right'] {
    transform: translateX(-12px) scale(0.98);
}

@media(max-width: 700px){
    /* Phones: use (almost) the full screen width. It used to be scaled to 90% inside 2.5vw padding, which left wide gaps either side. */
    .demo-container{
        transform: none;
        max-width: 100vw;
        padding-left: 10px;
        padding-right: 10px;
    }
    /* The start card stays a little narrower than the screen (a bit more room either side)... */
    .demo-container .demo-card {
        max-width: min(380px, calc(100% - 28px));
    }
    /* ...and grows to the full width when "Start Demo" is pressed (max-width already transitions), along
       with the email client, which had its own 95vw cap. */
    .demo-container .demo-card.expanded,
    .demo-container .container {
        max-width: 100%;
    }
    .tutorial-tooltip{
        padding: 10px;
        max-width: 300px
    }
    .tutorial-content{
        font-size: 13px;
    }
    .tutorial-dots{
        gap: 4px;
    }
    .tutorial-dot{
        height: 6px;
        width: 6px;
    }
    .tutorial-btn{
        font-size: 10px;
    }
}
@media(max-width: 420px){
    .tutorial-tooltip{
        padding: 10px;
        max-width: 200px;
    }
    .step-counter{
        font-size: 8px;
    }
    .tutorial-buttons button{
        padding: 8px;
    }
}
@media (max-width: 640px) {
    .demo-content {
        padding: 2rem;
    }
    
    .demo-content h3 {
        font-size: 2.2rem;
    }
    
    .feature-pills {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .hiai {
        font-size: 30px;
    }
    .badge, .feature-pills{
        display: none !important;
    }
    .hiai .hi {
        height: 50px;
        width: 50px;
    }
    .demo-content h3 {
        font-size: 2rem;
        margin-bottom: 10px;
    }
    .demo-content .description{
        font-size: 1rem;
        margin-bottom: 1rem;
    }
}