/* p4p-full.css
   Estilos para el sistema Play4Padel
*/

/* RESET */
#p4p-root * {
  box-sizing: border-box;
  font-family: system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.p4p-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.p4p-title-main {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 4px;
}

.p4p-note {
  font-size: 14px;
  opacity: 0.7;
}

.p4p-btn {
  padding: 8px 16px;
  border-radius: 8px;
 border: 1px solid #567128;
  background: #dbf3b2;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  color: #3a540c;
}
.p4p-btn:hover { background: #c1eb79; }

.p4p-btn.primary {
  background: #93c144;
  color: white;
}
.p4p-btn.primary:hover {
  background: #7c9e43;
}

.p4p-select, .p4p-input, textarea.p4p-input {
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
  width: 100%;
  font-size: 15px;
  background: white;
}

.p4p-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

#p4p-list {
  display: grid;
  gap: 14px;
}

/* EMPTY */
.p4p-empty {
  text-align: center;
  opacity: 0.7;
  font-size: 15px;
  padding: 20px;
}

/* CARD */
.p4p-card {
  padding: 16px;
  border: 5px solid #93c144;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.p4p-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.p4p-tag {
  background: #d1f4d7;
  padding: 4px 10px;
    border: 1px solid #567128;
  border-radius: 8px;
  font-size: 16px;
}
.p4p-tag.complete {
  background: #ffd8d8;
}
.p4p-tag.open {
  background: #e0f7ff;
}

.p4p-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
}

/* INFO ROWS */
.p4p-info {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.p4p-ico {
  width: 40px;
  height: 40px;
  background: #e8f5e9;
  color: #2c7a2c;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.p4p-ico::after {
  content: "";
}

/* PROGRESS */
.p4p-progress-wrap {
  margin: 10px 0;
}
.p4p-progress-bg {
  height: 16px;
  background: #f0f0f0;
  border-radius: 6px;
  overflow: hidden;
}
.p4p-progress {
  height: 16px;
  background: #34c759;
}

/* AVATARS */
.p4p-avatars {
  display: flex;
  gap: 6px;
  margin: 10px 0;
}
.p4p-avatar {
  width: 60px;
  height: 60px;
  background: #eee;
  border: 3px solid #93c144;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #555;
}

/* ACTIONS */
.p4p-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* MODALS */
.p4p-modal-back {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 99999;
}

.p4p-modal {
  background: white;
  padding: 20px;
  border-radius: 14px;
  width: 100%;
  max-width: 400px;
  animation: fadeScale 0.25s ease;
}

@keyframes fadeScale {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

.p4p-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.p4p-field {
  margin-bottom: 12px;
}

/* NON EDITABLE TITLE FIELD */
#p4p-title[disabled] {
  background: #f3f3f3;
  color: #666;
  font-weight: 600;
}

/* DETAIL MODAL */
#p4p-detail-content .p4p-info {
  margin-bottom: 10px;
}

#p4p-detail-content .p4p-title {
  font-size: 20px;
  margin-bottom: 16px;
}

/* ===============================
   LOGROS PLAY4PADEL — ANIMADOS
=============================== */

.p4p-logros-box {
  background: #f9f9f9; /* fondo claro */
  border: 3px solid #93c144; /* borde verde */
  border-radius: 14px;
  padding: 20px;
  max-width: 400px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  margin: 20px auto;
}

.p4p-logros-box h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 22px;
  color: #333;
  text-align: center;
}

.p4p-logro {
  margin-bottom: 16px;
}

.p4p-logro strong {
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
  color: #444;
}

.p4p-bar {
  width: 100%;
  height: 18px;
  background: #e0e0e0;
  border-radius: 9px;
  overflow: hidden;
  margin-bottom: 6px;
}

.p4p-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #93c144, #34c759);
  border-radius: 9px;
  transition: width 1s ease-in-out;
}

.p4p-logro small {
  font-size: 12px;
  color: #555;
  display: block;
  text-align: right;
}

/* Animación: cuando se carga el DOM, se añade la clase "fill" */
.p4p-bar-fill.animate {
  width: var(--fill-width);
}
/* ===============================
   MICRO-FEEDBACK PROGRESO LOGROS
   =============================== */

