/* RESET */
* {
  box-sizing: border-box;
}

/* BASE */
body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  color: #333;

  background-image: url('../assets/background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;

  animation: bgMove 30s ease infinite;
}

/* OVERLAY  */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  background: radial-gradient(
          circle at center,
          rgba(0,0,0,0.2) 0%,
          rgba(0,0,0,0.55) 45%,
          rgba(0,0,0,0.9) 100%
  );

  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  background: radial-gradient(
          circle at 60% 65%, /* Position circle */
          rgba(255,255,255,0.2) 0%,
          rgba(255,255,255,0.08) 8%,
          rgba(255,255,255,0.04) 15%,
          rgba(255,255,255,0.015) 22%,
          transparent 25%
  );

  animation: glowPulse 15s ease-in-out infinite;

  z-index: -1;
}

@keyframes glowPulse {
  0%   { opacity: 0.25; }
  50%  { opacity: 0.5; }
  100% { opacity: 0.25; }
}

/* HEADER */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10;

  display: flex;
  align-items: center;
  justify-content: center;

  height: 60px;

  background: rgba(10, 10, 20, 0.25);
  backdrop-filter: blur(12px);

  border-bottom: 1px solid rgba(255,255,255,0.06);
}

header h1 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1.5px;

  background: linear-gradient(90deg, #ffffff, #aab6ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

header p {
  margin: 4px 0 0;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}

.logo {
  text-decoration: none;
  cursor: pointer;
  z-index: 20;

  font-size: 20px;
  font-weight: 600;
  letter-spacing: 2px;

  background: linear-gradient(90deg, #ffffff, #aab6ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;

  opacity: 0.9;

  transition: all 0.25s ease;
}

.logo:hover {
  text-decoration: none;
  opacity: 1;
  transform: translateY(-1px);
}

.input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.secondary-actions {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

.reset-btn {
  background: none;
  border: none;

  color: rgba(255,255,255,0.40);
  font-size: 13px;

  cursor: pointer;

  padding: 4px 8px;
  border-radius: 6px;

  transition: all 0.2s ease;
  box-shadow: none;
}

.reset-btn:hover {
  color: rgba(255,255,255,0.8);
  /*background: rgba(255,255,255,0.06);*/
}

/* CONTAINER */
.container {
  margin: 80px auto;
}

/* HOME PAGE */
.home .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 25px;
  max-width: 1100px;
  align-items: stretch;
}

.tool {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 15px;

  position: relative;
  width: 100%;
  max-width: 450px;
  margin: 0 auto;

  display: flex;
  justify-content: space-between;

  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);

  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;

  padding: 32px;

  box-shadow:
          0 10px 40px rgba(0,0,0,0.4),
          inset 0 1px 0 rgba(255,255,255,0.1);

  transition: all 0.3s ease;
}

.tool-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.tool-right {
  margin-top: 15px;
  width: 250px;
  height: 150px;
  border-radius: 10px;

  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);

  padding: 16px;

  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.tool-right:not(.visual) > div {
  height: 6px;
  border-radius: 4px;

  background: linear-gradient(
          90deg,
          rgba(255,255,255,0.2),
          rgba(255,255,255,0.6),
          rgba(255,255,255,0.2)
  );

  background-size: 200% 100%;
  animation: shimmer 5s infinite;
}

.tool-right.visual {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tool-right.visual .converter-visual,
.tool-right.visual .compress-visual {
  transform: scale(0.75);
  transform-origin: center;
}

.tool-right div:nth-child(2) { width: 80%; }
.tool-right div:nth-child(3) { width: 60%; }
.tool-right div:nth-child(4) { width: 40%; }


@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.tool:hover {
  transform: scale(1.04);
  border: 1px solid rgba(255,255,255,0.2);

  box-shadow:
          0 25px 70px rgba(0,0,0,0.6),
          inset 0 1px 0 rgba(255,255,255,0.2);

  z-index: 2;
}

.tool:first-child {
  transform: scale(1.03);
  border: 1px solid rgba(255,255,255,0.2);
}

.tool:not(:first-child) {
  opacity: 0.85;
}

.container:hover .tool:not(:hover) {
  transform: scale(0.97);
  opacity: 0.7;
  filter: blur(1px);
}

/* TOOL PAGE */
.tool-page .container {
  margin: 120px auto;
  max-width: 520px;
}

.tool-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(10, 10, 20, 0.3);
  backdrop-filter: blur(14px);

  border-bottom: 1px solid rgba(255,255,255,0.06);

  z-index: 20;
}

.tool-header h1 {
  font-size: 18px;
  font-weight: 500;

  background: linear-gradient(90deg, #ffffff, #aab6ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tool-header .logo {
  position: absolute;
  left: 25px;

  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;

  background: linear-gradient(90deg, #ffffff, #aab6ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;

  opacity: 0.9;
}

.tool h2 {
  margin: 0 0 8px;
  color: white;
  font-size: 20px;
}

.tool p {
  margin: 0 0 15px;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
}

/* CARD */
.card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);

  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;

  padding: 30px;

  box-shadow:
          0 10px 40px rgba(0,0,0,0.4),
          inset 0 1px 0 rgba(255,255,255,0.1);

  color: white;
}

/* LABELS */
label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #222;
}

