body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    color: #f5f5f5;
    background: url('https://www.transparenttextures.com/patterns/diamond-upholstery.png'), linear-gradient(to bottom, #1e3c72, #2a5298);
  }
  
  .container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  }
  
  h1 {
    text-align: center;
    color: #333;
  }
  
  .controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: 100px;
  }
  
  button {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background-color: #4CAF50;
    color: white;
  }
  
  #dequeueBtn {
    background-color: #f44336;
  }
  
  #clearBtn {
    background-color: #ff9800;
  }
  
  .visualization {
    position: relative;
    min-height: 400px;
    margin-top: 20px;
    overflow: visible;
    transition: all 0.5s ease-in-out;
  }
  
  .node-container {
    position: absolute;
    display: flex;
    transition: all 0.5s ease-in-out;
  }
  
  /* Node value: round left side, square on right side */
  .node-value {
    width: 50px;
    height: 50px;
    border: 2px solid #2196F3;
    background-color: #e3f2fd;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    /* Rounded on left only, square on right */
    border-radius: 8px 0 0 8px;
    color: black;
  }
  
  /* Node pointer: reduced width; square on left, rounded on right */
  .node-pointer {
    width: 20px;
    height: 50px;
    border: 2px solid #666;
    border-left: none;
    background-color: #fff;
    border-radius: 0 8px 8px 0;
  }
  
  /* When a pointer is null, show a diagonal division */
  .node-pointer.null {
    background: linear-gradient(45deg, transparent 50%, #666 50%);
  }
  
  .pointer-box {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 2px solid #333;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    z-index: 2;
    border-radius: 8px;
  }
  
  /* When a pointer box is null (queue empty), show a diagonal division */
  .pointer-box.null-pointer {
    background: linear-gradient(45deg, transparent 50%, #333 50%);
  }
  
  .head-box {
    top: 30px;
    left: 30px;
  }
  
  .tail-box {
    bottom: 30px;
    left: 30px;
  }
  
  .pointer-label {
    position: absolute;
    font-size: 14px;
    color: #333;
    font-weight: bold;
  }
  
  .head-label {
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
  }
  
  .tail-label {
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
  }
  
  .arrow {
    position: absolute;
    height: 3px;
    background-color: #333;
    transform-origin: left center;
    z-index: 1;
    transition: all 0.5s ease-in-out;
  }
  
  .arrow::after {
    content: '';
    position: absolute;
    right: -2px;
    top: -4px;
    width: 0;
    height: 0;
    border-left: 8px solid #333;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
  }
  
  .status {
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
  }
  
  .success {
    background-color: #dff0d8;
    color: #3c763d;
  }
  
  .error {
    background-color: #f2dede;
    color: #a94442;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  .new-node {
    animation: fadeIn 0.5s ease-in;
  }
  