/* LEFT SIDEBAR */
#sidebar { width: var(--sidebar-w);
    grid-column: 1;
    grid-row: 2 / 4;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--ui-border);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease-in-out;
}

#sidebar-inner {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}

#sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#sidebar-toggle {
    background: none;
    border: none;
    color: var(--ui-text-muted);
    cursor: pointer;
    font-size: 1.5rem;
}

#sidebar-search {
    width: 100%;
    background-color: var(--ui-surface);
    border: 1px solid var(--ui-border);
    color: var(--ui-text);
    padding: 8px;
    border-radius: 4px;
}

#playbook-tree {
    flex-grow: 1;
    overflow-y: auto;
}

#sidebar-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* PLAYER PANEL */
#player-panel {
    border-top: 1px solid var(--ui-border);
    padding-top: 12px;
}
.panel-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}
.panel-tab {
    flex-grow: 1;
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    color: var(--ui-text-muted);
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
}
.panel-tab.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.player-tab-content {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* RIGHT FORMATIONS PANEL */
#formations-panel {
    grid-column: 3;
    grid-row: 2 / 4;
    background-color: var(--sidebar-bg);
    border-left: 1px solid var(--ui-border);
    transition: width 0.3s ease-in-out;
}
#formations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
}
#formations-toggle {
    background: none;
    border: none;
    color: var(--ui-text-muted);
    cursor: pointer;
    font-size: 1.5rem;
}
#formations-inner {
    padding: 0 12px;
}
.formations-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}
.ftab {
    flex-grow: 1;
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    color: var(--ui-text-muted);
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
}
.ftab.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
#formations-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
#formations-list button {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    color: var(--ui-text);
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}
#formations-list button:hover {
    background-color: var(--ui-surface-hover);
}
. p l a y b o o k - f o l d e r   h 3   {   m a r g i n - t o p :   8 p x ;   c o l o r :   v a r ( - - a c c e n t ) ;   }   . p l a y b o o k - s u b f o l d e r   {   m a r g i n - l e f t :   1 2 p x ;   }   . p l a y b o o k - s u b f o l d e r   h 4   {   c o l o r :   v a r ( - - u i - t e x t - m u t e d ) ;   m a r g i n :   4 p x   0 ;   f o n t - s i z e :   0 . 9 r e m ;   } 
 
 # s i d e b a r . c o l l a p s e d   { 
         w i d t h :   6 0 p x ; 
 } 
 
 

body.sidebar-collapsed #sidebar {
    width: 60px;
}

/* REVISION 3: New Play Dropdown Menu */
.new-play-group {
  position: relative;
  display: inline-block;
}

.dropdown-arrow {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  color: var(--ui-text);
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
}

.dropdown-arrow:hover {
  background-color: var(--ui-surface-hover);
}

.dropdown-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 220px;
  background: var(--ui-bg);
  border: 1px solid var(--ui-border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 100;
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 8px;
}

.dropdown-item {
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.15s;
  font-size: 13px;
}

.dropdown-item:hover {
  background-color: var(--ui-surface-hover);
}

.dropdown-divider {
  height: 1px;
  background: var(--ui-border);
  margin: 6px 0;
}

.dropdown-header {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: bold;
  color: var(--ui-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.play-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.play-item span {
  flex-grow: 1;
  cursor: pointer;
}
.share-btn {
  background: none;
  border: none;
  color: var(--ui-text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 3px;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.share-btn:hover {
  opacity: 1;
  background: var(--ui-surface-hover);
}
