<!DOCTYPE html>
<html lang="cs">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Tailwind CSS - Advanced Triky</title>
  <script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="p-8 bg-gray-50">
  <h1 class="text-3xl font-bold mb-8">Tailwind CSS - Advanced Triky 🚀</h1>

  <!-- ============================================ -->
  <!-- #2 PEER SELEKTORY -->
  <!-- ============================================ -->
  <section class="mb-12 bg-white p-6 rounded-lg border-2 border-blue-200">
    <h2 class="text-2xl font-bold mb-4 text-blue-700">#2 Peer selektory</h2>
    <p class="text-gray-600 mb-4">Sourozenec ovlivňuje sourozence</p>
    <div class="bg-gray-50 p-4 rounded mb-4">
      <code class="text-sm">peer + peer-checked:class</code>
    </div>
    
    <div class="mb-6">
      <h3 class="font-semibold mb-3">Checkbox ovládá label</h3>
      <div class="flex items-center gap-3">
        <input type="checkbox" id="check1" class="peer w-5 h-5" />
        <label for="check1" class="peer-checked:text-blue-600 peer-checked:font-bold cursor-pointer">
          Zaškrtni checkbox → label se změní
        </label>
      </div>
    </div>

    <div class="mb-6">
      <h3 class="font-semibold mb-3">Named peers (více peer prvků)</h3>
      <div class="space-y-3">
        <div>
          <input type="radio" name="opt" id="opt1" class="peer/opt1 hidden" />
          <label for="opt1" class="block p-3 border-2 border-gray-300 rounded cursor-pointer peer-checked/opt1:border-green-500 peer-checked/opt1:bg-green-50">
            Varianta 1
          </label>
          <div class="hidden peer-checked/opt1:block mt-2 p-3 bg-green-100 rounded">
            ✅ Obsah pro variantu 1
          </div>
        </div>
        <div>
          <input type="radio" name="opt" id="opt2" class="peer/opt2 hidden" />
          <label for="opt2" class="block p-3 border-2 border-gray-300 rounded cursor-pointer peer-checked/opt2:border-purple-500 peer-checked/opt2:bg-purple-50">
            Varianta 2
          </label>
          <div class="hidden peer-checked/opt2:block mt-2 p-3 bg-purple-100 rounded">
            ✅ Obsah pro variantu 2
          </div>
        </div>
      </div>
    </div>
  </section>

  <!-- ============================================ -->
  <!-- #4 MULTIPLE CONDITIONS -->
  <!-- ============================================ -->
  <section class="mb-12 bg-white p-6 rounded-lg border-2 border-green-200">
    <h2 class="text-2xl font-bold mb-4 text-green-700">#4 Multiple conditions (AND)</h2>
    <p class="text-gray-600 mb-4">Několik podmínek musí platit zároveň</p>
    <div class="bg-gray-50 p-4 rounded mb-4">
      <code class="text-sm">data-[active]:data-[type=premium]:bg-gold</code>
    </div>

    <div class="mb-6">
      <h3 class="font-semibold mb-3">Obě podmínky musí platit</h3>
      <div data-active data-type="premium" class="p-4 border-2 border-gray-300 data-[active]:data-[type=premium]:bg-yellow-100 data-[active]:data-[type=premium]:border-yellow-500 data-[active]:data-[type=premium]:font-bold">
        ✅ data-active + data-type="premium" → žluté pozadí
      </div>
      <div data-active class="p-4 mt-2 border-2 border-gray-300 data-[active]:data-[type=premium]:bg-yellow-100 data-[active]:data-[type=premium]:border-yellow-500">
        ❌ Jen data-active (chybí premium) → normální
      </div>
      <div data-type="premium" class="p-4 mt-2 border-2 border-gray-300 data-[active]:data-[type=premium]:bg-yellow-100 data-[active]:data-[type=premium]:border-yellow-500">
        ❌ Jen data-type="premium" (chybí active) → normální
      </div>
    </div>

    <div class="mb-6">
      <h3 class="font-semibold mb-3">Kombinace s hover a data atributem</h3>
      <button data-variant="danger" class="p-3 bg-red-500 text-white rounded hover:data-[variant=danger]:bg-red-700 hover:data-[variant=danger]:scale-105 transition">
        Hover + data-variant="danger" → tmavší a větší
      </button>
    </div>
  </section>

  <!-- ============================================ -->
  <!-- #5 NTH-CHILD SELEKTORY -->
  <!-- ============================================ -->
  <section class="mb-12 bg-white p-6 rounded-lg border-2 border-purple-200">
    <h2 class="text-2xl font-bold mb-4 text-purple-700">#5 Nth-child selektory</h2>
    <p class="text-gray-600 mb-4">Stylování podle pozice v DOM</p>
    <div class="bg-gray-50 p-4 rounded mb-4">
      <code class="text-sm">[&>*:nth-child(odd)]:bg-gray-100</code>
    </div>

    <div class="mb-6">
      <h3 class="font-semibold mb-3">Liché/sudé řádky (zebra pattern)</h3>
      <div class="[&>*:nth-child(odd)]:bg-gray-100 [&>*:nth-child(even)]:bg-white border-2 border-gray-300 rounded overflow-hidden">
        <div class="p-3">Řádek 1 (lichý) - šedé pozadí</div>
        <div class="p-3">Řádek 2 (sudý) - bílé pozadí</div>
        <div class="p-3">Řádek 3 (lichý) - šedé pozadí</div>
        <div class="p-3">Řádek 4 (sudý) - bílé pozadí</div>
      </div>
    </div>

    <div class="mb-6">
      <h3 class="font-semibold mb-3">První a poslední prvek</h3>
      <div class="[&>*:first-child]:font-bold [&>*:first-child]:text-green-600 [&>*:last-child]:font-bold [&>*:last-child]:text-red-600 space-y-2">
        <div class="p-3 border rounded">První prvek - zelený tučný</div>
        <div class="p-3 border rounded">Prostřední prvek - normální</div>
        <div class="p-3 border rounded">Poslední prvek - červený tučný</div>
      </div>
    </div>

    <div class="mb-6">
      <h3 class="font-semibold mb-3">Každý třetí prvek</h3>
      <div class="[&>*:nth-child(3n)]:bg-blue-100 [&>*:nth-child(3n)]:border-blue-500 space-y-2">
        <div class="p-2 border-2 rounded">Prvek 1</div>
        <div class="p-2 border-2 rounded">Prvek 2</div>
        <div class="p-2 border-2 rounded">Prvek 3 - modrý (3n)</div>
        <div class="p-2 border-2 rounded">Prvek 4</div>
        <div class="p-2 border-2 rounded">Prvek 5</div>
        <div class="p-2 border-2 rounded">Prvek 6 - modrý (3n)</div>
      </div>
    </div>

    <div class="mb-6">
      <h3 class="font-semibold mb-3">Not last-child (margin mezi prvky)</h3>
      <div class="[&>*:not(:last-child)]:mb-4">
        <div class="p-3 bg-gray-100 rounded">Prvek s marginem dole</div>
        <div class="p-3 bg-gray-100 rounded">Prvek s marginem dole</div>
        <div class="p-3 bg-gray-100 rounded">Poslední prvek BEZ marginu</div>
      </div>
    </div>
  </section>

  <!-- ============================================ -->
  <!-- #6 BEFORE/AFTER -->
  <!-- ============================================ -->
  <section class="mb-12 bg-white p-6 rounded-lg border-2 border-orange-200">
    <h2 class="text-2xl font-bold mb-4 text-orange-700">#6 Before/After pseudo-elementy</h2>
    <p class="text-gray-600 mb-4">Přidání obsahu bez HTML</p>
    <div class="bg-gray-50 p-4 rounded mb-4">
      <code class="text-sm">before:content-['→'] after:content-['✓']</code>
    </div>

    <div class="mb-6">
      <h3 class="font-semibold mb-3">Ikony před/za textem</h3>
      <div class="before:content-['→'] before:mr-2 before:text-blue-500 p-3 border rounded">
        Text se šipkou před
      </div>
      <div class="after:content-['✓'] after:ml-2 after:text-green-500 p-3 border rounded mt-2">
        Text se zaškrtávátkem za
      </div>
    </div>

    <div class="mb-6">
      <h3 class="font-semibold mb-3">Dekorativní čára</h3>
      <h2 class="text-xl font-bold before:content-[''] before:inline-block before:w-12 before:h-1 before:bg-purple-500 before:mr-3 before:align-middle">
        Nadpis s čárou
      </h2>
    </div>

    <div class="mb-6">
      <h3 class="font-semibold mb-3">Badge/štítek</h3>
      <div class="relative inline-block">
        <button class="px-4 py-2 bg-blue-500 text-white rounded after:content-['3'] after:absolute after:-top-2 after:-right-2 after:bg-red-500 after:text-white after:rounded-full after:w-6 after:h-6 after:flex after:items-center after:justify-center after:text-xs after:font-bold">
          Notifikace
        </button>
      </div>
    </div>

    <div class="mb-6">
      <h3 class="font-semibold mb-3">Citace s úvozovkami</h3>
      <blockquote class="before:content-['"'] after:content-['"'] before:text-4xl after:text-4xl before:text-gray-400 after:text-gray-400 p-4 bg-gray-50 rounded italic">
        <span class="text-lg">Toto je citace s automatickými úvozovkami</span>
      </blockquote>
    </div>

    <div class="mb-6">
      <h3 class="font-semibold mb-3">Tooltip (hover efekt)</h3>
      <span class="relative inline-block cursor-help underline decoration-dotted hover:after:content-['Tohle_je_tooltip'] hover:after:absolute hover:after:left-1/2 hover:after:-translate-x-1/2 hover:after:top-full hover:after:mt-2 hover:after:bg-gray-800 hover:after:text-white hover:after:px-3 hover:after:py-1 hover:after:rounded hover:after:text-sm hover:after:whitespace-nowrap">
        Najeď myší
      </span>
    </div>
  </section>

  <!-- ============================================ -->
  <!-- #7 SUPPORTS QUERIES -->
  <!-- ============================================ -->
  <section class="mb-12 bg-white p-6 rounded-lg border-2 border-pink-200">
    <h2 class="text-2xl font-bold mb-4 text-pink-700">#7 Supports queries (detekce CSS features)</h2>
    <p class="text-gray-600 mb-4">Aplikuj styly jen když prohlížeč podporuje feature</p>
    <div class="bg-gray-50 p-4 rounded mb-4">
      <code class="text-sm">supports-[backdrop-filter]:backdrop-blur-lg</code>
    </div>

    <div class="mb-6">
      <h3 class="font-semibold mb-3">Backdrop blur (fallback)</h3>
      <div class="relative h-40 bg-gradient-to-r from-blue-400 to-purple-500 rounded overflow-hidden">
        <img src="https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=400" class="w-full h-full object-cover" alt="pozadí" />
        <div class="absolute inset-0 flex items-center justify-center">
          <div class="bg-white/30 supports-[backdrop-filter]:backdrop-blur-md supports-[backdrop-filter]:bg-white/20 p-6 rounded-lg">
            <p class="font-bold text-white">
              S podporou: blur efekt<br/>
              Bez podpory: silnější opacity
            </p>
          </div>
        </div>
      </div>
    </div>

    <div class="mb-6">
      <h3 class="font-semibold mb-3">Grid layout (fallback na flex)</h3>
      <div class="flex flex-wrap gap-4 supports-[display:grid]:grid supports-[display:grid]:grid-cols-3">
        <div class="p-4 bg-blue-100 rounded">Box 1</div>
        <div class="p-4 bg-blue-100 rounded">Box 2</div>
        <div class="p-4 bg-blue-100 rounded">Box 3</div>
      </div>
      <p class="text-sm text-gray-600 mt-2">S podporou Grid: 3 sloupce | Bez: flex wrap</p>
    </div>
  </section>

  <!-- ============================================ -->
  <!-- #10 ARBITRARY PROPERTIES -->
  <!-- ============================================ -->
  <section class="mb-12 bg-white p-6 rounded-lg border-2 border-indigo-200">
    <h2 class="text-2xl font-bold mb-4 text-indigo-700">#10 Arbitrary properties (vlastní CSS)</h2>
    <p class="text-gray-600 mb-4">Použij libovolnou CSS property</p>
    <div class="bg-gray-50 p-4 rounded mb-4">
      <code class="text-sm">[property:value]</code>
    </div>

    <div class="mb-6">
      <h3 class="font-semibold mb-3">Mask image (gradient fade)</h3>
      <div class="[mask-image:linear-gradient(to_bottom,black_50%,transparent)] bg-gradient-to-r from-purple-400 to-pink-400 h-32 flex items-center justify-center text-white font-bold">
        Fade efekt dole
      </div>
    </div>

    <div class="mb-6">
      <h3 class="font-semibold mb-3">Text stroke</h3>
      <h2 class="text-5xl font-bold text-transparent [-webkit-text-stroke:2px_black]">
        OUTLINED TEXT
      </h2>
    </div>

    <div class="mb-6">
      <h3 class="font-semibold mb-3">Custom scrollbar</h3>
      <div class="h-32 overflow-y-scroll border-2 border-gray-300 rounded p-4 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-blue-500 [&::-webkit-scrollbar-thumb]:rounded">
        <p>Scrolluj dolů a uvidíš vlastní scrollbar.</p>
        <p class="mt-4">Lorem ipsum dolor sit amet.</p>
        <p class="mt-4">Lorem ipsum dolor sit amet.</p>
        <p class="mt-4">Lorem ipsum dolor sit amet.</p>
        <p class="mt-4">Lorem ipsum dolor sit amet.</p>
        <p class="mt-4">Konec obsahu.</p>
      </div>
    </div>

    <div class="mb-6">
      <h3 class="font-semibold mb-3">Aspect ratio nestandardní</h3>
      <div class="[aspect-ratio:21/9] bg-gradient-to-r from-orange-400 to-red-400 rounded flex items-center justify-center text-white font-bold">
        21:9 Ultrawide poměr
      </div>
    </div>
  </section>

  <!-- ============================================ -->
  <!-- #13 ARBITRARY VARIANTS S MODIFIERS -->
  <!-- ============================================ -->
  <section class="mb-12 bg-white p-6 rounded-lg border-2 border-teal-200">
    <h2 class="text-2xl font-bold mb-4 text-teal-700">#13 Arbitrary variants s media queries</h2>
    <p class="text-gray-600 mb-4">Vlastní podmínky a media queries</p>
    <div class="bg-gray-50 p-4 rounded mb-4">
      <code class="text-sm">[@media(hover:hover)]:hover:scale-110</code>
    </div>

    <div class="mb-6">
      <h3 class="font-semibold mb-3">Hover jen na zařízeních s hover (ne mobil)</h3>
      <button class="px-6 py-3 bg-blue-500 text-white rounded transition [@media(hover:hover)]:hover:scale-110 [@media(hover:hover)]:hover:bg-blue-600">
        Hover efekt jen na PC/notebooku
      </button>
      <p class="text-sm text-gray-600 mt-2">Na mobilu (touch) se škálování neaplikuje</p>
    </div>

    <div class="mb-6">
      <h3 class="font-semibold mb-3">Dark mode s prefers-color-scheme</h3>
      <div class="p-4 border-2 rounded bg-white [@media(prefers-color-scheme:dark)]:bg-gray-800 [@media(prefers-color-scheme:dark)]:text-white [@media(prefers-color-scheme:dark)]:border-gray-600">
        Tento box reaguje na systémové nastavení dark mode
      </div>
    </div>

    <div class="mb-6">
      <h3 class="font-semibold mb-3">Orientace zařízení</h3>
      <div class="p-4 border-2 rounded bg-blue-100 [@media(orientation:portrait)]:bg-green-100 [@media(orientation:landscape)]:bg-orange-100">
        <p class="font-semibold">Otoč zařízení:</p>
        <p class="text-sm">Portrait (na výšku) = zelená</p>
        <p class="text-sm">Landscape (na šířku) = oranžová</p>
      </div>
    </div>

    <div class="mb-6">
      <h3 class="font-semibold mb-3">Vlastní breakpoint</h3>
      <div class="p-4 border-2 rounded bg-gray-100 [@media(min-width:800px)]:bg-purple-100 [@media(min-width:800px)]:text-purple-800">
        Pod 800px: šedá | Nad 800px: fialová
      </div>
    </div>
  </section>

  <!-- ============================================ -->
  <!-- SHRNUTÍ -->
  <!-- ============================================ -->
  <section class="bg-gradient-to-r from-blue-50 to-purple-50 p-6 rounded-lg border-2 border-blue-300">
    <h2 class="text-2xl font-bold mb-6">📚 Rychlé shrnutí</h2>
    
    <div class="grid md:grid-cols-2 gap-4">
      <div class="bg-white p-4 rounded">
        <h3 class="font-bold text-blue-600 mb-2">#2 Peer</h3>
        <code class="text-xs">peer-checked:text-blue-500</code>
        <p class="text-sm text-gray-600 mt-1">Sourozenec ovlivňuje sourozence</p>
      </div>

      <div class="bg-white p-4 rounded">
        <h3 class="font-bold text-green-600 mb-2">#4 Multiple conditions</h3>
        <code class="text-xs">data-[a]:data-[b]:class</code>
        <p class="text-sm text-gray-600 mt-1">Obě podmínky musí platit (AND)</p>
      </div>

      <div class="bg-white p-4 rounded">
        <h3 class="font-bold text-purple-600 mb-2">#5 Nth-child</h3>
        <code class="text-xs">[&>*:nth-child(odd)]:bg-gray</code>
        <p class="text-sm text-gray-600 mt-1">Stylování podle pozice</p>
      </div>

      <div class="bg-white p-4 rounded">
        <h3 class="font-bold text-orange-600 mb-2">#6 Before/After</h3>
        <code class="text-xs">before:content-['→']</code>
        <p class="text-sm text-gray-600 mt-1">Pseudo-elementy s obsahem</p>
      </div>

      <div class="bg-white p-4 rounded">
        <h3 class="font-bold text-pink-600 mb-2">#7 Supports</h3>
        <code class="text-xs">supports-[backdrop-filter]:blur</code>
        <p class="text-sm text-gray-600 mt-1">Feature detection + fallback</p>
      </div>

      <div class="bg-white p-4 rounded">
        <h3 class="font-bold text-indigo-600 mb-2">#10 Arbitrary properties</h3>
        <code class="text-xs">[mask-image:gradient]</code>
        <p class="text-sm text-gray-600 mt-1">Libovolné CSS properties</p>
      </div>

      <div class="bg-white p-4 rounded">
        <h3 class="font-bold text-teal-600 mb-2">#13 Arbitrary variants</h3>
        <code class="text-xs">[@media(hover:hover)]:hover</code>
        <p class="text-sm text-gray-600 mt-1">Vlastní media queries</p>
      </div>
    </div>
  </section>

</body>
</html>