/* WNF 2.0 - System Manager Styles */

.system-manager {
  position: fixed;
  left: 0;
  top: 60px;
  bottom: 0;
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(0, 212, 255, 0.3);
  z-index: 500;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
}

.system-manager.expanded {
  width: 280px;
}

.system-manager.collapsed {
  width: 50px;
}

/* Toggle button */
.sm-toggle {
  position: absolute;
  right: -15px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  background: #1a1a2e;
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  color: #00d4ff;
  font-size: 12px;
}

.sm-toggle:hover {
  background: rgba(0, 212, 255, 0.2);
  border-color: #00d4ff;
  transform: translateY(-50%) scale(1.1);
}

/* Content */
.sm-content {
  width: 100%;
  height: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.system-manager.collapsed .sm-content {
  opacity: 0;
  pointer-events: none;
}

/* Header */
.sm-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sm-icon {
  font-size: 40px;
  line-height: 1;
}

.sm-info {
  flex: 1;
  min-width: 0;
}

.sm-name {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sm-template {
  font-size: 12px;
  color: #00d4ff;
  font-weight: 500;
}

/* Stats */
.sm-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.sm-stat {
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
  transition: all 0.2s ease;
}

.sm-stat:hover {
  background: rgba(0, 212, 255, 0.15);
  border-color: rgba(0, 212, 255, 0.4);
}

.stat-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #00d4ff;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  display: block;
  font-size: 10px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Actions */
.sm-actions {
  display: flex;
  gap: 10px;
}

.sm-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #ddd;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sm-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.sm-btn .icon {
  font-size: 16px;
}

.sm-btn-refresh:hover {
  border-color: rgba(0, 212, 255, 0.5);
  color: #00d4ff;
}

.sm-btn-refresh.loading .icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.sm-btn-settings:hover {
  border-color: rgba(123, 44, 191, 0.5);
  color: #c77dff;
}

/* Quick Actions */
.sm-quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.sm-quick-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 10px;
  color: #ddd;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.sm-quick-btn:hover {
  background: rgba(0, 212, 255, 0.15);
  border-color: rgba(0, 212, 255, 0.3);
  color: #fff;
  transform: translateX(5px);
}

.sm-quick-btn span:first-child {
  font-size: 18px;
}

/* Footer */
.sm-footer {
  display: flex;
  gap: 10px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: auto;
}

.sm-btn-back {
  flex: 1;
}

.sm-btn-back:hover {
  border-color: rgba(255, 200, 0, 0.5);
  color: #ffd700;
}

.sm-btn-export {
  width: 42px;
  flex: none;
}

.sm-btn-export:hover {
  border-color: rgba(0, 255, 0, 0.5);
  color: #00ff00;
}

/* Scrollbar */
.sm-content::-webkit-scrollbar {
  width: 4px;
}

.sm-content::-webkit-scrollbar-track {
  background: transparent;
}

.sm-content::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.3);
  border-radius: 2px;
}

/* Pixel Code Modal */
.pixel-code-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.pixel-code-content {
  background: #1a1a2e;
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 15px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
}

.pixel-code-content h3 {
  color: #fff;
  margin: 0 0 10px 0;
}

.pixel-code-content p {
  color: #888;
  margin: 0 0 15px 0;
}

.pixel-code-content textarea {
  width: 100%;
  height: 80px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #00d4ff;
  font-family: monospace;
  font-size: 12px;
  padding: 12px;
  resize: none;
  margin-bottom: 15px;
}

.pixel-code-content .wnf-btn {
  margin-right: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .system-manager.expanded {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
    top: 60px;
    bottom: auto;
    height: auto;
    max-height: 50vh;
  }

  .sm-toggle {
    right: 50%;
    top: auto;
    bottom: -15px;
    transform: translateX(50%) rotate(90deg);
  }

  .system-manager.collapsed {
    width: 100%;
    height: 50px;
  }

  .sm-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}
