/* =========================================================
   BIBLIOTECA PRIVADA — CÁMARA UFY
   VERSIÓN 2
   ========================================================= */

.ufy-phone-camera-private-library {
  position: absolute;

  inset: 0;

  z-index: 20;

  display: flex;
  flex-direction: column;

  min-width: 0;
  min-height: 0;

  overflow: hidden;

  color: #fff;

  background:
    linear-gradient(
      180deg,
      #08080a 0%,
      #030304 100%
    );
}


/* =========================================================
   BARRA SUPERIOR
   ========================================================= */

.ufy-phone-camera-library-topbar {
  position: relative;

  z-index: 2;

  display: grid;

  grid-template-columns:
    44px minmax(0, 1fr) 58px;

  align-items: center;

  min-height: 68px;

  box-sizing: border-box;

  padding:
    10px 14px;

  border-bottom:
    1px solid
    rgba(255, 255, 255, 0.08);

  background:
    rgba(7, 7, 9, 0.92);

  backdrop-filter:
    blur(2px);

  -webkit-backdrop-filter:
    blur(2px);
}


.ufy-phone-camera-library-close {
  display: grid;

  place-items: center;

  width: 40px;
  height: 40px;

  padding: 0;

  border:
    1px solid
    rgba(255, 255, 255, 0.12);

  border-radius: 50%;

  color: #fff;

  background:
    rgba(255, 255, 255, 0.06);

  font: inherit;
  font-size: 32px;
  font-weight: 300;
  line-height: 1;

  cursor: pointer;

  -webkit-tap-highlight-color:
    transparent;
}


.ufy-phone-camera-library-close:active {
  transform:
    scale(0.94);

  background:
    rgba(255, 255, 255, 0.12);
}


.ufy-phone-camera-library-title-group {
  min-width: 0;

  text-align: center;
}


.ufy-phone-camera-library-title {
  margin: 0;

  overflow: hidden;

  color: #fff;

  font-size: 17px;
  font-weight: 720;
  line-height: 1.2;

  text-overflow: ellipsis;

  white-space: nowrap;
}


.ufy-phone-camera-library-subtitle {
  margin:
    3px 0 0;

  color:
    rgba(255, 255, 255, 0.54);

  font-size: 11px;
  font-weight: 540;
  line-height: 1.2;
}


/* SELECTOR PRIVADO DEL CELULAR */

.ufy-phone-camera-library-input {
  position: fixed;

  width: 1px;
  height: 1px;

  overflow: hidden;

  opacity: 0;

  pointer-events: none;
}


.ufy-phone-camera-library-add {
  display: inline-grid;

  min-width: 58px;
  min-height: 34px;

  box-sizing: border-box;

  place-items: center;

  padding:
    0 10px;

  border:
    1px solid
    rgba(255, 255, 255, 0.14);

  border-radius: 999px;

  color: #fff;

  background:
    rgba(255, 255, 255, 0.07);

  font: inherit;
  font-size: 10px;
  font-weight: 720;
  line-height: 1;

  cursor: pointer;

  -webkit-tap-highlight-color:
    transparent;
}


.ufy-phone-camera-library-add:active:not(:disabled) {
  transform:
    scale(0.96);

  background:
    rgba(255, 255, 255, 0.13);
}


.ufy-phone-camera-library-add:disabled {
  color:
    rgba(255, 255, 255, 0.42);

  cursor: wait;

  opacity: 0.72;
}




/* =========================================================
   FILTROS — VERSIÓN 3
   ========================================================= */

.ufy-phone-camera-library-filters {
  position: relative;

  z-index: 2;

  display: flex;

  flex: 0 0 auto;

  align-items: center;

  gap: 7px;

  min-width: 0;

  overflow-x: auto;
  overflow-y: hidden;

  box-sizing: border-box;

  padding:
    10px 14px;

  border-bottom:
    1px solid
    rgba(255, 255, 255, 0.07);

  background:
    rgba(6, 6, 8, 0.94);

  backdrop-filter:
    blur(2px);

  -webkit-backdrop-filter:
    blur(2px);

  scrollbar-width: none;

  overscroll-behavior-x:
    contain;
}