/* INPUTS */
input[type="file"],
input[type="number"],
input[type="text"] {
  width: 100%;
  padding: 12px;

  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);

  background: rgba(255,255,255,0.08);
  color: white;

  font-size: 14px;
}



input::placeholder {
  color: rgba(255,255,255,0.5);
}

input:focus {
  outline: none;
  border-color: #6a5cff;
  background: rgba(255,255,255,0.12);
  box-shadow: 0 0 0 2px rgba(106,92,255,0.2);
}

label {
  color: rgba(255,255,255,0.8);
}

/* BUTTON */
button {
  display: block;
  margin: 20px auto 0;

  padding: 12px 24px;

  background: linear-gradient(135deg, #4f8cff, #6a5cff);
  color: white;

  border: none;
  border-radius: 8px;

  font-size: 14px;
  font-weight: 600;

  cursor: pointer;

  /*box-shadow: 0 4px 15px rgba(80,100,255,0.3);*/

  transition: all 0.25s ease;
}

button:hover {
  transform: translateY(-1px);
  /*box-shadow: 0 8px 25px rgba(80,100,255,0.5);*/
}

/* BUTTON LINK (HOME) */
a.button {
  display: inline-block;
  margin: 15px 0 0;
  padding: 10px 18px;

  background: linear-gradient(135deg, #4f8cff, #6a5cff);
  color: white;
  font-weight: 600;
  letter-spacing: 0.3px;

  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;

  /*box-shadow: 0 4px 15px rgba(80,100,255,0.3);*/

  transition: all 0.25s ease;
}

a.button:hover {
  transform: translateY(-1px);
  /*box-shadow: 0 8px 25px rgba(80,100,255,0.5);*/
}

a.button span {
  background: linear-gradient(90deg, #ffffff, #b8c6ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tool-hint {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  margin: 10px 0 5px;
  line-height: 1.4;
}

.tool-hint strong {
  color: #aab6ff;
  font-weight: 500;
}

.file-input {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-input input {
  display: none;
}

.file-btn {
  padding: 8px 14px;
  border-radius: 8px;

  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);

  color: white;
  font-size: 13px;
  cursor: pointer;

  transition: all 0.2s ease;
}

.file-btn:hover {
  background: rgba(255,255,255,0.18);
}

#file-name {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}

/* PREVIEW */
ul {
  margin-top: 20px;
  padding: 0;
  list-style: none;
}

li {
  display: flex;
  justify-content: space-between;
  gap: 10px;

  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);

  padding: 10px;
  border-radius: 8px;
  margin-bottom: 8px;

  font-size: 13px;
  color: rgba(255,255,255,0.8);

  backdrop-filter: blur(6px);
}

li:hover {
  background: rgba(255,255,255,0.12);
}

select {
  width: 100%;
  padding: 12px;

  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);

  background: rgba(255,255,255,0.08);
  color: white;

  font-size: 14px;
  margin-bottom: 15px;

  appearance: none; /* clau */
  -webkit-appearance: none;
  -moz-appearance: none;

  cursor: pointer;
}

.custom-select {
  position: relative;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08);
  color: white;
  cursor: pointer;
}

.custom-select .arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.6;
}

.options {
  display: none;
  position: absolute;
  top: 110%;
  left: 0;
  width: 100%;

  background: linear-gradient(
          180deg,
          rgba(30,20,50,0.85),
          rgba(20,15,35,0.85)
  );

  backdrop-filter: blur(25px) saturate(140%);

  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;

  box-shadow:
          0 20px 60px rgba(0,0,0,0.5);

  overflow: hidden;
}


.options div {
  padding: 10px;
  color: rgba(255,255,255,0.8);
  transition: all 0.2s ease;
}

.options div:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}


.custom-select .arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.6;
  pointer-events: none;
}


