/* M3 MI Dashboard - Creative Viewer Styles
   Complete CSS for the Ad Creative Viewer interface with Modal and Thumbnail Grid
*/

/* -----------------------------
   1) Design Tokens
------------------------------*/
:root{
  /* Brand palette (sampled from screenshot) */
  --m3-navy-900:#0E2F68;
  --m3-navy-800:#1B4870;
  --m3-navy-700:#023265;
  --m3-teal-700:#267686;
  --m3-teal-600:#399D9F;
  --m3-teal-300:#92B7BC;
  --m3-bg-100:#E3EDED;
  --m3-bg-200:#D1D6D7;
  --m3-white:#FFFFFF;
  --m3-black:#0A0A0A;

  /* Feedback */
  --m3-green:#2DBB7D;
  --m3-yellow:#FFB020;
  --m3-red:#D9534F;

  /* Shadows & radii */
  --m3-radius:10px;
  --m3-radius-sm:6px;
  --m3-shadow-sm:0 1px 2px rgba(0,0,0,.06), 0 1px 6px rgba(0,0,0,.06);
  --m3-shadow-md:0 6px 14px rgba(0,0,0,.12);
  --m3-shadow-lg:0 10px 25px rgba(0,0,0,.15);
}

/* -----------------------------
   2) Base
------------------------------*/
html,body{
  height:100%;
  background:var(--m3-bg-100);
  color:var(--m3-black);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  margin: 0;
  padding: 0;
}

* {
  box-sizing: border-box;
}


.layout-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.layout-main {
  flex: 1;
}

a{ color:var(--m3-teal-700); text-decoration:none;}
a:hover{ text-decoration:underline; }

/* -----------------------------
   3) Header
------------------------------*/
.header {
  background: linear-gradient(90deg, var(--m3-navy-900), var(--m3-navy-800));
  color: var(--m3-white);
  padding: 0 24px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between; /* left group on left, logout on right */
  box-shadow: var(--m3-shadow-sm);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  font-size: 2rem;
  font-family: Times New Roman;
  color: var(--m3-white);
}

.logo-divider {
  width: 2px;
  height: 30px;
  background: var(--m3-yellow);
  margin: 0 8px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  font-family: Times New Roman;
  line-height: 1.2;
}

.logo-main {
  font-size: 1.1rem;
  font-weight: 600;
}

.logo-sub {
  font-size: 0.9rem;
  opacity: 0.9;
  font-weight: 400;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  font-family: Times New Roman;
  color: var(--m3-white);
}

.left-section {
  display: flex;
  align-items: center;
  gap: 24px;
}

.right-section {
  display: flex;
  align-items: center;
  gap: 15px; /* space between email and logout button */
}

.user-email {
  margin: 0;
  font-weight: bold;
  font-size: 15px;
}

.user-dropdown {
  position: relative;
}

.user-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--m3-white);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 22px;
}

.user-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Dropdown menu */
.dropdown-content {
  display: none; /* hidden by default */
  position: absolute;
  right: 0;
  top: 110%;
  background: var(--m3-navy-800);
  border-radius: 8px;
  overflow: hidden;
  min-width: 180px;
  box-shadow: var(--m3-shadow-sm);
  z-index: 1001;
}

.dropdown-content.show {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--m3-white);
  font-family: inherit;
  font-size: 14px;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.logout-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  cursor: pointer;
}

.logout-item:hover {
  background: rgba(255, 0, 0, 0.2);
}


/* -----------------------------
   4) Main Content
------------------------------*/
.main-content {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

/* -----------------------------
   5) Filter Panel
------------------------------*/
.filter-panel {
  position: relative;
  background: var(--m3-white);
  border: 1px solid var(--m3-bg-200);
  border-radius: var(--m3-radius);
  box-shadow: var(--m3-shadow-sm);
  padding: 20px;
  margin-bottom: 24px;
}

.filter-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--m3-navy-900);
  margin-bottom: 20px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.filter-row-special {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: end;
}

.date-property-group {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

/* Filter Toggle */
.filter-toggle {
  color: var(--m3-teal-700);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
}

.filter-toggle:hover {
  text-decoration: underline;
}

/* -----------------------------
   6) Form Controls
------------------------------*/
label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--m3-navy-900);
  margin-bottom: 6px;
}

