/**
 * SpinPro Drawer System (Type 2: Slide-Out Panel)
 * Right-side contextual panels
 */

/* Drawer Backdrop */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: var(--z-drawer);
  opacity: 0;
  transition: opacity var(--transition-drawer);
  pointer-events: none;
}

.drawer-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

/* Drawer Container */
.drawer {
  position: fixed;
  top: 0;
  right: -600px; /* Off-screen initially */
  width: 600px;
  height: 100vh;
  background: var(--color-surface);
  backdrop-filter: var(--glass-blur);
  box-shadow: -2px 0 16px rgba(0, 0, 0, 0.15);
  z-index: var(--z-drawer-panel); /* one above backdrop so it's never covered */
  transition: right var(--transition-drawer);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer.open {
  right: 0;
}

/* Drawer Sizes */
.drawer-sm {
  width: var(--drawer-sm);
  right: -400px;
}

.drawer-sm.open {
  right: 0;
}

.drawer-lg {
  width: var(--drawer-lg);
  right: -800px;
}

.drawer-lg.open {
  right: 0;
}

/* Drawer Header */
.drawer-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  position: relative;
  flex-shrink: 0;
}

.drawer-header h2 {
  margin: 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  padding-right: var(--space-xxl);
}

/* Drawer Tabs */
.drawer-tabs {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.drawer-tabs .tab {
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.drawer-tabs .tab:hover {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.drawer-tabs .tab.active {
  color: var(--neon-cyan);
  border-bottom-color: var(--neon-cyan);
}

/* Drawer Body */
.drawer-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.drawer-content {
  padding: var(--space-lg);
  flex: 1;
}

/* Drawer Footer */
.drawer-footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Drawer Section */
.drawer-section {
  margin-bottom: var(--space-lg);
}

.drawer-section:last-child {
  margin-bottom: 0;
}

.drawer-section-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

.drawer-section-content {
  color: var(--color-text-primary);
}

/* Drawer List */
.drawer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.drawer-list-item {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-list-item:last-child {
  border-bottom: none;
}

.drawer-list-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.drawer-list-value {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
}

/* Responsive */
@media (max-width: 767px) {
  .drawer {
    width: 100%;
    right: -100%;
  }

  .drawer.open {
    right: 0;
  }

  .drawer-sm,
  .drawer-lg {
    width: 100%;
    right: -100%;
  }

  .drawer-sm.open,
  .drawer-lg.open {
    right: 0;
  }
}
