improve this code. hover effect should be like button, with some margin on edges of sidebar. border radius of 5px on all menu items, and icons must not shift <!DOCTYPE html>
<html>
<head>
  <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
  <style>
    :root {
      --sidebar-width: 260px;
      --sidebar-collapsed-width: 60px;
      --transition-speed: 0.3s;
      --bg-color: #ffffff;
      --hover-color: #f8f9fa;
      --active-color: #e9ecef;
      --text-color: #495057;
      --border-radius: 5px;
    }
    
    body { 
      margin: 0; 
      min-height: 100vh;
      font-family: Arial, sans-serif;
      background: #f0f2f5;
    }

    #sidebar-toggle {
      display: none;
    }
    
    .sidebar {
      position: fixed;
      left: 20px;
      top: 80px;
      bottom: 20px;
      width: var(--sidebar-width);
      background: var(--bg-color);
      border-radius: var(--border-radius);
      transition: width var(--transition-speed);
      overflow: hidden;
      box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }

    
    #sidebar-toggle:not(:checked) ~ .sidebar {
      width: var(--sidebar-collapsed-width);
    }
    
    .menu-item {
      position: relative;
      display: flex;
      align-items: center;
      height: 48px;
      color: var(--text-color);
      text-decoration: none;
      transition: background-color var(--transition-speed);
    }
    
    .menu-item:hover {
      background: var(--hover-color);
    }
    
    .menu-item.active {
      background: var(--active-color);
      font-weight: 500;
    }
    
    .icon {
      width: var(--sidebar-collapsed-width);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      color: #5c7cfa;
    }
    
    .label {
      position: absolute;
      left: var(--sidebar-collapsed-width);
      right: 0;
      top: 0;
      bottom: 0;
      display: flex;
      align-items: center;
      padding-left: 12px;
      font-size: 14px;
      white-space: nowrap;
      opacity: 1;
      transition: opacity var(--transition-speed);
    }
    
    #sidebar-toggle:not(:checked) ~ .sidebar .label {
      opacity: 0;
    }

    /* Floating Toggle Button */
    .toggle-label {
      position: fixed;
      top: 20px;
      left: 20px;
      width: var(--sidebar-collapsed-width);
      height: 48px;
      background: var(--bg-color);
      border-radius: var(--border-radius);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #5c7cfa;
      box-shadow: 0 2px 8px rgba(0,0,0,0.08);
      transition: background-color var(--transition-speed);
    }
    
    .toggle-label:hover {
      background: var(--hover-color);
    }

    /* Hamburger to X transformation */
    .toggle-label .fa-bars {
      transition: transform var(--transition-speed);
    }

    #sidebar-toggle:checked ~ .toggle-label .fa-bars {
      transform: rotate(180deg) scale(1.2);
    }

    .toggle-label .fa-bars::before {
      content: '\f0c9';
      transition: content var(--transition-speed);
    }

    #sidebar-toggle:checked ~ .toggle-label .fa-bars::before {
      content: '\f00d';
    }

    /* Hover effect when not toggled */
    @media (hover: hover) {
      #sidebar-toggle:not(:checked) ~ .sidebar:hover {
        width: var(--sidebar-width);
      }
      
      #sidebar-toggle:not(:checked) ~ .sidebar:hover .label {
        opacity: 1;
      }
    }
  </style>
</head>
<body>
  <input type="checkbox" id="sidebar-toggle">
  <label for="sidebar-toggle" class="toggle-label">
    <i class="fas fa-bars"></i>
  </label>
  
  <nav class="sidebar">
    <div class="menu-wrapper">
      <a href="#" class="menu-item active">
        <span class="icon"><i class="fas fa-home"></i></span>
        <span class="label">Dashboard</span>
      </a>
      <a href="#" class="menu-item">
        <span class="icon"><i class="fas fa-user-circle"></i></span>
        <span class="label">Profile</span>
      </a>
      <a href="#" class="menu-item">
        <span class="icon"><i class="fas fa-inbox"></i></span>
        <span class="label">Messages</span>
      </a>
      <a href="#" class="menu-item">
        <span class="icon"><i class="fas fa-chart-line"></i></span>
        <span class="label">Analytics</span>
      </a>
      <a href="#" class="menu-item">
        <span class="icon"><i class="fas fa-folder"></i></span>
        <span class="label">Projects</span>
      </a>
      <a href="#" class="menu-item">
        <span class="icon"><i class="fas fa-calendar-alt"></i></span>
        <span class="label">Calendar</span>
      </a>
      <a href="#" class="menu-item">
        <span class="icon"><i class="fas fa-cog"></i></span>
        <span class="label">Settings</span>
      </a>
    </div>
  </nav>
</body>
</html>