.input, select {
  width: 100%;
  min-height: 36px;
  /*padding: 10px 12px;*/
  /*border: 1px solid var(--m3-bg-200);*/
  border-radius: var(--m3-radius-sm);
  background: var(--m3-white);
  color: var(--m3-black);
  /*box-shadow: inset 0 1px 2px rgba(0,0,0,.06);*/
  transition: border-color .2s ease, box-shadow .2s ease;
  font-size: 0.95rem;
  font-family: inherit;
}

.input::placeholder {
  color: #9AA4AA;
}

.input:focus, select:focus {
  outline: none;
  border-color: var(--m3-teal-600);
  box-shadow: 0 0 0 3px rgba(57,157,159,.18);
}

/* Radio buttons */
.radio-group {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-top: 6px;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.radio-item input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

/* Date Range Controls */
.date-range-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.date-input {
  flex: 1;
  min-width: 140px;
}

.date-separator {
  color: var(--m3-navy-700);
  font-weight: 600;
  font-size: 0.875rem;
}

.date-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.preset-btn {
  background: transparent;
  border: 1px solid var(--m3-bg-200);
  color: var(--m3-navy-700);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-btn:hover {
  background: var(--m3-bg-100);
  border-color: var(--m3-teal-600);
}

.preset-btn.active {
  background: var(--m3-teal-700);
  color: var(--m3-white);
  border-color: var(--m3-teal-700);
}

/* -----------------------------
   7) Buttons
------------------------------*/
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 20px;
  border-radius: var(--m3-radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

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

.btn-primary {
  background: var(--m3-navy-900);
  color: var(--m3-white);
}

.btn-primary:hover {
  background: var(--m3-navy-800);
}

.btn-secondary {
  background: transparent;
  color: var(--m3-navy-900);
  border-color: var(--m3-bg-200);
}

.btn-secondary:hover {
  background: var(--m3-bg-100);
}

.btn-search {
  background: var(--m3-yellow);
  color: var(--m3-navy-900);
  font-weight: 700;
}

.btn-search:hover {
  background: #E09A00;
}

/* -----------------------------
   8) Results Panel
------------------------------*/
.results-panel {
  background: var(--m3-white);
  border: 1px solid var(--m3-bg-200);
  border-radius: var(--m3-radius);
  box-shadow: var(--m3-shadow-sm);
  padding: 20px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--m3-bg-200);
}

.results-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--m3-navy-900);
  margin: 0;
}

/* View Toggle */
.view-toggle {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Results Table */
.results-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 20px;
}

.results-table th {
  background: var(--m3-bg-100);
  color: var(--m3-navy-900);
  font-weight: 700;
  padding: 12px;
  text-align: left;
  border-bottom: 2px solid var(--m3-bg-200);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.results-table th:hover {
  background: var(--m3-bg-200);
}

.results-table td {
  padding: 12px;
  border-bottom: 1px solid var(--m3-bg-200);
}

.results-table tr:hover {
  background: rgba(57,157,159,.05);
}

.creative-link {
  color: var(--m3-teal-700);
  font-weight: 600;
}

.creative-link:hover {
  text-decoration: underline;
}

/* Table Thumbnail */
.table-thumbnail-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-thumbnail {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--m3-bg-200);
}

/* -----------------------------
   9) Thumbnail Grid
------------------------------*/
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
  width: 100%;
}

.grid-item {
  background: var(--m3-white);
  border: 1px solid var(--m3-bg-200);
  border-radius: var(--m3-radius-sm);
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: var(--m3-shadow-sm);
  display: flex;
  flex-direction: column;
}

.grid-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--m3-shadow-md);
}

.grid-creative-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.grid-creative-link:hover {
  text-decoration: none;
}

.grid-thumbnail-container {
  width: 100%;
  height: 180px;
  background: var(--m3-bg-100);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.grid-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
  max-width: 100%;
  max-height: 100%;
}

.grid-item:hover .grid-thumbnail {
  transform: scale(1.02);
}

.grid-no-image {
  color: var(--m3-navy-700);
  opacity: 0.4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.grid-no-image-text {
  font-size: 0.8rem;
  text-align: center;
}

.grid-item-info {
  padding: 16px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.grid-creative-id {
  font-size: 0.85rem;
  color: var(--m3-teal-700);
  font-weight: 600;
  background: var(--m3-bg-100);
  padding: 4px 8px;
  border-radius: 4px;
  align-self: flex-start;
}

.grid-product-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--m3-navy-900);
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  flex-grow: 1;
}

