<?php
require_once __DIR__ . '/includes/config.php';

$currentPage = 'case-converter';
$pageTitle = 'Case Converter Online - Uppercase, Lowercase, Title Case | Vivora Tools';
$pageDescription = 'Use this free online case converter to convert text to uppercase, lowercase, title case, or sentence case instantly. Paste or upload a .txt file.';
$canonicalPath = 'case-converter';
$bodyClass = 'tool-page case-converter-page';
$breadcrumbs = [
    ['name' => 'Home', 'url' => ''],
    ['name' => 'Case Converter', 'url' => 'case-converter'],
];
$structuredData = [
    [
        '@context' => 'https://schema.org',
        '@type' => 'WebApplication',
        'name' => 'Case Converter',
        'url' => site_url('case-converter'),
        'description' => $pageDescription,
        'applicationCategory' => 'UtilitiesApplication',
        'operatingSystem' => 'Any',
        'offers' => [
            '@type' => 'Offer',
            'price' => '0',
            'priceCurrency' => 'USD',
        ],
        'featureList' => [
            'Online text case converter',
            'Convert text to uppercase',
            'Convert text to lowercase',
            'Convert text to title case',
            'Convert text to sentence case',
            'Text file upload',
            'Copy converted output',
            'Reset text',
        ],
    ],
    [
        '@context' => 'https://schema.org',
        '@type' => 'FAQPage',
        'mainEntity' => [
            [
                '@type' => 'Question',
                'name' => 'What case formats can I convert text to?',
                'acceptedAnswer' => [
                    '@type' => 'Answer',
                    'text' => 'You can convert text to uppercase, lowercase, title case, or sentence case.',
                ],
            ],
            [
                '@type' => 'Question',
                'name' => 'Is this case converter free?',
                'acceptedAnswer' => [
                    '@type' => 'Answer',
                    'text' => 'Yes. Vivora Tools provides this case converter for free and does not require an account.',
                ],
            ],
            [
                '@type' => 'Question',
                'name' => 'Can I upload a text file?',
                'acceptedAnswer' => [
                    '@type' => 'Answer',
                    'text' => 'Yes. Upload a .txt file and the tool will convert the text using the selected case option.',
                ],
            ],
            [
                '@type' => 'Question',
                'name' => 'Do you store converted text?',
                'acceptedAnswer' => [
                    '@type' => 'Answer',
                    'text' => 'No. Text conversion runs in your browser, and Vivora Tools does not store your input or output text.',
                ],
            ],
        ],
    ],
];
require __DIR__ . '/includes/head.php';
require __DIR__ . '/includes/header.php';
?>

<section class="tool-hero case-converter-tool-hero">
  <div class="container">
    <div class="tool-hero-grid">
      <div>
        <nav class="tool-breadcrumb" aria-label="Breadcrumb">
          <a href="/">Home</a>
          <span>/</span>
          <span>Case Converter</span>
        </nav>
        <h1>Case Converter</h1>
        <p>
          Convert text case online with a free uppercase, lowercase, title case, and sentence case converter built for quick copy-ready output.
        </p>
      </div>
      <div class="tool-result" aria-live="polite">
        <span class="tool-result-label">Mode</span>
        <strong id="caseConverterModeResult">Upper</strong>
        <span class="tool-result-unit"><span id="caseConverterCharacterResult">0</span> characters</span>
      </div>
    </div>
  </div>
</section>