.converter-visual .arrow,
.compress-visual .arrow {
  position: static;
  transform: none;
  opacity: 0.6;
}

.converter-visual {
  display: flex;
  align-items: center;
  gap: 6px;
}

.converter-preview {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* boxes */
.format-box {
  padding: 10px 16px;
  border-radius: 6px;

  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);

  font-size: 13px;
  color: rgba(255,255,255,0.6);

  transition: all 0.3s ease;
}

.resizer-box {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 8px;
}



/* Animation */
@keyframes highlight {
  0%, 100% {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
    box-shadow: none;
    transform: scale(1);
    opacity: 0.6;
  }

  15% {
    opacity: 1;
    transform: scale(1.05);
  }

  20%, 30% {
    background: linear-gradient(135deg, #4f8cff, #6a5cff);
    color: white;
    box-shadow: 0 0 14px rgba(100,120,255,0.7);
    opacity: 1;
  }

  40% {
    opacity: 0.8;
    transform: scale(1.02);
  }

  50%, 100% {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
    box-shadow: none;
    transform: scale(1);
    opacity: 0.6;
  }
}

/* delays per cada format */
.format-box:nth-child(1) {
  animation: highlight 9s ease-in-out infinite;
}

.format-box:nth-child(3) {
  animation: highlight 9s ease-in-out infinite;
  animation-delay: 3s;
}

.format-box:nth-child(5) {
  animation: highlight 9s ease-in-out infinite;
  animation-delay: 6s;
}

.seo-content {
  max-width: 700px;
  margin: 80px auto 40px;

  padding: 0 20px;

  font-size: 13px;
  line-height: 1.6;

  color: rgba(255,255,255,0.5);
  opacity: 0.6;
}

.seo-content h1 {
  font-size: 16px;
  margin-bottom: 10px;
  color: rgba(255,255,255,0.7);
}

.seo-content h2 {
  font-size: 14px;
  margin-top: 20px;
  color: rgba(255,255,255,0.65);
}

.seo-title {
  position: absolute;
  top: -9999px;
}

.tool-seo {
  margin-bottom: 20px;
}

.tool-seo h1 {
  font-size: 18px;
  margin-bottom: 8px;
  color: rgba(255,255,255,0.85);
}

.tool-seo p {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255,255,255,0.6);
  margin-bottom: 8px;
}

.compress-visual {
  display: flex;
  align-items: center;
  gap: 8px;
}

.size-box {
  padding: 13px 16px;
  border-radius: 6px;

  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);

  font-size: 13px;
  color: rgba(255,255,255,0.6);

  transition: all 0.3s ease;
}

@keyframes compressHighlight {
  0% {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
    opacity: 0.6;
    transform: scale(1);
    box-shadow: none;
  }

  8% {
    background: linear-gradient(135deg, #4f8cff, #6a5cff);
    color: white;
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 0 14px rgba(100,120,255,0.7);
  }

  16% {
    background: linear-gradient(135deg, #4f8cff, #6a5cff);
    color: white;
    opacity: 1;
    transform: scale(1.05);
  }

  
  36% {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
    opacity: 0.6;
    transform: scale(1);
    box-shadow: none;
  }

  100% {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
    opacity: 0.6;
    transform: scale(1);
  }
}

/* sequence */
.step1 { animation: compressHighlight 9s ease-in-out infinite; animation-delay: 0s; }
.step2 { animation: compressHighlight 9s ease-in-out infinite; animation-delay: 3s; }
.step3 { animation: compressHighlight 9s ease-in-out infinite; animation-delay: 6s; }

.top-bar {
  position: fixed;
  top: 20px;
  left: 0;
  width: 100%;

  display: flex;
  justify-content: center;
  align-items: center;

  pointer-events: none; 
  z-index: 20;
}

.top-bar > * {
  pointer-events: auto;
}

.top-bar .logo {
  position: absolute;
  left: 30px;

  display: flex;
  align-items: center;   
  height: 100%;
}

#search {
  width: 320px;
  height: 42px;
  padding: 12px 16px;

  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);

  background: rgba(255,255,255,0.08);
  color: white;

  font-family: 'Segoe UI', sans-serif;

  font-size: 14px;

  backdrop-filter: blur(10px);
}

#search::placeholder {
  color: rgba(255,255,255,0.5);
}

#search:focus {
  outline: none;
  border-color: #6a5cff;
  box-shadow: 0 0 0 2px rgba(106,92,255,0.2);
}

