:root {
    --primary-color: #2196F3;
    --border-color: #ddd;
    --success-color: #1ca725;
    --diff-left-color: rgb(255, 193, 193);
    --diff-right-color: rgb(172, 238, 187);
    --line-left-color: rgb(255, 235, 233);
    --line-right-color: rgb(218, 251, 225);
    --line-number-bg: #f0f0f0;
    --line-number-color: #999;
  }
  
  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    padding: 10px;
    margin: 0;
    width: 100%;
    overflow-x: auto; /* Enable horizontal scrolling for the entire page */
    overflow-y: auto; /* Enable vertical scrolling for the entire page */
    min-height: 100vh; /* Full viewport height */
  }
  
  .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5px;
    overflow-x: visible;
    width: 100%;
    box-sizing: border-box;
  }
  
  .text-inputs {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
  }
  
  .text-input {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  
  .text-input-header {
    background-color: #f6f8fa;
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    padding: 10px 15px;
    font-weight: 600;
    font-size: 14px;
    color: #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .header-actions {
    display: flex;
    gap: 15px;
  }
  
  .header-action {
    color: var(--primary-color);
    cursor: pointer;
    font-size: 13px;
    font-weight: normal;
    text-decoration: none;
  }
  
  .header-action:hover {
    text-decoration: underline;
  }
  
  .text-editor-container {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 0 0 5px 5px;
    height: 300px;
    overflow: hidden;
  }
  
  .text-input textarea {
    width: 100%;
    height: 100%;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    padding: 15px;
    border: none;
    resize: none;
    overflow-y: auto;
  }
  
  .text-input textarea:focus {
    outline: none;
  }
  
  .button-container {
    display: flex;
    justify-content: center;
    margin: 25px 0;
  }
  
  button {
    padding: 10px 25px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
    overflow: hidden;
  }
  
  button:hover {
    background-color: #1976D2;
  }
  
  button:disabled {
    background-color: #90CAF9;
    cursor: not-allowed;
  }
  
  #result-panel {
    display: none;
    margin-top: 30px;
  }
  
  .results-header {
    display: flex;
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    overflow: hidden;
  }
  
  .result-title {
    flex: 1;
    padding: 10px 15px;
    font-weight: 600;
    font-size: 14px;
    background-color: #f6f8fa;
    color: #444;
  }
  
  .result-title:first-child {
    border-right: 1px solid var(--border-color);
  }
  
  .result-container {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 0 0 5px 5px;
    overflow: hidden;
    width: 100%;
  }
  
  .result-column {
    flex: 1;
    position: relative;
    min-height: 200px;
    overflow-y: auto;
    max-height: 500px;
  }
  
  .result-column:first-child {
    border-right: 1px solid var(--border-color);
  }
  
  .result {
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    padding: 15px;
    font-size: 14px;
    line-height: 1.5;
    width: 100%;
    box-sizing: border-box;
  }
  
  .identical-message {
    background: white;
    color: var(--success-color);
    padding: 30px;
    text-align: center;
    font-size: 18px;
    border-radius: 5px;
    width: 100%;
    font-weight: 500;
    border: 1px solid var(--border-color);
    margin-top: 30px;
  }
  
  .diff-word-left {
    background-color: var(--diff-left-color);
    font-weight: bold;
  }
  
  .diff-word-right {
    background-color: var(--diff-right-color);
    font-weight: bold;
  }
  
  .text1-line {
    background-color: var(--line-left-color);
  }
  
  .text2-line {
    background-color: var(--line-right-color);
  }
  
  /* Empty line placeholder */
  .empty-line {
    height: 1.5em;
    visibility: hidden;
    position: relative;
  }
  
  .empty-line::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #ddd;
    visibility: visible;
  }
  
  /* Ordered list styling for line numbers */
  .result ol {
    margin: 0;
    padding: 0 0 0 40px;
    list-style-position: outside;
  }
  
  .result ol li {
    padding: 0 0 0 5px;
    font-family: 'Courier New', monospace;
    white-space: pre;  /* Changed from pre-wrap to enable horizontal scrolling */
    line-height: 1.5;
    overflow-x: visible;
  }
  
  /* Special styling for list items that shouldn't have numbers */
  .result ol li.no-number {
    list-style-type: none;
    position: relative;
  }
  
  .file-input {
    display: none;
  }
  
  .error-message {
    color: #d32f2f;
    background-color: #ffebee;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 14px;
    display: none;
  }
  
  /* Loading overlay for text areas */
  .loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    display: none;
  }
  
  /* Loading spinner */
  .spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 4px solid rgba(33, 150, 243, 0.1);
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
  }
  
  /* Loading spinner for button */
  .button-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
  }
  
  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }
  
  @media screen and (max-width: 768px) {
    /* Container handling */
    .container {
      width: 100%;
      max-width: 100%;
      padding: 5px;
      overflow-x: auto; /* Allow horizontal scrolling */
    }
    
    body {
      overflow-x: auto; /* Enable horizontal scrolling */
      padding: 5px;
    }
    
    /* Text inputs handling */
    .text-inputs {
      flex-direction: column;
      gap: 15px;
      margin-bottom: 15px;
    }
    
    /* Ensure the button is visible */
    .button-container {
      margin: 15px 0;
      position: static;
      width: 100%;
    }
    
    button {
      width: 100%;
      max-width: none;
      padding: 15px;
      margin-bottom: 15px;
      font-size: 16px;
    }
    
    /* Results specific handling */
    #result-panel {
      width: 100%;
      margin-top: 15px;
      overflow: visible; /* Let child elements handle overflow */
    }
    
    .results-header {
      width: 100%;
      display: flex;
    }
    
    .result-title {
      width: 50%;
      flex: 0 0 50%;
    }
    
    .result-container {
      width: 100%;
      overflow-x: auto; /* Horizontal scroll */
      overflow-y: hidden; /* No vertical scroll at container level */
    }
    
    .result-column {
      width: 50%;
      flex: 0 0 50%;
      overflow-y: auto; /* Vertical scroll for each column */
      overflow-x: visible; /* Let container handle horizontal scroll */
      min-width: 150px; /* Minimum width to prevent excessive squeezing */
    }
    
    /* Ensure content is scrollable */
    .result ol {
      min-width: content; /* Ensure content width is respected */
      padding-left: 25px;
    }
    
    .result ol li {
      white-space: nowrap; /* Prevent line wrapping to enable horizontal scroll */
    }
    
    /* Ensure text areas are usable */
    .text-editor-container {
      height: 200px;
    }
    
    /* Fix for identical message */
    .identical-message {
      width: auto;
      margin-top: 15px;
    }
  }