/* =========================================================
   layout.css — adCraftAI Mini layout overrides
   Purpose:
   - Collapsible sidebar (icon-only)
   - Project info header bar (collapsible)
   - Responsive containers that fill remaining space
   ========================================================= */

:root{
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 64px;

  --sidebar-bg-top: #1f2937;     /* slate-800 */
  --sidebar-bg-bot: #0f172a;     /* slate-900 */
  --sidebar-fg: #f8fafc;

  --header-bg: rgba(15, 23, 42, 0.72); /* slate-900 with transparency */
  --header-fg: #f8fafc;

  --panel-bg: #ffffff;
  --panel-border: #e5e7eb;

  --muted: rgba(255,255,255,0.70);
}

/* ---- kill global body padding/centering coming from styles.css ---- */
html, body { height: 100%; }

body{
  padding: 0 !important;          /* overrides styles.css body padding:20px */
  margin: 0;
  text-align: left !important;    /* overrides styles.css body text-align:center */
}

/* ---- main shell ---- */
.layout{
  min-height: 100vh;
}

/* ---- SIDEBAR (expanded) ---- */
.sidebar{
  width: var(--sidebar-w);
  padding: 12px;
  background: linear-gradient(180deg, var(--sidebar-bg-top), var(--sidebar-bg-bot));
  color: var(--sidebar-fg);
  box-shadow: 2px 0 14px rgba(0,0,0,0.18);
  transition: width 180ms ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-top{
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.sidebar-bottom{
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.10);
}

/* brand row */
.sidebar-brand{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.layout-toggle-btn{
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
  color: var(--sidebar-fg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.layout-toggle-btn:hover{
  background: rgba(255,255,255,0.10);
}

.sidebar-logo-link{
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.sidebar-logo-img{
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.sidebar-appname{
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* nav lists */
.sidebar .nav-links{
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar .nav-links li{
  width: 100%;
}

.sidebar .nav-links a{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 10px;
  color: var(--sidebar-fg);
  text-decoration: none;
  font-size: 0.95rem;

  /* override styles.css hover scaling */
  transform: none !important;
}

.sidebar .nav-links a:hover{
  background: rgba(255,255,255,0.08);
}

.sidebar .nav-links a.active{
  background: rgba(255,255,255,0.12);
  border-left: 3px solid rgba(255,255,255,0.55);
}

/* icon/label helpers */
.sidebar .icon{
  width: 22px;
  flex: 0 0 22px;
  text-align: center;
}

.sidebar .label{
  white-space: nowrap;
}

/* section headers */
.sidebar .nav-section{
  padding: 0;                /* overrides styles.css nav-section padding */
  margin: 2px 0 6px 0;
  border-radius: 10px;
}

.sidebar .section-title{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  font-size: 0.95rem;
}

.sidebar .section-title:hover{
  background: rgba(255,255,255,0.08);
}

.sidebar .submenu{
  display: none;             /* JS toggles this to block */
  padding-left: 14px;
  margin-top: 6px;
}

.sidebar .submenu a{
  padding: 8px 10px;
  font-size: 0.92rem;
  border-radius: 10px;
}

.nav-divider{
  height: 1px;
  margin: 10px 4px 14px;
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
}

/* ---- SIDEBAR (collapsed) ---- */
.sidebar.collapsed{
  width: var(--sidebar-w-collapsed);
  padding: 10px 8px;
}

.sidebar.collapsed .label{
  display: none;
}

.sidebar.collapsed .sidebar-appname{
  display: none;
}

.sidebar.collapsed .nav-links a{
  display: flex !important;
  justify-content: center !important;
  padding: 10px 0 !important;
  width: 100%;
}

.sidebar.collapsed .section-title{
  justify-content: center !important;
  padding: 10px 0 !important;
  width: 100%;
}


.sidebar.collapsed .submenu{
  display: none !important;
}

.sidebar.collapsed .vc-widget{
  display: none;
}

/* ---- MAIN CONTENT ---- */
.main-content{
  flex: 1;
  min-width: 0;
  padding: 14px 16px;        /* overrides styles.css main-content padding */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---- PROJECT HEADER ---- */
.project-header{
  position: sticky;
  top: 12px;
  z-index: 50;

  background: var(--header-bg);
  color: var(--header-fg);
  backdrop-filter: blur(12px);

  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;

  padding: 10px 14px;
  margin-bottom: 14px;
}

.project-header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ph-left{
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 200px;
}

.ph-app{
  font-size: 0.82rem;
  opacity: 0.85;
  letter-spacing: 0.2px;
}

.ph-project{
  font-size: 0.98rem;
  font-weight: 750;
  line-height: 1.15;
  word-break: break-word;
}

.ph-right{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.ph-chip{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  font-size: 0.85rem;
}

.ph-k{ opacity: 0.80; }
.ph-v{ font-weight: 650; }

/* header collapsed */
.project-header.collapsed{
  height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  overflow: hidden;
}

/* ---- PAGE CONTENT SCROLLER ---- */
.page-content{
  flex: 1;
  min-width: 0;
  overflow: auto;
}

/* ---- container expansion: override the fixed 1100px ---- */
.page-content .container{
  max-width: none !important;      /* overrides styles.css max-width:1100px */
  width: 100%;
  margin: 0 0 14px 0 !important;   /* overrides styles.css margin:30px auto */
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

/* ---- small screens: default collapsed look ---- */
@media (max-width: 768px){
  .sidebar{
    width: var(--sidebar-w-collapsed);
  }
  .sidebar .label,
  .sidebar .sidebar-appname{
    display: none;
  }
  .sidebar .submenu{
    display: none !important;
  }
}


/* =========================================================
   B27/B28: Make Scene cards expand (remove old 950px cap)
   Target: Scene containers like "Scene 01", "Scene 02", ...
   ========================================================= */

.page-content #scenes-container .scene-box{
  width: 90% !important;
  max-width: 90% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.page-content #scenes-container .scene-body{
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}


