
/* Global resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    font-family: Arial, sans-serif;
    display: flex;
    min-height: 100vh;
  }
  
  .menu-bar {
    background-color: #333333;
    color: white;
    height: 75px;
    display: flex;
    align-items: center;
    padding: 0 30px;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
  }
  
  .menu-left {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .page-title {
    font-size: 1.4rem;
    font-weight: bold;
  }
  
  .menu-right a {
    color: white;
    text-decoration: none;
    margin-left: 25px;
    font-size: 1rem;
    transition: opacity 0.2s;
  }
  .menu-right a:hover {
    opacity: 0.75;
  }
  
  .side-menu {
    position: relative;
    width: 100px;
    background-color: #FAF9F6;
    color: #333333;
    padding-top: 75px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-x: visible;
  }
  
  .smi-highlight {
    position: absolute;
    left: 0;
    width: 100%;
    height: 48px;
    background-color: #333333;
    z-index: 0;
    transition: top 0.3s ease-in-out, height 0.3s ease-in-out, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
    overflow: visible;
  }
  .smi-highlight::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -10px;
    transform: translateY(-50%);
    width: 10px;
    height: 100%;
    background: #333333;
    border-top-right-radius: 50px;
    border-bottom-right-radius: 50px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  }
  
  .side-menu-content {
    position: relative;
    z-index: 1;
    margin-top: auto;
    margin-bottom: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
  }
  
  .side-menu-item {
    width: 100%;
    padding: 12px 0;
    text-align: center;
    color: #333333;
    cursor: pointer;
    transition: color 0.2s;
  }
  .side-menu-item:hover {
    color: #888;
  }
  .side-menu-item.active {
    color: white;
    position: relative;
    z-index: 2;
  }
  
  .main-content {
    margin-left: 100px; /* to account for the side menu */
    margin-top: 75px;   /* to account for the top menu bar */
    padding: 20px;
    height: calc(100vh - 75px);
    width: calc(100vw - 100px);
    display: flex;
    align-items: center;    /* vertical centering */
    justify-content: center; /* horizontal centering ✅ */
  }

  .ad-preview { 
    flex: 0 0 auto;      /* opt out of flex shrink/grow */
    flex-shrink: 0;
    box-sizing: border-box;
  }

  .ad-preview img, 
  .ad-preview video {
    max-width: none; 
    max-height: none; 
  }

  #creative-preview,
  .main-content {
    overflow: visible;   /* or auto if you prefer scrollbars */
  }
  
  /* === Ad Styles for 970x250 === */
  .ad-970x250 {
    display: flex;
    width: 970px;
    height: 250px;
    min-width: 970px; min-height: 250px;
    max-width: 970px; max-height: 250px;
    border: 1px solid #ccc;
    overflow: hidden;
    font-family: sans-serif;
    background-color: white;
  }
  
  .ad-970x250 .left-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
  }
  
  .ad-970x250 .logo {
    width: 120px;
    height: auto;
    margin-bottom: 10px;
  }
  
  .ad-970x250 .headline {
    font-size: 22px;
    margin: 0 0 10px;
    color: #000;
  }
  
  .ad-970x250 .description {
    font-size: 16px;
    margin: 0 0 15px;
    color: #333;
  }
  
  .ad-970x250 .cta-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0074D9;
    color: white;
    text-decoration: none;
    border-radius: 2px;
    font-weight: bold;
    width: fit-content;
  }
  
  .ad-970x250 .right-content {
    flex-shrink: 0;
    max-width: 60%;
    height: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .ad-970x250 .media {
    height: 100%;
    width: auto;
    object-fit: cover;
    display: block;
  }
  
  /* === Ad Styles for 320x50 === */
  .ad-320x50 {
    width: 320px;
    height: 50px;
    background-color: white;
    border: 1px solid #ccc;
    display: flex;
    align-items: center;
    font-family: sans-serif;
    padding: 0 6px;
    box-sizing: border-box;
    overflow: hidden;
  }
  
  .ad-320x50 .logo {
    max-height: 40px;
    width: auto;
    max-width: 60px;
    object-fit: contain;
    margin-right: 8px;
    flex-shrink: 0;
  }
  
  .ad-320x50 .text-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
  }
  
  .ad-320x50 .headline {
    font-size: 11px;
    line-height: 1.1;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-clamp: 2;
  }
  
  .ad-320x50 .cta-button {
    background-color: #0072ce;
    color: white;
    font-size: 11px;
    padding: 4px 8px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    margin-left: 8px;
    flex-shrink: 0;
    white-space: nowrap;
    text-decoration: none; /* Make <a> look like a button */
    display: inline-block;
  }
  
  
  /* === Ad Styles for 300x250 === */
  .ad-300x250 {
    width: 300px;
    height: 250px;
    background: white;
    border: 1px solid #ccc;
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
  }
  
  .ad-300x250 .media {
    height: 150px;
    width: 100%;
    overflow: hidden;
  }
  
  .ad-300x250 .media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .ad-300x250 .text-block {
    flex: 1;
    padding: 5px 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  
  .ad-300x250 .headline {
    font-size: 16px;
    font-weight: bold;
    margin: 0;
    line-height: 18px;
  }
  
  .ad-300x250 .bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 40px;
    margin-top: 6px;
  }
  
  .ad-300x250 .logo {
    max-height: 100%;
    max-width: 100px;
    height: auto;
    width: auto;
  }
  
  .ad-300x250 .cta-button {
    background-color: #0072CE;
    color: white;
    border: none;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 2px;
    white-space: nowrap;
  }
  
  
  /* === Ad Styles for 300x600 === */

  /* 300x600 layout */
  .ad-300x600 {
    width: 300px;
    height: 600px;
    min-width: 300px; min-height: 600px;
    max-width: 300px; max-height: 600px;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    font-family: sans-serif;
    overflow: hidden;
    border: 1px solid #ccc;
  }
  
  .ad-300x600 .logo-row {
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
  }
  
  .ad-300x600 .logo-row img.logo {
    max-height: 60px;
    max-width: 100%;
    object-fit: contain;
  }
  
  .ad-300x600 .media {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
  }
  
  .ad-300x600 .media img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
  }
  
  .ad-300x600 .text-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 20px 15px;
    text-align: center;
    box-sizing: border-box;
  }
  
  .ad-300x600 .text-block .headline {
    font-size: 24px;
    font-weight: bold;
    line-height: 28px;
    margin: 0;
  }
  
  .ad-300x600 .text-block .description {
    font-size: 16px;
    line-height: 22px;
    margin: 0;
  }
  
  .ad-300x600 .text-block .cta-button {
    padding: 10px 20px;
    font-size: 14px;
    background-color: #0072ce;
    color: white;
    border: none;
    border-radius: 2px;
    cursor: pointer;
  }
  
  .ad-300x600 .text-block .cta:hover {
    background-color: #005fa3;
  }
  
  
  /* === Ad Styles for 728x90 === */
  .ad-728x90 {
    width: 728px;
    height: 90px;
    min-width: 728px; min-height: 90px;
    max-width: 728px; max-height: 90px;
    display: flex;
    background: white;
    font-family: sans-serif;
    overflow: hidden;
    border: 1px solid #ccc;
  }
  
  .ad-728x90 .left-column {
    display: flex;
    align-items: center;
    padding: 0 10px;
  }
  
  .ad-728x90 .left-column img.logo {
    max-height: 60%;
    max-width: 100px;
    object-fit: contain;
  }
  
  .ad-728x90 .middle-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 10px;
    flex: 1;
    overflow: hidden;
  }
  
  .ad-728x90 .middle-column .headline {
    font-size: 14px;
    font-weight: bold;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .ad-728x90 .middle-column .description {
    font-size: 12px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .ad-728x90 .right-column {
    height: 100%;
    max-width: 40%;
  }
  
  .ad-728x90 .right-column img.media {
    height: 100%;
    width: auto;
    object-fit: cover;
    display: block;
  }
  
  .ad-728x90 a.cta-button {
    display: none;
  }
  
  
  /* === Ad Styles for 620x250 === */
  .ad-620x250 {
    width: 620px;
    height: 250px;
    background: white;
    display: flex;
    font-family: Arial, sans-serif;
    border: 1px solid #ccc;
    overflow: hidden;
  }
  
  .ad-620x250 .left-content {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
  }
  
  .ad-620x250 .logo-wrapper {
    height: 50px;
    display: flex;
    align-items: center;
  }
  
  .ad-620x250 .logo {
    max-height: 50px;
    height: auto;
    width: auto;
    object-fit: contain;
  }
  
  .ad-620x250 .headline {
    font-size: 20px;
    font-weight: bold;
    margin: 0;
    line-height: 1.2;
  }
  
  .ad-620x250 .description {
    font-size: 14px;
    margin: 0;
    line-height: 1.4;
  }
  
  .ad-620x250 .cta-button {
    align-self: flex-start;
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    font-weight: bold;
    text-decoration: none;
    border-radius: 2px;
    font-size: 14px;
  }
  
  .ad-620x250 .right-media {
    width: 250px;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ddd;
  }
  
  .ad-620x250 .right-media img {
    height: 100%;
    width: auto;
    object-fit: cover;
  }
  
  .global-assets-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 600px;
  }
  
  .global-assets-panel label {
    display: flex;
    flex-direction: column;
    font-weight: bold;
    font-size: 14px;
  }
  
  .global-assets-panel input,
  .global-assets-panel textarea {
    padding: 8px;
    font-size: 14px;
    margin-top: 4px;
  }
  
  .global-assets-panel button {
    align-self: flex-start;
    padding: 10px 16px;
    font-size: 14px;
    background-color: #0072ce;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
  }
  
  .global-assets-form {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    font-family: Arial, sans-serif;
  }
  
  .global-assets-form h2 {
    margin-bottom: 16px;
    font-size: 20px;
  }
  
  .global-assets-form form label {
    display: block;
    margin-bottom: 16px;
    font-size: 14px;
    color: #333;
  }

  .trackers-grid label {
    display: block;
    margin-bottom: 0px !important;
    margin-top:16px;
    color: #333;
  }
  
  .global-assets-form input[type="text"],
  .global-assets-form input[type="url"],
  .global-assets-form input[type="file"] {
    width: 100%;
    max-width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-top: 6px;
    box-sizing: border-box;
  }
  
  .global-assets-form button[type="submit"] {
    background-color: #0072ce;
    color: white;
    border: none;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
  }
  
  .global-assets-form button[type="submit"]:hover {
    background-color: #005fa3;
  }
  
  .menu-right .export-btn{background:#0d6efd;color:#fff;border:0;padding:8px 12px;border-radius:2px;cursor:pointer; margin-left:10px;margin-right:10px;font-size: 16px;}
.menu-right .export-btn:hover{filter:brightness(.95)}

/* RIGHT SLIDE-OUT PANEL */
.size-panel{
  position:fixed; top:75px; right:-420px; width:420px; height:calc(100vh - 75px);
  background:#fff; border-left:1px solid #ccc; box-shadow:-6px 0 18px rgba(0,0,0,.08);
  transition:right .25s ease-in-out; z-index:1001; display:flex; flex-direction:column;
  
}
.size-panel.open{ right:0; }
.size-panel-header{ display:flex; align-items:center; justify-content:space-between; padding:10px 12px; border-bottom:1px solid #eee; }
.size-panel-title{ font-size:14px; font-weight:600; }
.size-panel-close{ background:transparent; border:0; font-size:18px; line-height:1; cursor:pointer; padding:4px 8px; }
.size-panel-content{ padding: 8px; overflow:auto; flex:1; }

.size-panel-tab{
  position:absolute;
  top:50%;                      /* center vertically */
  transform: translateY(-50%);  /* adjust for centering */
  left:-32px;
  width:32px;
  height:140px;
  background:#333333;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  border-top-left-radius:8px;
  border-bottom-left-radius:8px;
  cursor:pointer;
  user-select:none;
  writing-mode: vertical-rl;    /* flipped text direction */
  text-orientation: mixed;
}
.size-panel-tab:hover{ filter:brightness(.95); }
.size-panel.open .size-panel-tab{ display:none; }

/* hide tab in global assets mode */
#sizePanel.hide-tab .size-panel-tab{ display:none; }

button[id^="clearOverrides-"],
#sizePanel button[type="submit"] {
  padding: 10px 16px;
  margin-top:10px;
  font-size: 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* Keep the different colors */
#sizePanel button[type="submit"] {
  background-color: #0072ce;
  color: #fff;
}
button[id^="clearOverrides-"] {
  background-color: #888;
  color: #fff;
}

#sizePanel .global-assets-form label {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}

#sizePanel .global-assets-form {
  border:0;
  box-shadow:none;
}

.global-assets-form button[type="submit"] {
 padding:10px;
 margin-top:10px;
}

/* Backdrop */
.export-modal{
  position:fixed; inset:0;
  display:flex; align-items:center; justify-content:center;
  z-index:2147483600;
  background:rgba(0,0,0,.5);
  opacity:0; pointer-events:none;
  transition:opacity .2s ease-out;
}
/* when JS opens it */
.export-modal.is-open{ opacity:1; pointer-events:auto; }
/* when explicitly hidden (e.g., initial state or on close) */
.export-modal[hidden]{ display:none !important; }

/* Dialog */
.export-modal__dialog{
  width:960px; max-width:90vw; min-width:640px;
  background:#fff;
  border:1px solid rgba(0,0,0,.2);
  border-radius:.3rem;
  display:flex; flex-direction:column;
  box-shadow:0 10px 40px rgba(0,0,0,.35);
  transform:translateY(-12px); opacity:0;
  transition:transform .3s ease-out, opacity .2s ease-out;
}
.export-modal.is-open .export-modal__dialog{
  transform:translateY(0); opacity:1;
}

/* Header */
.export-modal__head{
  display:flex; align-items:center; justify-content:space-between;
  background:#0b0c0f; color:#fff;
  padding:12px 16px;
  border-top-left-radius:.3rem; border-top-right-radius:.3rem;
  border-bottom:1px solid #1f232b;
}
.export-modal__head h3{ margin:0; font-size:16px; font-weight:600; }
.export-modal__close{
  appearance:none; border:0; background:transparent;
  color:#9aa0a6; font-size:22px; line-height:1; cursor:pointer;
  padding:2px 6px; border-radius:6px;
}
.export-modal__close:hover{ color:#c2c7d0; background:rgba(255,255,255,.06); }
.export-modal__close:focus{ outline:2px solid #6573ff33; outline-offset:2px; }

/* Body/list */
.export-modal__list{ padding:16px; max-height:70vh; overflow:auto; }

/* Rows (kept from your styles, adapted to light body) */
.export-row{
  display:grid; grid-template-columns:140px 1fr auto auto;
  gap:8px; align-items:center; padding:8px 0;
  border-bottom:1px dashed #e5e7eb;
}
.export-row:last-child{ border-bottom:none; }
.export-row pre{
  margin:0; max-height:120px; overflow:auto;
  background:#e5e7eb; color:#0b0b0b;
  padding:8px; border-radius:6px;
}

/* Buttons area in each row */
.export-actions button{ margin-left:8px;padding: 5px 11px; }

/* Remove the old controls row entirely (JS-only export) */
.export-modal__controls{ display:none !important; }

  #viewport-blocker {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    background: rgba(15, 15, 20, 0.94);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
  }
  #viewport-blocker .panel {
    max-width: 680px;
    width: 92%;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 16px;
    padding: 28px 24px;
    background: rgba(40, 40, 48, 0.6);
  }
  #viewport-blocker h1 {
    margin: 0 0 8px 0;
    font-size: 20px;
    letter-spacing: .2px;
  }
  #viewport-blocker p {
    margin: 0;
    font-size: 14px;
    opacity: .9;
  }
  /* When viewport is too small, show blocker and disable app */
  @media (max-width: 1023px), (max-height: 699px) {
    #viewport-blocker { display: flex; }
    .app {
      pointer-events: none;
      user-select: none;
      filter: blur(2px) saturate(.9);
    }
    html, body {
      overflow: hidden;
      height: 100%;
    }
  }

  .export { position: relative; display: inline-block; }
.export-btn {
  background:#1f2937; color:#fff; border:1px solid #374151; border-radius:6px; padding:6px 10px; cursor:pointer;
}
.export-btn:focus { outline:2px solid #60a5fa; outline-offset:2px; }

.export-menu {
  position:absolute; right:0; top:34px;
  min-width:220px; background:#111; color:#eee; border:1px solid #333; border-radius:8px;
  box-shadow:0 10px 30px rgba(0,0,0,.5); padding:6px; z-index:10000;
  display:none; /* default hidden via CSS */
}
.export-menu button {
  width:100%; text-align:left; background:transparent; border:0; color:#eee;
  padding:10px; border-radius:6px; cursor:pointer;
}
.export-menu button:hover { background:#1f2937; }

#exportMenu{display:none}
#exportRoot.is-open>#exportMenu,#exportRoot:hover>#exportMenu{display:block}
/* Make modal visibility deterministic */
.export-modal{display:none}
.export-modal.is-open{display:flex}

.adbuilder-logo {
  max-height:40px;
}