:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #3f37c9;
    --dark: #1a1a2e;
    --light: #f8f9fa;
    --gray: #6c757d;
    --success: #4cc9f0;
    --warning: #f8961e;
    --error: #f72585;
  }
  
  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    min-height: 100vh;
    padding: 2rem;
    color: var(--dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .container {
    max-width: 900px;
    width: 100%;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Allows inner content to scroll */
  }
  
  .header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
  }
  
  .header h1 {
    font-weight: 700;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
  }
  
  .header p {
    font-weight: 300;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
  }
  
  .logo {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
  }
  
  .content {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
  }
  
  .upload-area {
    border: 2px dashed var(--gray);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    position: relative;
    background: #f8f9fa;
  }
  
  .upload-area:hover {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.05);
  }
  
  .upload-area.active {
    border-color: var(--success);
    background: rgba(76, 201, 240, 0.05);
  }
  
  .upload-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
  }
  
  .upload-text {
    margin-bottom: 1.5rem;
  }
  
  .upload-text h3 {
    font-weight: 600;
    margin-bottom: 0.5rem;
  }
  
  .upload-text p {
    color: var(--gray);
    font-size: 0.9rem;
  }
  
  .file-input {
    display: none;
  }
  
  .btn {
    display: inline-block;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }
  
  .btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  }
  
  .btn:active {
    transform: translateY(0);
  }
  
  .btn-secondary {
    background: white;
    color: var(--primary);
    border: 1px solid var(--primary);
  }
  
  .btn-secondary:hover {
    background: rgba(67, 97, 238, 0.1);
  }
  
  .btn-disabled {
    background: var(--gray);
    cursor: not-allowed;
    opacity: 0.7;
  }
  
  .btn-disabled:hover {
    transform: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }
  
  .preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    max-height: 300px;
    overflow: hidden;
  }
  
  .image-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    display: none;
  }
  
  .result-container {
    width: 100%;
    margin-top: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    max-height: 400px;
    overflow: hidden;
  }
  
  .result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
  }
  
  .result-header h3 {
    font-weight: 600;
    color: var(--primary);
  }
  
  .copy-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .copy-btn:hover {
    text-decoration: underline;
  }
  
  .result-text {
    width: 100%;
    min-height: 200px;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    background: #f8f9fa;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    resize: none;
    white-space: pre-wrap;
    flex: 1;
    overflow-y: auto;
  }
  
  .action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
  }
  
  .progress-container {
    width: 100%;
    margin: 1.5rem 0;
    display: none;
  }
  
  .progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
  }
  
  .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%);
    width: 0;
    transition: width 0.3s ease;
  }
  
  .progress-text {
    font-size: 0.9rem;
    color: var(--gray);
    text-align: center;
  }
  
  .features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
    padding: 2.5rem;
    background: #f8f9fa;
  }
  
  .feature-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
  }
  
  .feature-card:hover {
    transform: translateY(-5px);
  }
  
  .feature-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
  }
  
  .feature-card h3 {
    font-weight: 600;
    margin-bottom: 0.5rem;
  }
  
  .feature-card p {
    color: var(--gray);
    font-size: 0.9rem;
  }
  
  .footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid #e9ecef;
    color: var(--gray);
    font-size: 0.9rem;
    width: 100%;
  }
  
  .language-selector {
    margin: 1.5rem 0;
  }
  
  .language-selector label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
  }
  
  .language-selector select {
    width: 100%;
    max-width: 300px;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    font-family: 'Inter', sans-serif;
    margin: 0 auto;
    display: block;
  }
  
  @media (max-width: 768px) {
    body {
      padding: 1rem;
    }
    
    .container {
      border-radius: 9px;
    }
    
    .content {
      padding: 1.5rem;
    }
    
    .header {
      padding: 1.5rem;
    }
    
    .action-buttons {
      flex-direction: column;

    }
    
    .btn {
      width: 100%;
    }
    
    .features {
      grid-template-columns: 1fr;
      padding: 1.5rem;
    }
    
    .result-container {
      max-height: 330px;
    }
  }
  
  /* Animation */
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  .fade-in {
    animation: fadeIn 0.5s ease forwards;
  }