.grid-date {
  font-size: 0.8rem;
  color: var(--m3-navy-700);
  opacity: 0.8;
  margin-top: auto;
}

/* -----------------------------
   10) Modal Styles
------------------------------*/
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--m3-white);
  border-radius: var(--m3-radius);
  box-shadow: var(--m3-shadow-lg);
  max-width: 90vw;
  max-height: 90vh;
  width: 800px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--m3-bg-200);
  background: var(--m3-bg-100);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--m3-navy-900);
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  font-weight: bold;
  color: var(--m3-navy-700);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--m3-bg-200);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-image-container {
  text-align: center;
  margin-bottom: 24px;
}

.modal-image-container img {
  max-width: 100%;
  max-height: 400px;
  height: auto;
  border-radius: var(--m3-radius-sm);
  box-shadow: var(--m3-shadow-sm);
}

.modal-details {
  display: grid;
  gap: 12px;
}

.detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--m3-bg-100);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row strong {
  font-weight: 600;
  color: var(--m3-navy-900);
  min-width: 120px;
  flex-shrink: 0;
}

.detail-row span {
  color: var(--m3-navy-700);
  flex: 1;
}

/* -----------------------------
   11) Pagination
------------------------------*/
.pagination-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--m3-bg-200);
}

.pagination-info {
  font-size: 0.9rem;
  color: var(--m3-navy-700);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pagination-select {
  min-height: 32px;
  padding: 4px 8px;
  font-size: 0.875rem;
}

.pagination-nav {
  display: flex;
  gap: 4px;
}

.pagination-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--m3-bg-200);
  background: var(--m3-white);
  color: var(--m3-navy-900);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--m3-bg-100);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-btn.active {
  background: var(--m3-navy-900);
  color: var(--m3-white);
}

.pagination-ellipsis {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--m3-navy-700);
  font-size: 0.875rem;
}

