/* ==========================================================================
   [05] PÁGINA: BIBLIOTECA (Estilo de Bloco Premium igual ao Explorar)
   ========================================================================== */
.dt-library-page { max-width: var(--wrap-max); margin: 0 auto; padding: 15px 0; }

/* O BLOCO MESTRE */
.dt-library-header {
  background: #242428; 
  border-radius: 16px;
  padding: 24px;
  margin: 0 10px 30px 10px;
  border: 1px solid rgba(255, 255, 255, 0.03); 
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); 
}

/* 1. Abas com Ícones (Estilo Botão Cheio) */
.dt-lib-icon-tabs {
  display: grid;
  grid-template-columns: repeat(6, 1fr); /* 6 botões lado a lado no PC */
  gap: 12px;
  margin-bottom: 24px;
}

.dt-icon-tab {
  background: rgba(0, 0, 0, 0.2); 
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dt-icon-tab i {
  font-size: 24px;
  color: rgba(255,255,255,0.5);
  transition: all 0.2s ease;
}

.dt-icon-tab span {
  font-size: 11px;
  font-weight: 800;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

/* Hover e Ativo */
.dt-icon-tab:hover {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255,255,255,0.2);
}
.dt-icon-tab:hover i, .dt-icon-tab:hover span { color: #fff; }

.dt-icon-tab.active {
  background: #8520d2; /* O roxo premium que usamos no Explorar/Perfil */
  border-color: #8520d2;
  box-shadow: 0 4px 15px rgba(133, 32, 210, 0.4);
}
.dt-icon-tab.active i, .dt-icon-tab.active span { color: #fff; }

/* Ajuste da Barra de Pesquisa dentro do bloco */
.dt-search-bar {
  display: flex; align-items: center; 
  background: rgba(0, 0, 0, 0.2); 
  border-radius: 10px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
  margin: 0; /* Removido a margem para o bloco cuidar dos espaços */
}
.dt-search-bar:focus-within { border-color: #8520d2; background: rgba(0, 0, 0, 0.4); }
.dt-search-bar i { color: rgba(255,255,255,0.3); font-size: 16px; margin-right: 12px; transition: color 0.2s;}
.dt-search-bar:focus-within i { color: #8520d2; }
.dt-search-bar input { flex: 1; background: transparent; border: none; color: #fff; font-size: 14px; font-weight: 500; outline: none; }
.dt-search-bar input::placeholder { color: rgba(255,255,255,0.2); }

/* Telas das Abas e Alinhamento do Grid */
.dt-lib-pane { display: none; padding: 0 10px; }
.dt-lib-pane.active { display: block; animation: fadeIn 0.3s ease; }

/* O Grid idêntico ao da aba Explorar (Travado em 5px) */
.dt-lib-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

/* Caixa de Lista Vazia */
.dt-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 60px 20px; background: #1e1e24;
  border-radius: 16px; border: 1px dashed rgba(255, 255, 255, 0.1); margin-top: 10px;
}
.dt-empty-state i { font-size: 48px; color: var(--muted); margin-bottom: 16px; opacity: 0.5; }
.dt-empty-state h3 { color: #fff; font-size: 16px; margin: 0 0 8px 0; font-weight: 800; }
.dt-empty-state p { color: var(--muted); font-size: 13px; margin: 0; }

/* =========================================
   MODAL PREMIUM (DESIGN DO APP NATIVO)
   ========================================= */
.dt-modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(5px);
  z-index: 2000; display: flex; justify-content: center; align-items: center;
  opacity: 0; visibility: hidden; transition: all 0.3s ease; padding: 20px;
}
.dt-modal-overlay.active { opacity: 1; visibility: visible; }

.dt-modal-premium-v2 {
  background: #2b2b2b; /* Fundo grafite elegante da imagem */
  width: 100%; max-width: 380px; border-radius: 16px;
  padding: 30px 24px; box-shadow: 0 20px 50px rgba(0,0,0,0.8);
  transform: translateY(20px); transition: transform 0.3s ease;
  position: relative;
}
.dt-modal-overlay.active .dt-modal-premium-v2 { transform: translateY(0); }

/* Fechar discreto */
.dt-close-modal {
  position: absolute; top: 12px; right: 16px;
  background: transparent; border: none; color: rgba(255,255,255,0.3);
  font-size: 26px; cursor: pointer; transition: 0.2s; padding: 0;
}
.dt-close-modal:hover { color: #fff; }

/* Títulos */
.dt-modal-top { text-align: center; margin-bottom: 30px; }
.dt-modal-subtitle {
  display: block; font-size: 13px; color: rgba(255,255,255,0.8);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}
.dt-modal-title {
  font-size: 22px; font-weight: 500; color: #fff; margin: 0; line-height: 1.3;
}

/* Grade do Meio */
.dt-modal-controls-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px;
}
.dt-modal-control-group { display: flex; flex-direction: column; text-align: center; }
.dt-modal-control-group label { font-size: 13px; color: #fff; margin-bottom: 10px; }

/* Caixas de Input e Select */
.dt-modal-select-wrap, .dt-modal-cap-wrap {
  background: #363636; /* Tom levemente mais claro que o fundo */
  border-radius: 8px; height: 46px; display: flex; align-items: center;
  position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,0.03);
}

.dt-modal-select-wrap select {
  width: 100%; height: 100%; background: transparent; border: none;
  color: #fff; font-size: 15px; padding: 0 30px 0 16px; outline: none;
  appearance: none; -webkit-appearance: none; cursor: pointer;
}
.dt-modal-select-wrap select option { background: #363636; color: #fff; }
.dt-modal-select-wrap i {
  position: absolute; right: 14px; color: #fff; pointer-events: none;
}

.dt-modal-cap-wrap { display: flex; }
.dt-modal-cap-wrap .cap-label {
  padding: 0 12px; color: rgba(255,255,255,0.7); font-size: 14px;
  background: rgba(0,0,0,0.15); height: 100%; display: flex; align-items: center;
}
.dt-modal-cap-wrap .cap-input {
  flex: 1; height: 100%; background: transparent; border: none;
  color: #fff; font-size: 16px; text-align: center; outline: none; width: 100%;
}
/* Esconde as setinhas feias de input number no PC */
.dt-modal-cap-wrap .cap-input::-webkit-outer-spin-button,
.dt-modal-cap-wrap .cap-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.dt-modal-cap-wrap .cap-input[type=number] { -moz-appearance: textfield; }

/* Botões Gigantes Embaixo */
.dt-modal-actions { display: flex; flex-direction: column; gap: 12px; }
.dt-modal-btn-dark {
  background: #363636; color: #fff; border: none; border-radius: 8px;
  padding: 16px; font-size: 14px; font-weight: 500; display: flex; 
  align-items: center; justify-content: center; gap: 10px; cursor: pointer; 
  transition: all 0.2s ease; border: 1px solid rgba(255,255,255,0.03);
}
.dt-modal-btn-dark i { font-size: 22px; }
.dt-modal-btn-dark:hover { background: #454545; }

/* =========================================
   BARRA DE PESQUISA E GRID PREMIUM
   ========================================= */
.dt-search-bar {
  display: flex; align-items: center; 
  background: rgba(0, 0, 0, 0.2); 
  border-radius: 10px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}
.dt-search-bar:focus-within { border-color: #8520d2; background: rgba(0, 0, 0, 0.4); }
.dt-search-bar i { color: rgba(255,255,255,0.3); font-size: 16px; margin-right: 12px; transition: color 0.2s;}
.dt-search-bar:focus-within i { color: #8520d2; }
.dt-search-bar input { flex: 1; background: transparent; border: none; color: #fff; font-size: 14px; font-weight: 500; outline: none; }
.dt-search-bar input::placeholder { color: rgba(255,255,255,0.2); }

/* O Grid idêntico ao da aba Explorar (Travado em 5px) */
.dt-lib-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
/* =========================================
   AJUSTES EXCLUSIVOS PARA MOBILE (CELULAR)
   ========================================= */
@media (max-width: 768px) {
  /* Restaura o grid 3x2 (3 em cima, 3 embaixo) */
  .dt-lib-icon-tabs {
    grid-template-columns: repeat(3, 1fr); 
    gap: 10px;
  }
  
  /* Ajusta o tamanho para os botões ficarem gordinhos e confortáveis no toque */
  .dt-icon-tab {
    padding: 14px 6px; 
  }
  .dt-icon-tab i {
    font-size: 22px;
  }
  .dt-icon-tab span {
    font-size: 10px;
  }
}
/* Trava o cursor do mouse no input estático do Modal */
.dt-modal-cap-wrap .cap-input[readonly] {
  cursor: default;
  pointer-events: none; /* Ignora os cliques do usuário */
}