<script>
  import { page } from '$app/stores';
</script>

<svelte:head>
  <title>404 - KRETÉN - Valaki már letörölte</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
</svelte:head>

<div class="app-container">
  <main>
    <div class="logo-container">
      <img src="/logo.png" class="logo" alt="KRETÉN logo">
    </div>

    <div class="error-container">
      <div class="error-header">
        <h2>néccánégy nem található</h2>
      </div>

      <div class="error-content">
        <p class="error-message">
          A keresett oldal ({$page.url.pathname}) már nem található meg a rendszerben.
        </p>
        <p class="error-note">
          Lehetséges okok:
        </p>
        <ul class="error-reasons">
          <li>Az admin már letörölte az egész adatbázist (legvalószínűbb)</li>
          <li>Róbert'); DROP TABLE Pages;-- megint SQL injectiont használt</li>
          <li>Az api-t megint megváltozatták és ez az oldal még nem használja az új api-t</li>
          <li>Az oldal sosem létezett, csak képzelted</li>
          <li>:3</li>
        </ul>
        <div class="error-actions">
          <a href="/" class="back-button">Vissza a bejelentkezéshez</a>
        </div>
      </div>
    </div>
  </main>

  <footer>
    <p>Készült 🍊 megbízásából, 12 Mrd ft közpénzből</p> 
    <div class="footer-links">
      <a href="/kreta_src.zip" style="color: white; text-decoration: none;">kreta_src.zip</a>
      <span class="footer-separator">|</span>
      <a href="https://spitkov.hu" style="color: white; text-decoration: none;">spitkov.hu</a>
    </div>
  </footer>
</div>

<style>
  :global(html), :global(body) {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
  }
  
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
  }

  .app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100vw;
    background-color: #2d4f5a;
    color: #333;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-x: hidden;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  }

  main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: clamp(1rem, 5vw, 2rem);
    width: 100%;
    margin-top: clamp(1rem, 5vh, 3rem);
  }

  .logo-container {
    margin-bottom: clamp(1.5rem, 5vh, 2rem);
    text-align: center;
    padding: 0 1rem;
  }

  .logo {
    max-width: 100%;
    height: auto;
    width: auto;
    max-height: 120px;
  }

  .error-container {
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 600px;
    overflow: hidden;
    margin: 0 1rem;
  }

  .error-header {
    background-color: #e74c3c;
    color: white;
    padding: 1rem;
    text-align: center;
  }

  .error-header h2 {
    font-size: clamp(1rem, 4vw, 1.2rem);
    font-weight: normal;
    margin: 0;
    line-height: 1.3;
  }

  .error-content {
    padding: clamp(1rem, 4vw, 1.5rem);
  }

  .error-message {
    margin-bottom: 1rem;
    font-size: clamp(0.85rem, 3.5vw, 0.9rem);
    color: #e74c3c;
    font-weight: bold;
  }

  .error-note {
    margin-bottom: 0.5rem;
    font-size: clamp(0.85rem, 3.5vw, 0.9rem);
    font-weight: bold;
  }

  .error-reasons {
    list-style-type: none;
    margin-bottom: 1.5rem;
    padding: 0;
  }

  .error-reasons li {
    margin-bottom: 0.5rem;
    font-size: clamp(0.85rem, 3.5vw, 0.9rem);
    padding-left: 1.5rem;
    position: relative;
  }

  .error-reasons li::before {
    content: "•";
    position: absolute;
    left: 0.5rem;
    color: #e74c3c;
  }

  .error-actions {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
  }

  .back-button {
    background-color: #30b0d5;
    color: white;
    border: none;
    border-radius: 4px;
    padding: clamp(0.6rem, 3vw, 0.8rem) clamp(1rem, 4vw, 1.2rem);
    font-size: clamp(0.85rem, 3.5vw, 0.9rem);
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    min-width: 200px;
    text-align: center;
  }

  .back-button:hover {
    background-color: #2698bb;
  }

  footer {
    text-align: center;
    padding: clamp(0.8rem, 3vw, 1rem);
    color: white;
    font-size: clamp(0.75rem, 3vw, 0.8rem);
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
  }

  .footer-links {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .footer-separator {
    color: rgba(255, 255, 255, 0.5);
  }

  footer a {
    color: white;
    text-decoration: none;
    padding: 0.5rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  @media (max-width: 640px) {
    .logo {
      max-height: 100px;
    }

    .error-container {
      margin: 0 0.5rem;
    }

    .error-content {
      padding: 1rem;
    }
  }

  @media (orientation: landscape) and (max-height: 600px) {
    main {
      margin-top: 0.5rem;
    }

    .logo {
      max-height: 80px;
    }

    .logo-container {
      margin-bottom: 1rem;
    }
  }
</style> 