/* ==========================================================================
   Adsmart — style.css 
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root[data-theme="dark"] {
  --bg-main: #06050a;
  --panel-bg: #0c0a14;
  --card-bg: #110e1c;
  --border-glow: rgba(253, 108, 4, 0.938);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #4b5563;
  --accent: #8b5cf6;
}

:root[data-theme="light"] {
  --bg-main: #f4f3f8;
  --panel-bg: #ffffff;
  --card-bg: #ffffff;
  --border-glow: rgba(253, 108, 4, 0.938);
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --accent: #6d28d9;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  padding-top: 70px;
}

/* ── NAVBAR ── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--border-glow);
  z-index: 100;
}

.nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 30px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  font-size: 1.6rem;
  color: var(--accent);
}

.brand-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.5px;
}

.nav-search {
  flex: 1;
  max-width: 500px;
  position: relative;
  display: flex;
  align-items: center;
}

.nav-search svg {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
}

.nav-search input {
  width: 100%;
  height: 42px;
  background: var(--bg-main);
  border: 1px solid var(--border-glow);
  border-radius: 12px;
  padding: 0 16px 0 42px;
  color: var(--text-primary);
  outline: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-btn {
  width: 42px;
  height: 42px;
  background: var(--card-bg);
  border: 1px solid var(--border-glow);
  border-radius: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

[data-theme="dark"] .icon-sun,
[data-theme="light"] .icon-moon {
  display: none;
}

/* ── CONTROLS PANEL ── */
.filter-bar {
  background: var(--panel-bg);
  border-bottom: 1px solid var(--border-glow);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out;
}

.filter-bar.open {
  max-height: 80px;
}

.filter-bar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 30px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.filter-select {
  height: 38px;
  background: var(--bg-main);
  border: 1px solid var(--border-glow);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text-secondary);
  outline: none;
  cursor: pointer;
}

.filter-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
}

/* ── MASONRY BASE CANVAS ── */
.main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 30px;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  grid-auto-rows: 100px;
  gap: 20px;
}

.ad-bento-item {
  background: var(--card-bg);
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.ad-bento-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* ── FIXED ADSTERRA SHAPE CHANNELS ── */
.ad-bento-item.size-160-600 {
  grid-column: span 1;
  grid-row: span 6;
  min-width: 160px;
  min-height: 600px;
}

.ad-bento-item.size-300-250 {
  grid-column: span 2;
  grid-row: span 3;
  min-width: 300px;
  min-height: 250px;
}

.ad-bento-item.size-728-90 {
  grid-column: span 4;
  grid-row: span 1;
  min-width: 728px;
  min-height: 90px;
}

/* ── DYNAMIC CLASSIFIED ASPECT RATIOS ── */
.ad-bento-item.ratio-16-9 { grid-column: span 2; grid-row: span 2; }
.ad-bento-item.ratio-1-1  { grid-column: span 2; grid-row: span 3; }
.ad-bento-item.ratio-9-16 { grid-column: span 2; grid-row: span 4; }

.programmatic-script-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.02);
}

.script-overlay-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 700;
}

.blank-spot-graphic {
  flex: 1;
  background: linear-gradient(135deg, rgba(139,92,246,0.02) 0%, rgba(0,0,0,0.15) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid var(--border-glow);
  padding: 20px;
}

.graphic-logo {
  font-size: 2rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.format-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.classified-media-frame {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000;
}

.classified-media-frame img,
.classified-media-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-play-indicator {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 4px;
}

.classified-text-layer {
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--card-bg);
}

.classified-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.classified-title-row h4 {
  font-family: 'Syne', sans-serif;
  font-size: 0.95rem;
}

.spot-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.classified-desc-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 12px;
}

.classified-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.region-marker { font-size: 0.75rem; color: var(--text-muted); }

.action-btn-trigger {
  background: var(--bg-main);
  border: 1px solid var(--border-glow);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
}

.ad-bento-item:hover .action-btn-trigger {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.loading-state, .loading-more {
  grid-column: 1 / -1;
  padding: 80px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-glow);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── FOOTER SYSTEM ── */
.footer {
  background: var(--panel-bg);
  border-top: 1px solid var(--border-glow);
  padding: 60px 30px 30px;
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand { grid-column: span 2; }
.brand-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.footer-brand p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; max-width: 300px; }
.footer-col h5 { font-family: 'Syne', sans-serif; font-size: 0.9rem; margin-bottom: 16px; }
.footer-col a { display: block; font-size: 0.8rem; color: var(--text-secondary); text-decoration: none; margin-bottom: 10px; }
.footer-bottom { border-top: 1px solid var(--border-glow); padding-top: 24px; text-align: center; font-size: 0.75rem; color: var(--text-muted); }

@media (max-width: 1024px) {
  .footer-brand { grid-column: span 1; }
}