/* Modern Tokenizer Application Styles */

:root {
    --primary-color: #4a6fa5;
    --primary-hover: #385d8a;
    --secondary-color: #f8f9fa;
    --accent-color: #7bc5ae;
    --dark-color: #2c3e50;
    --error-color: #e74c3c;
    --success-color: #2ecc71;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
  }
  
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  }
  
  body {
    background-color: #f5f7fa;
    color: var(--dark-color);
    line-height: 1.6;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
  }
  
  header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
    border-bottom: 1px solid #e1e4e8;
  }
  
  header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
  }
  
  header h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
  }
  
  main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
  }
  
  textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    resize: vertical;
    font-size: 16px;
    line-height: 1.5;
    transition: var(--transition);
    min-height: 120px;
  }
  
  textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.2);
  }
  
  button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
  }
  
  button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
  }
  
  /* Vocabulary Section */
  .vocabulary {
    background-color: white;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
  }
  
  .vocab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
    gap: 10px;
  }
  
  .vocab-header label {
    font-weight: 600;
    font-size: 16px;
  }
  
  #vocabSize {
    font-weight: 700;
    color: var(--primary-color);
  }
  
  /* Encoder and Decoder Sections */
  .encoder, .decoder {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
  }
  
  .encode, .decode {
    background-color: white;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
  }
  
  .output {
    position: relative;
    background-color: var(--secondary-color);
    border-left: 4px solid var(--accent-color);
  }
  
  .encoded-string, .decoded-string {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    min-height: 120px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-family: monospace;
    white-space: pre-wrap;
    color: #333;
    position: relative;
  }
  
  /* Responsive Design */
  @media (max-width: 768px) {
    .encoder, .decoder {
      grid-template-columns: 1fr;
    }
  
    .vocab-header {
      flex-direction: column;
      align-items: flex-start;
    }
  
    textarea {
      min-height: 100px;
    }
  
    body {
      padding: 15px;
    }
    
    header {
      margin-bottom: 20px;
    }
  }
  
  /* Animation for focus */
  @keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(74, 111, 165, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(74, 111, 165, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 111, 165, 0); }
  }
  
  textarea:focus {
    animation: pulse 1.5s infinite;
  }
  
  /* Add a bit of polish */
  .encoded-string::before, .decoded-string::before {
    content: '{ }';
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 14px;
    color: #999;
    opacity: 0.5;
  }