.p4p-bar {
  position: relative;
  overflow: hidden;
}

/* Animación suave al avanzar */
.p4p-bar-fill {
  transition: width 0.6s ease-out;
  position: relative;
}

/* Destello sutil al avanzar */
.p4p-bar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255,255,255,0.6),
    transparent
  );
  animation: p4p-flash 0.6s ease-out;
}

@keyframes p4p-flash {
  0% { opacity: 0; }
  30% { opacity: 1; }
  100% { opacity: 0; }
}
/* =====================================
   SECCIONES DE PARTIDOS
===================================== */

.p4p-section {
  margin-top: 24px;
}

.p4p-section-header {
  margin-bottom: 12px;
  
}

.p4p-section-title {
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 4px 0;
}

.p4p-section-note {
  font-size: 14px;
  opacity: 0.75;
}

.p4p-list-grid {
  display: grid;
  gap: 14px;
}

.p4p-history-section {
  margin-top: 36px;
  padding-top: 10px;
  border-top: 2px dashed #cfd8c3;
}
/* Estados de partidos */

.status-open{
  background:#c3eefd;
  color:#247e9d;
  font-weight:600;
}

.status-last{
  background:#fff3cd;
  color:#856404;
  font-weight:700;
}

.status-full{
  background:#d1ecf1;
  color:#0c5460;
  font-weight:600;
}

.status-played{
  background:#a4a5a6;
  color:#444;
}

.status-closed{
  background:#fb939c;
  color:#722e34;
}
/* Histórico más discreto */

.p4p-history-section .p4p-card{
  opacity:0.85;
  background:#f6f6f6;
}

.p4p-history-section .p4p-progress{
  opacity:0.6;
}

.p4p-history-section .p4p-btn.primary{
  display:none;
}
/* =====================================
   BADGES DE ESTADO
===================================== */

.status-open{
  background:#c3eefd;
  color:#247e9d;
  font-weight:700;
  border:1px solid #296073;
}

.status-last{
  background:#fff3cd;
  color:#856404;
  font-weight:700;
  border:1px solid #826e2e;
}

.status-full{
  background:#d9ecff;
  color:#0b5394;
  font-weight:700;
  border:1px solid #24517d;
}

.status-played{
  background:#a4a5a6;
  color:#495057;
  font-weight:700;
  border: 1px solid #333434;
}

.status-closed{
  background:#fb939c;
  color:#722e34;
  font-weight:700;
  border: 1px solid #781e25;
}
/* Destacar partidos activos */

#p4p-list-active .p4p-card{
  box-shadow:0 6px 18px rgba(0,0,0,0.08);
  transition:all .2s ease;
}

#p4p-list-active .p4p-card:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 24px rgba(0,0,0,0.12);
}
/* Histórico más discreto */

.p4p-history-section .p4p-card{
  opacity:0.85;
  background:#f7f7f7;
}

.p4p-history-section .p4p-progress{
  opacity:0.6;
}

/* =====================================
   PARTIDOS CERCA DE TI
===================================== */

.p4p-nearby-wrap{
  margin: 16px 0 24px;
}

.p4p-nearby-title{
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 10px;
}

.p4p-nearby-list{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.p4p-nearby-btn{
  border: 1px solid #567128;
  background: #fff;
  color: #5c7f1f;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}

.p4p-nearby-btn:hover{
  background: #f4f9ea;
}

.p4p-nearby-btn.active{
  background: #93c144;
  color: #fff;
  border-color: #93c144;
}

/* =====================================
   TARJETAS DE PARTIDOS EN 2 COLUMNAS
===================================== */

/* Móvil: 1 columna */
.p4p-list-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:14px;
}

/* Tablet / escritorio: 2 columnas */
@media (min-width: 900px){
  .p4p-list-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap:18px;
    align-items:start;
  }
}

.p4p-card{
  transition:all .2s ease;
}

.p4p-card:hover{
  transform:translateY(-3px);
  box-shadow:0 8px 18px rgba(0,0,0,0.08);
}