:root {
    --header-footer-color: #f9f9f9;
    --header-footer-border-color: #eee;

    --primary-color: #1E88E5;
    --secondary-color: #eaf3ff;
    --tertiary-color: #dbeafe;

    --particle-color: 130, 160, 255;
    --particle-shadow-color: 130, 105, 255;

    --border-color: #b8b8b8;

    --background-color: #fff;
    --text-color: #222;

    --cursor-overlay-color: #d40000;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    align-items: center;
    justify-content: center;  
    background-color: var(--background-color);
    margin: 0;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
}

section {
    padding-top: 5dvh;
}

#about {
    font-size: x-large;
    text-align: justify;
}

.sides {
    display: flex;
    flex-direction: row;
    justify-content: space-between;

    a {
        text-align: right;
    }

    @media (max-width: 768px) {
        flex-direction: column;
        gap: 10dvh;

        a {
            text-align: center;
        }
    }
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: auto;
    text-align: left;

    @media (max-width: 768px) {
        text-align: center;
    }
}

header {
    background: var(--header-footer-color);
    border-bottom: 1px solid var(--header-footer-border-color);
    padding: 10px 0;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    font-weight: bold;
    font-size: 1.2em;
    padding-left: 1dvw;

    @media (max-width: 768px) {
        font-size: 4dvw;
    }
}

header .logo a {
    color: black;
    text-decoration: none;
}

.nav-toggle {
    display: none;
    font-size: 1.5em;
    background: none;
    border: none;
    width: 40px;
    height: 30px;
    background: transparent;
    cursor: pointer;
    margin: 1dvw;
}

.nav-toggle input {
    display: none;
}

.nav-toggle span {
    display: block;
    position: absolute;
    height: 4px;
    width: 100%;
    background: black;
    border-radius: 9px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}

.nav-toggle span:nth-of-type(1) {
    top: 0px;
    transform-origin: left center;
}

.nav-toggle span:nth-of-type(2) {
    top: 50%;
    transform: translateY(-50%);
    transform-origin: left center;
}

.nav-toggle span:nth-of-type(3) {
    top: 100%;
    transform-origin: left center;
    transform: translateY(-100%);
}

.nav-toggle input:checked ~ span:nth-of-type(1) {
    transform: rotate(45deg);
    top: 0px;
    left: 5px;
}

.nav-toggle input:checked ~ span:nth-of-type(2) {
    width: 0%;
    opacity: 0;
}

.nav-toggle input:checked ~ span:nth-of-type(3) {
    transform: rotate(-45deg);
    top: 28px;
    left: 5px;
}

.modern-table {
  width: 100%;
  border-collapse: collapse;
  font-family: system-ui, -apple-system, sans-serif;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.modern-table thead tr {
    color: white;
    text-align: left;
}

.modern-table th,
.modern-table td {
    background-color: var(--primary-color);
    color: black;
    padding: 14px 18px;
}

.modern-table th {
    color: white;
}

.modern-table td:nth-child(odd) {
    background-color: var(--background-color);
}

.modern-table td:nth-child(even) {
    background-color: #f1f5f9;
}

.modern-table tbody tr:hover td {
    background-color: var(--tertiary-color);
    transition: background-color 0.2s ease;
}

/* Oddělení řádků */
.modern-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
}

/* Poslední řádek bez borderu */
.modern-table tbody tr:last-child {
    border-bottom: none;
}

iframe {
    border:1px solid gray;
}

.fade-in {
  opacity: 0;
  transform: translateY(-30px);
  transition: 1s;
}

.fade-in-loaded {
  opacity: 1;
  transform: translateY(0px);
}

@media (max-width: 768px) {
    header .container {
        flex-wrap: wrap;
    }

  header nav {
    overflow: hidden;
    opacity: 0;
    max-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--header-footer-color);
    margin-top: 10px;
    border-top: 1px solid var(--header-footer-border-color);
    transition: all 0.4s ease;
  }

  header nav a {
    padding: 10px;
    border-bottom: 1px solid var(--header-footer-border-color);
  }

  .nav-toggle {
    position: absolute;
    right: 3dvw;
    display: block;
  }

  header nav.active {
    opacity: 1;
    max-height: 500px;
  }
}

