/* Modal Styles */
    .modal {
      display: none; 
      position: fixed; 
      z-index: 1000; 
      left: 0; 
      top: 0;
      width: 100%; 
      height: 100%; 
      background-color: rgba(0,0,0,0.4); 
    }

    .modal-content {
      background-color: #fff;
      margin: 5% auto; 
      padding: 20px; 
      border: 1px solid #888;
      width: 80%; 
      max-width: 800px;
      max-height: 80vh;
      position: absolute;
      border-radius: 4px;
      display: flex;
      flex-direction: column;
      resize: both;
      overflow: hidden;
      min-width: 300px;
      min-height: 200px;
      box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }

    .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding-bottom: 10px;
      border-bottom: 1px solid #eee;
      margin-bottom: 15px;
      cursor: move;
      user-select: none;
    }

    .modal-controls {
      display: flex;
      gap: 10px;
      align-items: center;
    }

    .font-size-control {
      display: flex;
      align-items: center;
      gap: 5px;
    }

    .font-size-control button {
      width: 30px;
      height: 30px;
      border: 1px solid #ddd;
      background: #f5f5f5;
      border-radius: 3px;
      cursor: pointer;
    }

    .modal-body {
      flex: 1;
      overflow-y: auto;
      padding: 10px 0;
      padding-top: 1px;
      font-size: 12px;
      line-height: 1.5;
      resize: none;
    }

    .close {
      color: #aaa;
      font-size: 28px; 
      font-weight: bold;
      cursor: pointer;
      line-height: 1;
    }

    .close:hover {
      color: #000;
    }

    /* Resize handle */
    .resize-handle {
      position: absolute;
      bottom: 0;
      right: 0;
      width: 20px;
      height: 20px;
      cursor: nwse-resize;
      background: linear-gradient(135deg, transparent 50%, #ccc 50%);
    }

    /* Button to trigger modal */
    /*
    #directions {
      padding: 10px 20px;
      background-color: #4CAF50;
      color: white;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      font-size: 12px;
      margin: 20px;
    }

    #directions:hover {
      background-color: #45a049;
    }
    */

    /* MathJax styling */
    .MathJax {
      font-size: inherit !important;
    }

    /* Reset button */
    #resetModal {
      padding: 5px 10px;
      background-color: #6c757d;
      color: white;
      border: none;
      border-radius: 3px;
      cursor: pointer;
      font-size: 12px;
    }

    #resetModal:hover {
      background-color: #5a6268;
    }