/* -----------------------------
   12) Footer
------------------------------*/
.footer {
  background: linear-gradient(90deg, var(--m3-navy-900), var(--m3-navy-800));
  color: var(--m3-white);
  margin-top: 40px;
  padding: 20px 0;
  box-shadow: 0 -2px 4px rgba(0,0,0,.1);
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-logo {
  font-size: 1.25rem;
  font-family: Times New Roman;
  color: var(--m3-white);
}

.footer-copyright {
  font-size: 0.875rem;
  font-family: Times New Roman;
  color: rgba(255,255,255,0.8);
}

.footer-links {
  font-family: Times New Roman;
  display: flex;
  gap: 24px;
}

.footer-link {
  color: var(--m3-white);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  padding: 4px 8px;
  border-radius: 4px;
}

.footer-link:hover {
  background: rgba(255,255,255,0.1);
  text-decoration: none;
  color: var(--m3-white);
}

/* -----------------------------
   13) Responsive Design
------------------------------*/
@media (max-width: 768px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }
  
  .filter-row-special {
    grid-template-columns: 1fr;
  }
  
  .date-property-group {
    grid-template-columns: 1fr;
  }
  
  .radio-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .pagination-section {
    flex-direction: column;
    gap: 12px;
  }

  .footer-content {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .footer-links {
    gap: 16px;
  }

  /* Results header responsive */
  .results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .view-toggle {
    align-self: stretch;
    justify-content: center;
  }

  /* Modal responsive adjustments */
  .modal-content {
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    margin: 10px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-header {
    padding: 16px;
  }

  .detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .detail-row strong {
    min-width: auto;
  }

  /* Modal action buttons on mobile */
  .modal-actions {
    flex-wrap: wrap;
    gap: 4px;
  }

  .modal-actions .btn {
    font-size: 0.8rem;
    padding: 0 12px;
    height: 36px;
  }

  /* Grid responsive adjustments */
  .results-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .grid-thumbnail-container {
    height: 140px;
  }

  .grid-item-info {
    padding: 12px;
  }

  /* Table thumbnail adjustments */
  .table-thumbnail-container {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }

  .table-thumbnail {
    width: 30px;
    height: 30px;
  }
}

/* Spin animation for loading buttons */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Sort indicators */
.sort-asc .sort-indicator {
  color: var(--m3-teal-700);
}

.sort-desc .sort-indicator {
  color: var(--m3-teal-700);
}

/* Loading states */
.grid-thumbnail[src=""] {
  display: none;
}

.grid-thumbnail.loading {
  opacity: 0.5;
}

/* Thumbnail hover effects */
.table-thumbnail:hover {
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

/* Focus styles for accessibility */
.grid-creative-link:focus {
  outline: 2px solid var(--m3-teal-600);
  outline-offset: 2px;
}

.creative-link:focus {
  outline: 2px solid var(--m3-teal-600);
  outline-offset: 2px;
}

/***************LOGIN********************/
/* Full-screen centered container */
.login-container {
  height: 100vh;            /* take full viewport height */
  width: 100vw;             /* optional, full width */
  display: flex;
  align-items: center;      /* vertical center */
  justify-content: center;  /* horizontal center */
  padding: 0;               /* remove padding if you want exact centering */
}

/* Big bold login button */
.login-btn {
  background-color: #2b579a; /* Microsoft blue vibe */
  color: #fff;
  font-size: 1.5rem;
  font-weight: 500;
  padding: 1.5rem 3rem;     /* Big click area */
  border-radius: 1rem;
  transition: background-color 0.2s ease, transform 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login-btn:hover {
  background-color: #1d3f73;
  transform: translateY(-3px);
}

.login-btn:active {
  transform: translateY(0);
}

/* --- logout button --- */
.logout-btn {
  background: transparent;
  color: var(--m3-white);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 16px;
  border: 1px solid var(--m3-white);
  border-radius: var(--m3-radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background: rgba(255,255,255,0.15);
}
/***********************************/


.info-tooltip {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.8rem;
  color: var(--m3-navy-700);
  cursor: default;
  position: relative;
}

.info-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 125%;
  white-space: nowrap;
  background: var(--m3-navy-900);
  color: white;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 10;
}

.info-tooltip:hover::after {
  opacity: 1;
}

/****** show *****/
.creative-viewer__content {
    position: relative;
    display: flex;
    gap: 20px;
    background: var(--m3-white);
    padding: 20px;
    border-radius: var(--m3-radius);
  }
  .creative-viewer__back {
    position: absolute;
    top: -12px;
    left: -5px;
    font-size: 0.8rem;
    text-decoration: none;
    color: var(--m3-navy-700);
    background: var(--m3-bg-100);
    padding: 4px 8px;
    border-radius: var(--m3-radius);
    box-shadow: var(--m3-shadow-sm);
    z-index: 10;
  }

  .creative-viewer__back:hover {
    background: var(--m3-bg-200);
  }

  .creative-viewer__left {
    flex: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .creative-viewer__image-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--m3-bg-50);
    border: 1px solid var(--m3-bg-200);
    border-radius: var(--m3-radius);
    width: 100%;
    height: 500px;
    overflow: hidden;
  }

  .creative-viewer__image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }

  .creative-viewer__nav {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .creative-viewer__nav button {
    padding: 4px 8px;
    font-size: 1rem;
    cursor: pointer;
  }

  .creative-viewer__loading {
    display: none;
    font-size: 0.9rem;
    color: var(--m3-navy-500);
  }

  .creative-viewer__right {
    flex: 1;
    position: relative;
    font-size: 0.9rem;
    background: var(--m3-bg-50);
    padding: 15px 20px;
    border-radius: var(--m3-radius);
    border: 1px solid var(--m3-bg-200);
    max-height: 500px;
    overflow-y: auto;
  }

  .creative-viewer__header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
  }

  .btn-small {
    font-size: 0.8rem;
    padding: 4px 10px;
  }

  .creative-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .creative-info__item {
    align-items: center;
    justify-content: space-between;
    color: var(--m3-navy-900);
  }

/***************** Creative Modal Viewer *********************/
.creative-modal-enlarge {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modal content */
.creative-modal-content-enlarge {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

/* Close button */
.creative-modal-close-enlarge {
  position: fixed; /* fixed to viewport */
  top: 20px;
  right: 30px;
  background-color: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 16px;
  font-weight: 600;
  padding: 10px 20px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  cursor: pointer;
  z-index: 10000;
  backdrop-filter: blur(4px);
  transition: all 0.25s ease;
}

.creative-modal-close-enlarge:hover {
  background-color: rgba(255, 255, 255, 0.25);
  border-color: #fff;
}

/* Left panel */
.creative-modal__left {
  flex: 1 1 70%;
  min-width: 350px;
  max-width: 550px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Image container */
.creative-modal__image-wrap {
  position: relative;
  display: inline-block;
  border: 2px solid var(--m3-bg-200);
  border-radius: 8px;
  padding: 10px;
  max-width: 100%;
  box-sizing: border-box;
  width: 100%;
  background: var(--m3-white);
}

.creative-modal__image {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 4px;
  cursor: auto;
}

/* Inline nav bar */
.creative-modal__nav {
  margin-top: 10px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  font-size: 0.9rem;
  color: var(--m3-navy-700);
  height: 24px;
}

/* Nav buttons */
.creative-modal__nav button {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 6px;
}

/* Icon links (download/enlarge) */
.creative-modal__nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 18px;
  padding: 4px;
}

/* Loading text */
.creative-modal__loading {
  margin-left: 4px;
  font-size: 0.8rem;
  color: var(--m3-teal-700);
  display: none;
}

/* Right panel */
.creative-modal__right {
  flex: 0 0 30%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 180px;
  overflow-y: auto;
  max-height: 75vh;
  box-sizing: border-box;
  padding-left: 6px;
}

/* Small responsive tweak */
@media (max-width: 920px) {
  .creative-modal__content {
    width: 95vw;
    padding: 12px;
    gap: 12px;
  }
  .creative-modal__right {
    flex: 0 0 32%;
    min-width: 140px;
  }
}
/***************** Creative Modal Viewer Ends *********************/



/*********** Loader ************/
.filter-panel .loader-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.filter-panel .spinner,
.loader-overlay .spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  animation: spin 1s linear infinite;
}

.date-design {
  padding: 6px 10px;
  border: 0.2px solid #d1d6d7; 
  font-size: 0.80rem;
  min-width: 100px; 
  max-width: 150px;
  border-radius: 4px; 
  box-sizing: border-box;
}

/* TomSelect custom loading spinner */
.ts-dropdown .spinner-small {
  color: var(--m3-teal-700);
  font-size: 0.85rem;
  padding: 12px;
}

/* Hide TomSelect's default spinner to prevent double spinner */
.ts-control.loading::after {
  display: none !important;
}

.ts-dropdown .loading {
  display: none !important;
}

/* TomSelect wrapper - maintain full width */
.ts-wrapper {
  width: 100%;
}

/* TomSelect control - maintain full width and consistent height */
.ts-wrapper .ts-control {
  width: 100% !important;
  min-height: 36px;
  border: 1px solid var(--m3-bg-200);
  border-radius: var(--m3-radius-sm);
  background: var(--m3-white);
  padding: 6px 12px;
  font-size: 0.95rem;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.06);
}

/* Prevent width change when dropdown opens */
.ts-wrapper.dropdown-active .ts-control {
  width: 100% !important;
}

/* Style the dropdown */
.ts-wrapper .ts-dropdown {
  width: 100% !important;
  border: 1px solid var(--m3-bg-200);
  border-radius: var(--m3-radius-sm);
  box-shadow: var(--m3-shadow-md);
  margin-top: 4px;
}

/* Dropdown input styling (from dropdown_input plugin) */
.ts-wrapper .ts-dropdown .dropdown-input-wrap {
  padding: 8px;
  border-bottom: 1px solid var(--m3-bg-200);
}

.ts-wrapper .ts-dropdown .dropdown-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--m3-bg-200);
  border-radius: var(--m3-radius-sm);
  font-size: 0.95rem;
}

.ts-wrapper .ts-dropdown .dropdown-input:focus {
  outline: none;
  border-color: var(--m3-teal-600);
  box-shadow: 0 0 0 3px rgba(57,157,159,.18);
}

/* Dropdown options styling */
.ts-wrapper .ts-dropdown .ts-dropdown-content {
  max-height: 250px;
  overflow-y: auto;
}

.ts-wrapper .ts-dropdown .option {
  padding: 10px 12px;
  cursor: pointer;
}

.ts-wrapper .ts-dropdown .option:hover,
.ts-wrapper .ts-dropdown .option.active {
  background: var(--m3-bg-100);
}

/* Focus state */
.ts-wrapper.focus .ts-control {
  border-color: var(--m3-teal-600);
  box-shadow: 0 0 0 3px rgba(57,157,159,.18);
}

/* Placeholder text */
.ts-wrapper .ts-control > input::placeholder {
  color: #9AA4AA;
}