header nav a {
    margin-left: 20px;
    text-decoration: none;
    color: #333;
}

:not(:defined) > :not(.poster) {
    display: none;
}

@media (max-width: 768px) {
    model-viewer {
        display: none;
    }
}

model-viewer::part(default-progress-bar) {
    display: none;
}

.hero {
    /*margin-bottom: 30dvh;*/
    padding: 5dvw;
    background: var(--secondary-color);
}

.hero h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.hero p {
    font-size: 1.2em;
}

h2 {
    margin-top: 60px;
    margin-bottom: 20px;
    text-align: center;
}

.project-card-container {
    align-items: start;
    display: flex;
    flex-direction: column;
    padding-top: 1dvw;
    padding-left: 10dvw;
    padding-right: 10dvw;
    gap: 10dvh;
}

.project-card {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2dvw;
}

.project-card-desc {
    font-size: large;
    display: flex;
    flex-direction: column;
}

.project-card-desc h2 {
    text-align: left;
}

.project-card-desc p {
    text-align: justify;
}

.project-card-container .project-card:nth-child(odd) {
    align-self: flex-start;
}

.project-card-container .project-card:nth-child(even) {
    align-self: flex-end;
    transform: scaleX(-1);

    > * {
        transform: scaleX(-1);
    }
}

.project-card-container .project-card:nth-child(even) h2 {
    text-align: right;

    @media (max-width: 768px) {
        text-align: center;
    }
}