.ufy-phone-camera-library-filters::-webkit-scrollbar {
  display: none;
}


.ufy-phone-camera-library-filter {
  flex: 0 0 auto;

  min-height: 34px;

  box-sizing: border-box;

  padding:
    0 13px;

  border:
    1px solid
    rgba(255, 255, 255, 0.10);

  border-radius: 999px;

  color:
    rgba(255, 255, 255, 0.58);

  background:
    rgba(255, 255, 255, 0.045);

  font: inherit;
  font-size: 11px;
  font-weight: 680;
  line-height: 1;

  white-space: nowrap;

  cursor: pointer;

  transition:
    color 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;

  -webkit-tap-highlight-color:
    transparent;
}


.ufy-phone-camera-library-filter:active {
  transform:
    scale(0.96);
}


.ufy-phone-camera-library-filter.is-active {
  border-color:
    rgba(255, 255, 255, 0.94);

  color:
    #08080a;

  background:
    #fff;
}


@media (max-width: 360px) {
  .ufy-phone-camera-library-filters {
    padding-right: 10px;
    padding-left: 10px;
  }

  .ufy-phone-camera-library-filter {
    padding:
      0 11px;

    font-size: 10px;
  }
}




/* =========================================================
   CONTENIDO DESPLAZABLE
   ========================================================= */

.ufy-phone-camera-library-content {
  flex: 1 1 auto;

  min-width: 0;
  min-height: 0;

  overflow-x: hidden;
  overflow-y: auto;

  box-sizing: border-box;

  padding:
    18px 14px 26px;

  overscroll-behavior:
    contain;

  scrollbar-width:
    thin;

  scrollbar-color:
    rgba(255, 255, 255, 0.20)
    transparent;
}


.ufy-phone-camera-library-content::-webkit-scrollbar {
  width: 5px;
}


.ufy-phone-camera-library-content::-webkit-scrollbar-thumb {
  border-radius: 999px;

  background:
    rgba(255, 255, 255, 0.20);
}


.ufy-phone-camera-library-loading {
  display: grid;

  min-height: 180px;

  place-items: center;

  margin: 0;

  color:
    rgba(255, 255, 255, 0.62);

  font-size: 13px;
  line-height: 1.45;

  text-align: center;
}


.ufy-phone-camera-library-loading.is-error {
  color:
    rgba(255, 150, 150, 0.94);
}


/* =========================================================
   SECCIONES
   ========================================================= */

.ufy-phone-camera-library-section {
  min-width: 0;
}


.ufy-phone-camera-library-section +
.ufy-phone-camera-library-section {
  margin-top: 28px;
}


.ufy-phone-camera-library-section-header {
  display: flex;

  align-items: center;

  gap: 8px;

  margin-bottom: 13px;
}


.ufy-phone-camera-library-section-title {
  margin: 0;

  color: #fff;

  font-size: 15px;
  font-weight: 720;
  line-height: 1.25;
}


.ufy-phone-camera-library-count {
  display: inline-grid;

  min-width: 22px;
  height: 22px;

  box-sizing: border-box;

  place-items: center;

  padding:
    0 7px;

  border:
    1px solid
    rgba(255, 255, 255, 0.10);

  border-radius: 999px;

  color:
    rgba(255, 255, 255, 0.72);

  background:
    rgba(255, 255, 255, 0.07);

  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}


.ufy-phone-camera-library-empty {
  margin: 0;

  padding:
    18px 16px;

  border:
    1px dashed
    rgba(255, 255, 255, 0.13);

  border-radius: 16px;

  color:
    rgba(255, 255, 255, 0.48);

  background:
    rgba(255, 255, 255, 0.025);

  font-size: 12px;
  line-height: 1.45;

  text-align: center;
}


