/* =========================================================
   STUDIO V2 — SHELL LAYOUT
   Amaç: 3 kolon + sadece rightPanel scroll + min-height:0 zinciri
   ========================================================= */

html, body {
  height: 100%;
  overflow: hidden;
}

#studioRoot,
#studioShell,
#studioLayout {
  height: 100%;
  min-height: 0;
}

#leftMenu,
#moduleHost,
#rightPanelHost {
  min-height: 0;
  min-width: 0;
}

#studioLayout,
#studioRoot .studioTwoPanel,
#studioRoot .studioLayout,
#studioRoot .studioGrid {
  display: flex;
  gap: 22px;
  padding: 18px;
  min-height: 0;
}

#leftMenu {
  width: 320px;
  flex: 0 0 320px;
  overflow: hidden;
}

#moduleHost {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
}

#rightPanelHost {
  width: 420px;
  flex: 0 0 420px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#rightPanelHost .outputsList,
#rightPanelHost .outputsScroll,
#rightPanelHost .rp-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

@media (max-width: 1100px) {
  #studioLayout,
  #studioRoot .studioTwoPanel,
  #studioRoot .studioLayout,
  #studioRoot .studioGrid {
    flex-direction: column;
  }
  #leftMenu, #rightPanelHost {
    width: auto;
    flex: 0 0 auto;
  }
}
/* =========================================================
   STUDIO V2 — LAYOUT TUNING (MENÜ EN DAR + NEFES + SAĞ BOŞLUK)
   Hedef:
   - Menü en dar (2. görsel gibi)
   - Orta geniş
   - Sağ outputs orta-dar
   - Kolonlar arası az boşluk (nefes)
   - Sağda ekstra boş alan kalsın
   ========================================================= */

#studioLayout,
#studioRoot .studioTwoPanel,
#studioRoot .studioLayout,
#studioRoot .studioGrid {
  display: flex;
  align-items: stretch;
  gap: 18px;          /* NEFES: 14-22 arası oynarsın */
  padding: 18px;
}

/* MENÜ: en dar yer */
#leftMenu {
  width: 240px;
  flex: 0 0 240px;
  min-width: 240px;
}

/* ORTA: sabit değil, kontrollü esnesin */
#moduleHost {
  width: auto !important;
  flex: 0.92 1 0 !important;
  min-width: 0 !important;
}
/* SAĞ: outputs — sayfanın sonuna kadar uzasın */
#rightPanelHost {
  width: 360px;        /* 320–420 arası */
  flex: 0 0 360px;
  min-width: 0;

  /* 👇 ASIL FARK BURADA */
  align-self: stretch;
  display: flex;
  flex-direction: column;
}


/* SAĞDA ekstra boşluk */
#studioLayout::after,
#studioRoot .studioTwoPanel::after,
#studioRoot .studioLayout::after,
#studioRoot .studioGrid::after {
  content: "";
  flex: 1 1 auto;     /* kalan alanı yesin */
  min-width: 80px;    /* sağda boşluk hissi */
}

/* Küçük ekran: alt alta */
@media (max-width: 1200px) {
  #studioLayout,
  #studioRoot .studioTwoPanel,
  #studioRoot .studioLayout,
  #studioRoot .studioGrid {
    flex-direction: column;
  }
  #leftMenu, #moduleHost, #rightPanelHost {
    width: auto;
    flex: 0 0 auto;
    min-width: 0;
  }
}
/* ==== RIGHT PANEL HEIGHT FIX (0px bug) ==== */
#mainWorkspace,
#twoPanelWrap {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  display: flex;
  align-items: stretch;
}

/* twoPanelWrap içindeki iki kart yan yana duruyorsa */
#twoPanelWrap {
  gap: 18px;
}

/* Sağ card (Üretilenler) kolon gibi davransın ve uzasın */
#twoPanelWrap .studioOutputs,
section.outputsCard.studioOutputs {
  display: flex;
  flex-direction: column;
  flex: 0.72 1 0 !important;
  min-width: 400px !important;
  min-height: 0;
}
/* Asıl host: boşluğu doldursun */
#rightPanelHost {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;       /* 100% yerine daha güvenli */
}

/* Footer yazısı tabana yapışsın (varsa) */
.studioOutputs .panelFooter {
  margin-top: auto;
}
/* ===============================
   TOPBAR GAP FIX (studio) — REVİZE
   Hedef: her şeyi 1 cm aşağı almak
   =============================== */

#studioRoot,
.studioShell,
#mainWorkspace {
  margin-top: 0 !important;
  padding-top: 12px !important; /* ← 1 cm aşağı */
}

body.is-studio-v2,
body.panelWithTopbar {
  padding-top: 12px !important; /* ← body de eşitlendi */
}

:root{
  --aivo-topbar-h: 12px !important; /* ← topbar offset geri verildi */
}

/* ===============================
   COLUMN TOP ALIGN (same baseline)
   =============================== */

/* 3 kolon parent */
#studioLayout,
#twoPanelWrap,
#studioRoot .studioTwoPanel,
#studioRoot .studioLayout,
#studioRoot .studioGrid{
  align-items: stretch !important;
  padding-top: 12px !important; /* 8-16 arası ayarla */
}

/* 3 kolonun kendisi aynı hizada başlasın */
#leftMenu,
#moduleHost,
#rightPanelHost{
  margin-top: 0 !important;
  padding-top: 0 !important;
  align-self: stretch !important;
}

/* Kolon içindeki ilk kart/section üst boşluk yapıyorsa sıfırla */
#moduleHost > :first-child,
#rightPanelHost > :first-child,
#leftMenu  > :first-child{
  margin-top: 0 !important;
}