@media (max-width: 600px) {

  .container {
    margin-top: 140px; 
    margin-left: 20px;
    margin-right: 20px;
  }

  .top-bar {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 20px;
  }

  .top-bar .logo {
    position: static;
    left: auto;
    width: 100%;
    text-align: center;
  }

  .search {
    width: 90%;
    max-width: 300px;
  }

  .tool-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .tool-header .logo {
    position: static;   
    margin-top: 15px;
  }

  .tool-header h1 {
    font-size: 20px;
  }

}

.pdf-visual {
  display: flex;
  align-items: center;
  gap: 6px;
}

.flip-container {
  perspective: 800px;
}

.flip-card {
  width: 60px;
  height: 40px;
  position: relative;

  transform-style: preserve-3d;
  animation: flipAnim 4s infinite;
}

.flip-front,
.flip-back {
  position: absolute;
  width: 100%;
  height: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 6px;
  font-size: 13px;

  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);

  backface-visibility: hidden;
}

.flip-back {
  transform: rotateY(180deg);
}

@keyframes flipAnim {
  0%   { transform: rotateY(0deg); }
  40%  { transform: rotateY(180deg); }
  60%  { transform: rotateY(180deg); }
  100% { transform: rotateY(360deg); }
}

/* PDF MERGE VISUAL */
.merge-visual {
  position: relative;
  width: 120px;
  height: 60px;
}

.pdf-box {
  position: absolute;
  padding: 8px 12px;
  border-radius: 6px;
  max-width: 50px;

  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);

  font-size: 13px;
  color: rgba(255,255,255,0.6);

  transition: all 0.4s ease;
}

/* initial positions */
.pdf-box.left { left: 0; top: 10px; animation: mergeLeft 4s infinite; }
.pdf-box.right { right: 0; top: 10px; animation: mergeRight 4s infinite; }
.pdf-box.result { left: 50%; top: 10px; transform: translateX(-50%) scale(0); }

/* animation */
@keyframes mergeLeft {
  0% { left: 0; opacity: 1; }
  40% { transform: translateX(35px); opacity: 1; }
  50% { opacity: 0; }
  100% { left: 0; opacity: 1; }
}

@keyframes mergeRight {
  0% { right: 0; opacity: 1; }
  40% { transform: translateX(-35px); opacity: 1; }
  50% { opacity: 0; }
  100% { right: 0; opacity: 1; }
}

.pdf-box.result {
  animation: mergeResult 4s infinite;
}

@keyframes mergeResult {
  0%, 40% {
    transform: translateX(-50%) scale(0);
    opacity: 0;
  }
  50%, 60% {
    transform: translateX(-50%) scale(1);
    opacity: 1;
    background: linear-gradient(135deg, #4f8cff, #6a5cff);
    color: white;
  }
  100% {
    transform: translateX(-50%) scale(0);
    opacity: 0;
  }
}

.json-visual {
  width: 100%;
  height: 100%;

  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;

  padding: 20px;
}

.json-line {
  height: 8px;
  border-radius: 4px;

  background: linear-gradient(
    90deg,
    rgba(106,92,255,0.8),
    rgba(255,255,255,0.3)
  );

  opacity: 0.6;
}

.line1 {
  width: 60%;
  animation: jsonMove 3s infinite ease-in-out;
}

.line2 {
  width: 80%;
  animation: jsonMove 3s infinite ease-in-out 0.3s;
}

.line3 {
  width: 40%;
  animation: jsonMove 3s infinite ease-in-out 0.6s;
}

@keyframes jsonMove {
  0%, 100% {
    transform: translateX(0);
    opacity: 0.5;
  }
  50% {
    transform: translateX(10px);
    opacity: 1;
  }
}

.password-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  font-size: 14px;
  font-family: monospace;
}

.password-visual .text {
  padding: 0;        /* eliminem el requadre */
  background: none;  /* eliminem el fons */
  border-radius: 0;
}

#passwordAnim {
  display: inline-flex;
  gap: 2px;
  font-family: monospace;
  font-size: 20px;
  font-weight: 600;
  background: linear-gradient(90deg, #ffffff, #aab6ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

#passwordAnim span {
  opacity: 0;
  display: inline-block;
  background: linear-gradient(90deg, #ffffff, #aab6ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: matrixDrop 1.0s ease-out forwards;
}

@keyframes matrixDrop {
  0% { opacity: 0; transform: translateY(-15px); filter: blur(4px); }
  60% { opacity: 1; transform: translateY(0); filter: blur(0); }
  100% { opacity: 1; }
}