.project-card img {
    object-fit: cover;
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    background: var(--background-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    text-align: center;
    z-index: 1;
}

@media (max-width: 768px) {
    .project-card {
        display: flex;
        
        flex-direction: column;
    }

    .project-card h2 {
        text-align: center;
    }
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.card {
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--background-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    text-align: center;
    z-index: 1;
}

.card h3 {
    font-size: x-large;
}

.card-link {
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--background-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    text-align: center;
}

#card-link-overlay {
    position: fixed;
    background-color: var(--cursor-overlay-color);
    border-radius: 50%;
    height: 100px;
    width: 100px;
    text-align: center;
    font-size: 15px;
    line-height: 100px;
    z-index: 99;
    pointer-events: none;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.card-link:hover {
  cursor: none;
}

@media (max-width: 768px) {
    #card-link-overlay {
        all: unset;
        opacity: 0;
        display: none;
        position: fixed;
    }

    .card-link:hover {
        cursor: pointer;
    }

    .card-link::after {
        content: "Zobrazit více";
        color: var(--primary-color);
        font-size: small;
    }
}

.card-link h3 {
    font-size: x-large;
}

.order form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.order input,
.order textarea {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.order button {
    padding: 10px;
    border: none;
    background: var(--primary-color);
    color: var(--background-color);
    border-radius: 5px;
    cursor: pointer;
}

footer {
    margin-top: 60px;
    text-align: center;
    padding: 20px 0;
    background: var(--header-footer-color);
    border-top: 1px solid var(--header-footer-border-color);
}

.button {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 25px;
    background: var(--primary-color);
    border-radius: 5px;
    text-decoration: none;
    text-decoration: none;
    position: relative;
    border: none;
    color: var(--background-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.button:active {
    transform: scale(0.96);
}

.button:before,
.button:after {
    position: absolute;
    content: "";
    width: 150%;
    left: 50%;
    height: 100%;
    transform: translateX(-50%);
    z-index: -1000;
    background-repeat: no-repeat;
}

.button:hover:before {
    top: -70%;
    background-image: radial-gradient(circle, var(--primary-color) 20%, transparent 20%),
        radial-gradient(circle, transparent 20%, var(--primary-color) 20%, transparent 30%),
        radial-gradient(circle, var(--primary-color) 20%, transparent 20%),
        radial-gradient(circle, var(--primary-color) 20%, transparent 20%),
        radial-gradient(circle, transparent 10%, var(--primary-color) 15%, transparent 20%),
        radial-gradient(circle, var(--primary-color) 20%, transparent 20%),
        radial-gradient(circle, var(--primary-color) 20%, transparent 20%),
        radial-gradient(circle, var(--primary-color) 20%, transparent 20%),
        radial-gradient(circle, var(--primary-color) 20%, transparent 20%);
    background-size: 10% 10%, 20% 20%, 15% 15%, 20% 20%, 18% 18%, 10% 10%, 15% 15%,
        10% 10%, 18% 18%;
    background-position: 50% 120%;
    animation: greentopBubbles 0.6s ease;
}

@keyframes greentopBubbles {
    0% {
        background-position: 5% 90%, 10% 90%, 10% 90%, 15% 90%, 25% 90%, 25% 90%,
        40% 90%, 55% 90%, 70% 90%;
    }

    50% {
        background-position: 0% 80%, 0% 20%, 10% 40%, 20% 0%, 30% 30%, 22% 50%,
        50% 50%, 65% 20%, 90% 30%;
    }

    100% {
        background-position: 0% 70%, 0% 10%, 10% 30%, 20% -10%, 30% 20%, 22% 40%,
        50% 40%, 65% 10%, 90% 20%;
        background-size: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
    }
}

.button:hover::after {
    bottom: -70%;
    background-image: radial-gradient(circle, var(--primary-color) 20%, transparent 20%),
        radial-gradient(circle, var(--primary-color) 20%, transparent 20%),
        radial-gradient(circle, transparent 10%, var(--primary-color) 15%, transparent 20%),
        radial-gradient(circle, var(--primary-color) 20%, transparent 20%),
        radial-gradient(circle, var(--primary-color) 20%, transparent 20%),
        radial-gradient(circle, var(--primary-color) 20%, transparent 20%),
        radial-gradient(circle, var(--primary-color) 20%, transparent 20%);
    background-size: 15% 15%, 20% 20%, 18% 18%, 20% 20%, 15% 15%, 20% 20%, 18% 18%;
    background-position: 50% 0%;
    animation: greenbottomBubbles 0.6s ease;
}

@keyframes greenbottomBubbles {
    0% {
        background-position: 10% -10%, 30% 10%, 55% -10%, 70% -10%, 85% -10%,
        70% -10%, 70% 0%;
    }

    50% {
        background-position: 0% 80%, 20% 80%, 45% 60%, 60% 100%, 75% 70%, 95% 60%,
        105% 0%;
    }

    100% {
        background-position: 0% 90%, 20% 90%, 45% 70%, 60% 110%, 75% 80%, 95% 70%,
        110% 10%;
        background-size: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
    }
}

.particles {
    z-index: 0;
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    left: var(--x);
    top: var(--y);

    width: calc(var(--size) * 2);
    height: calc(var(--size) * 2);

    border-radius: 50%;

    animation:
        particle-move var(--duration) ease-in-out var(--delay) infinite alternate,
        particle-pulse var(--pulse-duration) ease-in-out var(--delay) infinite;

    will-change: transform, opacity;

    background:  rgba(var(--particle-color), var(--opacity));
    box-shadow:
        0 0 calc(var(--size) * 2) rgba(var(--particle-shadow-color), 0.45),
        0 0 calc(var(--size) * 5) rgba(var(--particle-shadow-color), 0.15);
}


.particle:nth-child(3n) {
    filter: blur(2px);
}

.particle:nth-child(5n) {
    filter: blur(8px);
}

@keyframes particle-move {
  0% {
    transform:
      translate3d(0, 0, 0)
      rotate(0deg)
      scale(1);
  }
  25% {
    transform:
      translate3d(
        calc(var(--move-x) * 0.35),
        calc(var(--move-y) * -0.4),
        0
      )
      rotate(90deg)
      scale(1.15);
  }
  50% {
    transform:
      translate3d(
        calc(var(--move-x) * -0.25),
        calc(var(--move-y) * 0.3),
        0
      )
      rotate(180deg)
      scale(0.85);
  }
  75% {
    transform:
      translate3d(
        calc(var(--move-x) * 0.65),
        calc(var(--move-y) * 0.15),
        0
      )
      rotate(270deg)
      scale(1.1);
  }
  100% {
    transform:
      translate3d(
        var(--move-x),
        var(--move-y),
        0
      )
      rotate(360deg)
      scale(1);
  }
}

@keyframes particle-pulse {
  0%,
  100% {
    opacity: 0.3;
  }

  50% {
    opacity: 1;
  }
}