/* =========================================================
   RIGHT PANEL AUTO GROW
   Amaç: ekran genişledikçe sağ panel de büyüsün
   ========================================================= */

/* sağda yapay boşluk bırakma */
#studioLayout::after,
#studioRoot .studioTwoPanel::after,
#studioRoot .studioLayout::after,
#studioRoot .studioGrid::after {
  content: none !important;
  display: none !important;
}

/* orta panel esneyebilsin */
#moduleHost {
  min-width: 0 !important;
  width: auto !important;
  max-width: none !important;
  flex: 1.75 1 0 !important;
}
/* sağ panel de ekranla birlikte büyüsün */
#rightPanelHost{
  min-width: 380px !important;
  width: auto !important;
  max-width: none !important;
  flex: 0.70 1 0 !important;
}

/* sağ kart host'u tam doldursun */
section.outputsCard.studioOutputs,
#twoPanelWrap .studioOutputs,
.outputsCard.studioOutputs{
  min-width: 420px !important;
  width: auto !important;
  flex: 1 1 0 !important;
}

#rightPanelHost .outputsCard{
  box-sizing: border-box !important;
}
/* =========================
   RightPanel – ortak shell
   ========================= */

#rightPanelHost {
  height: 100%;
  display: flex;
}

.rpShell {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  min-height: 0; /* scroll için kritik */
}

/* ===== Header (sticky) ===== */
.rpHeader {
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, rgba(20,18,40,.95), rgba(20,18,40,.85));
  backdrop-filter: blur(8px);
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.rpHeaderTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rpTitle {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2px;
}

.rpMeta {
  font-size: 12px;
  opacity: .7;
}

.rpHeaderBottom {
  margin-top: 8px;
}

.rpSearch {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.25);
  color: #fff;
  font-size: 13px;
}

.rpSearch::placeholder {
  opacity: .6;
}

.rpSearch:focus {
  outline: none;
  border-color: rgba(150,120,255,.6);
  box-shadow: 0 0 0 2px rgba(150,120,255,.15);
}

/* ===== Scroll body ===== */
.rpBody {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 6px 10px;
}

/* içerik wrapper */
.rpContent {
  display: block;
}
/* =========================
   RightPanel list wrappers — full width
   Müzik / Kapak listesi paneli tam doldursun
   ========================= */

#rightPanelHost .rpContent,
#rightPanelHost .rp-players,
#rightPanelHost .rp-playerCard {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

#rightPanelHost .rp-players,
#rightPanelHost .rp-playerCard {
  display: block !important;
}

#rightPanelHost .aivo-player-list {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  padding: 6px !important;
  align-items: stretch !important;
  box-sizing: border-box !important;
}

#rightPanelHost .aivo-player-card {
  width: 100% !important;
  max-width: none !important;
  justify-self: stretch !important;
  box-sizing: border-box !important;
}
/* =========================================================
   MODULE HOST — CLEAN SHELL FRAME
   Eski tasan pseudo frame'i kapatir
   Yerine daha temiz, altsiz premium cerceve cizer
   ========================================================= */

#moduleHost {
  position: relative !important;
  isolation: isolate !important;
}

/* Eski tasan dekoratif pseudo'lari tamamen kapat */
#moduleHost::before,
#moduleHost::after {
  content: none !important;
  display: none !important;
}

/* Yeni temiz frame */
#moduleHost > .module-shell-frame {
  pointer-events: none;
}

#moduleHost::marker {
  content: none;
}

/* Yeni dekoratif katman */
#moduleHost {
  background-image:
    linear-gradient(180deg, rgba(218, 110, 255, 0.34), rgba(218, 110, 255, 0.00) 90px),
    linear-gradient(180deg, rgba(86, 214, 255, 0.26), rgba(86, 214, 255, 0.00) 90px),
    linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.00) 56px);
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-size: 1px calc(100% - 34px), 1px calc(100% - 34px), calc(100% - 40px) 1px;
  background-position:
    left 12px top 22px,
    right 12px top 22px,
    center top 10px;
}

/* Hafif üst glow + ince dış hat, altsiz */
#moduleHost {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 1px 0 0 rgba(214,110,255,0.22),
    inset -1px 0 0 rgba(86,214,255,0.18);
  border-radius: 28px !important;
}
/* =========================================================
   MODULE HOST — BOTTOMLESS PREMIUM FRAME
   Daha sakin üst highlight + daha ince yan rail
   ========================================================= */

#moduleHost {
  position: relative !important;
  isolation: isolate !important;
  border-radius: 28px !important;

  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.00) 64px),
    radial-gradient(900px 240px at 50% 0%, rgba(196, 120, 255, 0.085), rgba(196, 120, 255, 0.00) 58%),
    linear-gradient(180deg, rgba(214,110,255,0.29), rgba(214,110,255,0.085) 20%, rgba(214,110,255,0.00) 78%),
    linear-gradient(180deg, rgba(86,214,255,0.255), rgba(86,214,255,0.085) 20%, rgba(86,214,255,0.00) 78%),
    linear-gradient(180deg, rgba(18, 16, 42, 0.965), rgba(8, 8, 24, 0.985)) !important;

  background-repeat: no-repeat !important;
  background-size:
    100% 64px,
    100% 240px,
    1px calc(100% - 42px),
    1px calc(100% - 42px),
    100% 100% !important;

  background-position:
    center top,
    center top,
    left 12px top 20px,
    right 12px top 20px,
    center center !important;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.065),
    inset 1px 0 0 rgba(214,110,255,0.20),
    inset -1px 0 0 rgba(86,214,255,0.17),
    0 16px 42px rgba(0,0,0,0.18) !important;
}

#moduleHost::before,
#moduleHost::after {
  content: none !important;
  display: none !important;
}