<main class="section pt-0">
  <div class="container">
    <section class="string-tool-shell case-converter-tool-shell" data-case-converter-tool>
      <div class="case-mode-panel" aria-label="Choose case conversion">
        <label class="case-mode-option">
          <input type="radio" name="caseMode" value="upper" checked />
          <span><i class="fa-solid fa-arrow-up-a-z" aria-hidden="true"></i> Upper</span>
        </label>
        <label class="case-mode-option">
          <input type="radio" name="caseMode" value="lower" />
          <span><i class="fa-solid fa-arrow-down-a-z" aria-hidden="true"></i> Lower</span>
        </label>
        <label class="case-mode-option">
          <input type="radio" name="caseMode" value="title" />
          <span><i class="fa-solid fa-heading" aria-hidden="true"></i> Title</span>
        </label>
        <label class="case-mode-option">
          <input type="radio" name="caseMode" value="sentence" />
          <span><i class="fa-solid fa-align-left" aria-hidden="true"></i> Sentence</span>
        </label>
      </div>

      <div class="string-tool-toolbar" aria-label="Case converter actions">
        <label class="icon-action upload-action" for="caseConverterFileInput" title="Upload .txt file">
          <i class="fa-solid fa-upload" aria-hidden="true"></i>
          <span>Upload .txt</span>
        </label>
        <input id="caseConverterFileInput" class="sr-only" type="file" accept=".txt,text/plain" />
        <button class="icon-action" type="button" id="copyCaseConverterOutputButton" title="Copy output">
          <i class="fa-solid fa-copy" aria-hidden="true"></i>
          <span>Copy</span>
        </button>
        <button class="icon-action danger" type="button" id="resetCaseConverterButton" title="Reset text">
          <i class="fa-solid fa-rotate-left" aria-hidden="true"></i>
          <span>Reset</span>
        </button>
      </div>

      <div class="dual-textarea-layout">
        <div class="string-input-panel">
          <label class="tool-label" for="caseConverterInput">Input text</label>
          <textarea id="caseConverterInput" class="string-textarea" rows="12" placeholder="Paste text to convert here..."></textarea>
          <div class="tool-meta-row">
            <span id="caseConverterToolStatus">Ready to convert text case.</span>
            <span><strong id="caseConverterInputCount">0</strong> input characters</span>
          </div>
        </div>

        <div class="string-input-panel output-panel">
          <label class="tool-label" for="caseConverterOutput">Output text</label>
          <textarea id="caseConverterOutput" class="string-textarea output-textarea" rows="12" placeholder="Converted output will appear here..." readonly></textarea>
          <div class="tool-meta-row">
            <span>Converted text</span>
            <span><strong id="caseConverterOutputCount">0</strong> output characters</span>
          </div>
        </div>
      </div>
    </section>

    <section class="tool-content-grid">
      <article>
        <h2>Convert text case online</h2>
        <p>
          Use uppercase, lowercase, title case, or sentence case depending on the format you need for headings, copy, notes, and documents.
        </p>
      </article>
      <article>
        <h2>Fast copy-ready output</h2>
        <p>
          Paste or upload text, choose a case style, and copy the converted result without leaving the page.
        </p>
      </article>
    </section>

    <section class="tool-seo-panel" aria-labelledby="caseConverterGuideTitle">
      <div class="tool-seo-intro">
        <span class="tool-seo-kicker">Case converter guide</span>
        <h2 id="caseConverterGuideTitle">How to use the Case Converter</h2>
        <p>
          Use this online case converter to clean up headings, titles, emails, product descriptions, notes, social captions, and document text.
        </p>
      </div>

      <div class="tool-steps">
        <article>
          <span>1</span>
          <h3>Choose a case style</h3>
          <p>Select uppercase, lowercase, title case, or sentence case from the conversion options.</p>
        </article>
        <article>
          <span>2</span>
          <h3>Add your text</h3>
          <p>Paste text, type directly, or upload a .txt file to convert the content instantly.</p>
        </article>
        <article>
          <span>3</span>
          <h3>Copy the output</h3>
          <p>Use the copy button to copy the converted text, or reset the tool for a new conversion.</p>
        </article>
      </div>
    </section>

    <section class="tool-seo-panel" aria-labelledby="caseConverterFaqTitle">
      <div class="tool-seo-intro">
        <span class="tool-seo-kicker">FAQs</span>
        <h2 id="caseConverterFaqTitle">Case Converter FAQs</h2>
      </div>

      <div class="tool-faq-list">
        <article>
          <h3>What case formats can I convert text to?</h3>
          <p>You can convert text to uppercase, lowercase, title case, or sentence case.</p>
        </article>
        <article>
          <h3>Is this case converter free?</h3>
          <p>Yes. Vivora Tools provides this online case converter for free with no account required.</p>
        </article>
        <article>
          <h3>Can I upload a text file?</h3>
          <p>Yes. Upload a .txt file and the tool will convert the text using the selected case option.</p>
        </article>
        <article>
          <h3>Do you store converted text?</h3>
          <p>No. The conversion runs in your browser, and Vivora Tools does not store your text.</p>
        </article>
      </div>
    </section>
  </div>
</main>

<?php require __DIR__ . '/includes/footer.php'; ?>
