@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap");

html,
body {
  height: 100%;
}

body {
  font-family: "Montserrat", sans-serif;
  background: url("../images/background001.jpg") no-repeat right bottom;
  background-size: cover;
  background-attachment: fixed;
  -webkit-background-size: cover;
  -webkit-background-attachment: fixed;
}

body:not(.subpage) {
  display: flex;
  align-items: center;
  justify-content: center;
}

body.subpage {
  display: block;
  padding-top: 50px;
}

* {
  margin: 0;
  padding: 16px 0;
  box-sizing: border-box;
}

#outer-container {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 20px 0;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
  transform: perspective(800px) translateZ(0);
}

.tile {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  text-decoration: none;
  font-size: calc(1.5rem + 1vw);
  font-weight: 700;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 -5px 15px rgba(0, 255, 255, 0.7),
    5px 0 15px rgba(0, 255, 255, 0.7);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
  position: relative;
  filter: brightness(0.9);
}

.tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transform: skewX(-20deg);
  animation: tileShimmer 2s infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes tileShimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

#tile-container {
  display: flex;
  justify-content: flex-start;
  overflow: hidden;
}

.tile {
  flex: 0 0 auto;
  aspect-ratio: 2 / 1;
}

.tile-track {
  display: flex;
  flex-wrap: nowrap;
  animation: scrollTiles 20s linear infinite;
}

@keyframes scrollTiles {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-1 * var(--scroll-distance)));
  }
}

.subpage-header {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  height: 100px;
  padding: 5px 10px;
  overflow: hidden;
}

.header-tile-container {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.header-tile-track {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  animation: scrollHeaderTiles 20s linear infinite;
}

@keyframes scrollHeaderTiles {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-1 * var(--scroll-distance-header)));
  }
}

.header-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  height: 80%;
  padding: 0 5px;
  font-size: calc(1.5rem + 1vw);
  font-weight: 700;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  overflow: hidden;
  /* Zmieniono kolor glowing shadow, aby był taki sam jak dla .tile */
  box-shadow: 0 -5px 15px rgba(0, 255, 255, 0.7),
    5px 0 15px rgba(0, 255, 255, 0.7);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
  position: relative;
  z-index: 2;
}

.header-tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transform: skewX(-20deg);
  animation: headerTileShimmer 2s infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes headerTileShimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

.menu-button {
  display: none;
}

@media (orientation: portrait) {
  .subpage-header {
    padding: 10px;
    height: auto;
  }
  .header-tile-container {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
  }
  .subpage-header.expanded .header-tile-container {
    display: flex;
  }
  .header-tile {
    width: 90%;
    flex: none;
    max-width: none;
    padding: 5px;
    font-size: calc(1.5rem + 1vw);
    text-align: center;
    min-height: 40px;
    background: rgba(0, 0, 0, 0.7);
  }
  .menu-button {
    display: block;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: calc(1.5rem + 1vw);
    font-weight: 700;
    border: none;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    width: 100%;
    text-align: center;
  }
}

#about-container {
  width: 1000px;
  max-width: 100%;
  margin: 50px auto 40px;
  padding: 30px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  color: #333;
  font-size: 1rem;
  line-height: 1.6;
}

#contact-container {
  margin: 0 auto;
  background: rgba(0, 0, 0, 0.8);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  padding: 20px;
  border-radius: 15px;
  width: 60vw;
  margin-top: 20px;
}

.iframe-preview {
  width: 614px;
  height: 346px;
  margin: 0 auto 10px;
  overflow: hidden;
  position: relative;
}

.iframe-preview iframe {
  width: 1920px;
  height: 1080px;
  transform-origin: top left;
  pointer-events: none;
  border: none;
}

#footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #000;
  color: #fff;
  text-align: center;
  padding: 10px 0;
  z-index: 9999;
}

#content {
  max-width: 800px;
  margin: 40px auto;
  padding: 20px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#contact-form {
  display: flex;
  flex-direction: column;
  margin-top: 5px;
}

#contact-form label {
  font-weight: bold;
  margin-bottom: 5px;
  color: whitesmoke;
}

#contact-form input,
#contact-form textarea {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1rem;
}

#contact-form textarea {
  resize: vertical;
  min-height: 100px;
}

#contact-form button {
  background: #6a0dad;
  color: #fff;
  border: none;
  padding: 12px;
  font-size: 1.1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease;
}

#contact-form button:hover {
  background: #5a009d;
}

h1 {
  color: whitesmoke;
}

body.about #about-container h1 {
  color: #333;
}

body.subpage.contact {
  display: block;
  padding-top: 100px;
  padding-bottom: 150px;
  min-height: calc(100vh + 150px);
}

body::after {
  content: "";
  display: block;
  height: 30px;
}

.notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #4caf50;
  color: #fff;
  padding: 15px 30px;
  border-radius: 5px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 11000;
}

.notification.show {
  opacity: 1;
}

.portfolio-section {
  text-align: center;
  padding: 20px;
}

.portfolio-section h1 {
  font-size: 2rem;
  color: #fff;
}

.portfolio-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 20px;
  margin: 0 auto;
  max-width: 1600px;
}

.portfolio-item {
  flex: 1 1 calc(50% - 40px);
  max-width: calc(50% - 40px);
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.portfolio-caption {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  padding: 10px;
  margin-top: 5px;
  border-radius: 5px;
}

.portfolio-caption p {
  margin: 0;
  font-size: 1rem;
}

.contact-cta {
  margin-top: 10px;
  color: #fff;
  font-size: 1.1rem;
  text-align: center;
  margin-bottom: 3vh;
}

.contact-cta a {
  color: #fff;
  font-weight: bold;
  text-decoration: none;
}

.portfolio-item:hover .iframe-preview {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: -2px;
}

main.portfolio-main {
  margin-top: 60px !important;
  display: block !important;
  align-self: flex-start !important;
}

@media (orientation: portrait) {
  #tile-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    height: auto;
    padding: 20px;
  }
  #tile-container .tile {
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 1;
    padding: 20px;
    box-sizing: border-box;
  }
  .subpage-header {
    width: 100%;
    padding: 10px;
  }
  .header-tile-container {
    display: none;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
  }
  .subpage-header.expanded .header-tile-container {
    display: flex;
  }
  .header-tile {
    width: 90%;
    flex: none;
    max-width: none;
    padding: 5px;
    font-size: calc(1.5rem + 1vw);
    text-align: center;
    min-height: 40px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
  }
  .menu-button {
    display: block;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: calc(1.5rem + 1vw);
    font-weight: 700;
    border: none;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    width: 100%;
    text-align: center;
  }
  #about-container {
    width: 90%;
    margin: 50px auto 40px;
    padding: 20px;
    padding-bottom: 60px;
    background: rgba(255, 255, 255, 0.8);
  }
  #contact-container {
    width: 90vw;
    margin-top: 0;
  }
  .portfolio-gallery {
    flex-direction: column;
    align-items: center;
  }
  .portfolio-item {
    flex: none;
    max-width: 100%;
    margin-bottom: 30px;
  }
  .iframe-preview {
    width: 90vw;
    aspect-ratio: 16 / 9;
    margin: 0 auto 10px;
    overflow: hidden;
    position: relative;
  }
  .iframe-preview iframe {
    width: 1920px;
    height: 1080px;
    transform: scale(calc(90vw / 1920));
    transform-origin: top left;
    pointer-events: none;
    border: none;
  }
}