.ufy-phone-camera-library-date-group +
.ufy-phone-camera-library-date-group {
  margin-top: 18px;
}


.ufy-phone-camera-library-date {
  margin:
    0 0 9px;

  color:
    rgba(255, 255, 255, 0.48);

  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;

  letter-spacing: 0.02em;
}


/* =========================================================
   CUADRÍCULA DE ARCHIVOS
   ========================================================= */

.ufy-phone-camera-library-grid {
  display: grid;

  grid-template-columns:
    repeat(
      3,
      minmax(0, 1fr)
    );

  gap: 5px;

  min-width: 0;
}


.ufy-phone-camera-library-card {
  position: relative;

  display: block;

  min-width: 0;

  aspect-ratio: 1 / 1;

  overflow: hidden;

  padding: 0;

  border:
    1px solid
    rgba(255, 255, 255, 0.07);

  border-radius: 11px;

  background:
    #111114;

  cursor: pointer;

  isolation: isolate;

  -webkit-tap-highlight-color:
    transparent;
}


.ufy-phone-camera-library-card::after {
  content: "";

  position: absolute;

  inset: 0;

  z-index: 1;

  pointer-events: none;

  background:
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.22) 0%,
      transparent 34%,
      transparent 62%,
      rgba(0, 0, 0, 0.42) 100%
    );
}


.ufy-phone-camera-library-card.is-selected {
  border-color:
    rgba(255, 255, 255, 0.96);

  box-shadow:
    inset 0 0 0 2px
    rgba(255, 255, 255, 0.95);
}


.ufy-phone-camera-library-card:active {
  transform:
    scale(0.975);
}


.ufy-phone-camera-library-media {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;

  pointer-events: none;

  user-select: none;

  -webkit-user-select: none;

  -webkit-user-drag: none;
}


/* ETIQUETA DE ORIGEN */

.ufy-phone-camera-library-origin {
  position: absolute;

  left: 6px;
  top: 6px;

  z-index: 2;

  display: inline-flex;

  align-items: center;

  min-height: 19px;

  box-sizing: border-box;

  padding:
    3px 6px;

  border:
    1px solid
    rgba(255, 255, 255, 0.18);

  border-radius: 999px;

  color: #fff;

  background:
    rgba(5, 5, 7, 0.74);

  backdrop-filter:
    blur(2px);

  -webkit-backdrop-filter:
    blur(2px);

  font-size: 8px;
  font-weight: 760;
  line-height: 1;

  letter-spacing: 0.035em;

  pointer-events: none;
}


/* CÍRCULO DE SELECCIÓN */

.ufy-phone-camera-library-selection {
  position: absolute;

  right: 6px;
  top: 6px;

  z-index: 3;

  display: grid;

  width: 22px;
  height: 22px;

  box-sizing: border-box;

  place-items: center;

  border:
    1.5px solid
    rgba(255, 255, 255, 0.82);

  border-radius: 50%;

  color: #050506;

  background:
    rgba(0, 0, 0, 0.24);

  box-shadow:
    0 2px 8px
    rgba(0, 0, 0, 0.38);

  font-size: 14px;
  font-weight: 900;
  line-height: 1;

  pointer-events: none;
}


.ufy-phone-camera-library-card.is-selected
.ufy-phone-camera-library-selection {
  border-color: #fff;

  background: #fff;
}


/* DURACIÓN DE VIDEO */

.ufy-phone-camera-library-duration {
  position: absolute;

  right: 6px;
  bottom: 6px;

  z-index: 2;

  padding:
    3px 5px;

  border-radius: 6px;

  color: #fff;

  background:
    rgba(0, 0, 0, 0.76);

  font-size: 9px;
  font-weight: 720;
  line-height: 1;

  pointer-events: none;
}


