/** @format */

:root {
  --primary-color: yellow;
  --text-color: #ffffff;
  --border-radius: 12px;
  --transition: all 0.3s ease;
  --glass-bg: rgba(0, 0, 0, 0.247);
  --glass-border: #ccc;
}
/* Añade esto a tu CSS existente */
.download-progress-fill.retrying {
  background: #ff9800 !important;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}
/* Barra de progreso de descarga */
.download-progress-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 300px;
  background: white;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1;
  font-family: Arial, sans-serif;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.download-progress-title {
  font-size: 14px;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
}

.download-progress-bar {
  background: #e0e0e0;
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}

.download-progress-fill {
  background: #4caf50;
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
}

.download-progress-text {
  font-size: 12px;
  margin-top: 5px;
  color: #666;
  text-align: right;
}

/* Versión oscura (opcional) */
@media (prefers-color-scheme: dark) {
  .download-progress-container {
    background: #2a2a2a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  }

  .download-progress-title {
    color: #e0e0e0;
  }

  .download-progress-bar {
    background: #444;
  }

  .download-progress-text {
    color: #aaa;
  }
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

p {
  color: white;
}

/* ========== LOADER ========== */
.loader-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  z-index: 1;
}

.loader {
  width: 150px;
  height: 150px;
  background: var(--glass-bg);
  border-radius: 50%;
  border: 3px solid var(--glass-border);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 1rem;
  animation: pulse 1.5s infinite;
}

.loader::after {
  content: "";
  width: 40px;
  height: 40px;
  border: 4px solid transparent;
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader-text {
  color: var(--text-color);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  margin-top: -1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
  }
  70% {
    box-shadow: 0 0 0 20px rgba(255, 255, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

/* ========== CONTAINER ========== */
.container {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 40px;
  max-width: 700px;
  width: 100%;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

h1 {
  color: #00d9ff;
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 30px;
  text-shadow: 0 0 20px rgba(0, 217, 255, 0.5);
}

/* ========== HR ========== */
hr {
  border: none;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 217, 255, 0.5),
    transparent
  );
  margin: 0;
  flex: 1;
}

.hr {
  display: grid;
  text-align: center;
}

.span_text {
  padding: 0 10px;
  padding-bottom: 1%;
  color: #0099cc;
}

/* ========== FORM ========== */
section {
  margin: 18px 0;
}

form section {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

/* ========== INPUT ========== */
input[type="text"] {
  flex: 1;
  min-width: 250px;
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 3px solid rgba(0, 217, 255, 0.3);
  border-radius: 12px;
  color: #fff;
  font-size: 16px;
  padding-right: 45px;
  transition: all 0.3s ease;
  outline: none;
}

input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

input[type="text"]:focus {
  border-color: #00d9ff;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
}

/* ========== BUTTON ========== */
button {
  background: linear-gradient(135deg, #00d9ff, #0099cc);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 217, 255, 0.3);
  white-space: nowrap;
  width: 100%;
  padding: 14px 25px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 217, 255, 0.5);
  background: linear-gradient(135deg, #00e5ff, #00b8e6);
}

button:active {
  transform: translateY(0);
}

#descarga {
  width: 100%;
  font-size: 15px;
}

/* ========== SELECT ========== */
select.quality-selector {
  flex: 1;
  min-width: 200px;
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 3px solid rgba(0, 217, 255, 0.3);
  border-radius: 12px;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230ed5c4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 20px;
  padding-right: 45px;
}

select.quality-selector option {
  background: #16213e;
  color: #0ed5c4;
}

select.quality-selector:hover {
  border-color: #00d9ff;
  background: rgba(255, 255, 255, 0.12);
}

select.quality-selector:focus {
  outline: none;
  border-color: #0ed5c4;
  background-color: rgba(30, 30, 48, 1);
}

/* ========== CLEAN BUTTON ========== */
.clean {
  background: url("image/close.png");
  cursor: pointer;
  opacity: 0.5;
  height: 24px;
  scale: 1.2;
  width: 24px;
  position: absolute;
  margin: 13.5px;
  right: 6%;
  transition: all 0.5s;
}

.clean:hover {
  background: url("image/close.png") 0 0 no-repeat;
  transform: rotate(360deg);
}

/* ========== FOOTER ========== */
.marcas1 {
  opacity: 0.8;
  color: #ccc;
  bottom: 0vh;
  display: block;
  display: flex;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 14px;
}
#© {
  text-align: center;
}
/* Switch Container */
#x2 {
  display: flex;
  align-items: center;
  justify-content: center;
}

#type {
  background: rgba(255, 255, 255, 0.08);
  padding: 10px 10px;
  box-shadow: none;
  border: 3px solid rgba(0, 217, 255, 0.3);
}

#type:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: none;
}

.switch-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 27px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgb(0 0 0 / 14%);
  transition: 0.4s;
  border-radius: 30px;
  border: 3px solid rgba(0, 217, 255, 0.3);
}

.slider:before {
  position: absolute;
  content: "";
  height: 81%;
  width: 35%;
  left: 2px;
  bottom: 2px;
  background: linear-gradient(135deg, #ffffff, #185467);
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background: linear-gradient(135deg, #343a50, #0099ccc9);
}

input:checked + .slider:before {
  transform: translateX(30px);
}

#switchLabel {
  color: #00d9ff;
  font-weight: 500;
  font-size: 16px;
  white-space: nowrap;
}

/* ========== RESPONSIVE DESIGN ========== */

/* Tablets (768px - 1024px) */
@media screen and (max-width: 1024px) {
  .container {
    padding: 35px;
    max-width: 600px;
  }

  h1 {
    font-size: 2.2rem;
  }
  #type {
    width: 100%;
    padding: 10px 18px;
  }
  button {
    padding: 14px 30px;
  }
}

/* Tablets pequeñas y móviles grandes (481px - 768px) */
@media screen and (max-width: 768px) {
  body {
    padding: 15px;
  }

  .container {
    padding: 25px;
    border-radius: 15px;
  }
  .switch-container {
    justify-content: center;
    width: 100%;
  }
  h1 {
    font-size: 1.8rem;
    margin-bottom: 25px;
  }
  #x2 {
    width: 100%;
  }

  .clean {
    margin: 13px;
    right: 4%;
    scale: 1;
  }

  select.quality-selector {
    width: 100%;
    min-width: 100%;
  }
}

/* Móviles pequeños (320px - 480px) */
@media screen and (max-width: 480px) {
  body {
    padding: 10px;
  }

  .container {
    padding: 20px;
    border-radius: 12px;
  }

  h1 {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }

  .clean {
    margin: 13px;
    scale: 1;
  }

  hr {
    margin: 8px 0;
  }

  section {
    margin: 15px 0;
  }

  input[type="text"] {
    min-width: 100%;
    padding: 14px 18px;
    padding-right: 38px;
    border-radius: 10px;
  }

  button {
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 10px;
  }

  select.quality-selector {
    padding: 16px 16px;
    font-size: 14px;
    border-radius: 10px;
  }
}

/* Móviles muy pequeños (menos de 360px) */
@media screen and (max-width: 360px) {
  .container {
    padding: 15px;
  }

  h1 {
    font-size: 1.3rem;
  }

  input[type="text"],
  button,
  select.quality-selector {
    font-size: 13px;
  }
}
#type {
  background: rgba(255, 255, 255, 0.08);
  padding: 10px 10px;
  box-shadow: none;
  border: 3px solid rgba(0, 217, 255, 0.3);
}

#type:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: none;
}
