/* ============================================================
   ProfeAcademī · Sección "Sincronización con la Nube"
   Estilo coherente con las cards "Guía de Inicio" / "Mis Cursos".
   Reutiliza variables --inicio-* para soportar temas.
   ============================================================ */

.pa-cloud-section {
  width: 100%;
  margin: 2rem auto 1rem;
  max-width: 1280px;
  padding: 0 1rem;
}

.pa-cloud-card {
  background: var(--inicio-card-bg, #ffffff);
  border: 1px solid var(--inicio-card-border, rgba(0,0,0,0.06));
  border-radius: 20px;
  padding: 2.2rem 2.5rem;
  box-shadow: 0 20px 60px var(--inicio-shadow, rgba(0,0,0,0.08));
  transition: var(--inicio-transition, all .25s ease);
  position: relative;
  overflow: hidden;
}

/* Decoración tipo "ola" inferior (igual que las cards de la imagen) */
.pa-cloud-card::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 80px;
  background: linear-gradient(180deg, transparent 0%, rgba(99, 179, 237, 0.08) 100%);
  pointer-events: none;
  border-radius: 0 0 20px 20px;
}
.pa-cloud-card > * { position: relative; z-index: 1; }

/* ── Header ── */
.pa-cloud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.6rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--inicio-card-border, rgba(0,0,0,0.06));
}
.pa-cloud-title {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--inicio-text-primary, #1f2937);
}
.pa-cloud-title .pa-cloud-icon {
  font-size: 1.9rem;
  filter: drop-shadow(0 4px 8px rgba(99,179,237,.35));
}
.pa-cloud-state {
  font-size: .85rem;
  color: var(--inicio-text-secondary, #6b7280);
  font-weight: 500;
}

/* ── Banner bienvenida (cuando aplica) ── */
.pa-cloud-welcome {
  text-align: center;
  margin: 0 0 1.8rem;
}
.pa-cloud-welcome h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--inicio-primary, #4f46e5);
  margin: 0 0 .4rem;
}
.pa-cloud-welcome p {
  margin: 0;
  font-size: .95rem;
  color: var(--inicio-text-secondary, #6b7280);
  line-height: 1.6;
}

/* ── Mensaje vacío / placeholder ── */
.pa-cloud-msg {
  text-align: center;
  padding: 2.2rem 1rem;
  color: var(--inicio-text-secondary, #6b7280);
  font-size: .98rem;
  line-height: 1.55;
}
.pa-cloud-msg .pa-msg-icon {
  font-size: 3rem;
  margin-bottom: .8rem;
  filter: drop-shadow(0 4px 12px rgba(99, 179, 237, 0.25));
}
.pa-cloud-msg a {
  color: var(--inicio-primary, #4f46e5);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}

/* ── Tabs ── */
.pa-cloud-tabs {
  display: flex;
  gap: .4rem;
  border-bottom: 2px solid var(--inicio-card-border, rgba(0,0,0,0.06));
  margin-bottom: 1.6rem;
  flex-wrap: wrap;
}
.pa-cloud-tab {
  padding: .7rem 1.3rem;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  color: var(--inicio-text-secondary, #6b7280);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: color .2s, border-color .2s, transform .15s;
  display: flex;
  align-items: center;
  gap: .5rem;
  border-radius: 8px 8px 0 0;
}
.pa-cloud-tab:hover { color: var(--inicio-primary, #4f46e5); background: rgba(99, 179, 237, 0.06); }
.pa-cloud-tab.active {
  color: var(--inicio-primary, #4f46e5);
  border-bottom-color: var(--inicio-primary, #4f46e5);
}
.pa-cloud-tab .pa-tab-count {
  display: inline-flex;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  font-size: .72rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(239,68,68,.3);
}

.pa-cloud-pane { display: none; }
.pa-cloud-pane.active { display: block; }

/* ── Stats (vista profesor) ── */
.pa-cloud-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1.2rem;
  margin-bottom: 1.6rem;
}
.pa-stat {
  background: linear-gradient(135deg, rgba(99,179,237,.08), rgba(167,139,250,.08));
  border: 1px solid var(--inicio-card-border, rgba(0,0,0,0.06));
  border-radius: 16px;
  padding: 1.4rem 1.2rem;
  text-align: center;
  transition: var(--inicio-transition, all .25s ease);
}
.pa-stat:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(99,179,237,.15); }
.pa-stat-value {
  display: block;
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, #4f46e5, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.pa-stat-label {
  display: block;
  margin-top: .4rem;
  font-size: .78rem;
  color: var(--inicio-text-secondary, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}

/* ── Sección título "Mis solicitudes" ── */
.pa-section-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 1.6rem 0 .9rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--inicio-text-primary, #1f2937);
}

/* ── Botones ── */
.pa-cloud-actions {
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.pa-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.6rem;
  background: var(--inicio-primary, #4f46e5);
  color: white;
  border: 0;
  border-radius: 10px;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--inicio-transition, all .2s ease);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(79, 70, 229, .25);
}
.pa-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(79,70,229,.35); filter: brightness(1.05); }
.pa-btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; filter: grayscale(.3); }

.pa-btn-ghost {
  background: transparent;
  border: 1px solid var(--inicio-card-border, rgba(0,0,0,0.1));
  color: var(--inicio-text-secondary, #6b7280);
  box-shadow: none;
}
.pa-btn-ghost:hover {
  background: rgba(99, 179, 237, 0.08);
  color: var(--inicio-primary, #4f46e5);
  box-shadow: none;
}

.pa-btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 12px rgba(16,185,129,.3);
}
.pa-btn-success:hover { box-shadow: 0 6px 16px rgba(16,185,129,.4); }

.pa-btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 4px 12px rgba(239,68,68,.3);
}
.pa-btn-danger:hover { box-shadow: 0 6px 16px rgba(239,68,68,.4); }

/* ── Lista de solicitudes ── */
.pa-req-list {
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
.pa-req-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: 1.1rem 1.3rem;
  background: var(--inicio-card-bg, #ffffff);
  border: 1px solid var(--inicio-card-border, rgba(0,0,0,0.08));
  border-radius: 14px;
  align-items: center;
  transition: var(--inicio-transition, all .2s ease);
  box-shadow: 0 2px 6px rgba(0,0,0,.04);
}
.pa-req-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  border-color: rgba(79,70,229,.25);
}
.pa-req-meta { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.pa-req-title {
  font-size: 1rem;
  color: var(--inicio-text-primary, #1f2937);
  font-weight: 700;
}
.pa-req-sub {
  font-size: .82rem;
  color: var(--inicio-text-secondary, #6b7280);
  word-break: break-word;
  line-height: 1.45;
}

.pa-req-state {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.pa-req-state.pendiente { background: rgba(251,191,36,.18); color: #b45309; border: 1px solid rgba(251,191,36,.45); }
.pa-req-state.aprobado  { background: rgba(16,185,129,.16); color: #047857; border: 1px solid rgba(16,185,129,.45); }
.pa-req-state.rechazado { background: rgba(239,68,68,.16);  color: #b91c1c; border: 1px solid rgba(239,68,68,.45); }

.pa-req-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.pa-req-actions .pa-btn { padding: .5rem 1rem; font-size: .82rem; }

/* ── Drag & Drop ── */
.pa-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  padding: 3rem 1.2rem;
  border: 2px dashed rgba(79, 70, 229, 0.35);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(99,179,237,.05), rgba(167,139,250,.05));
  color: var(--inicio-text-secondary, #6b7280);
  cursor: pointer;
  transition: var(--inicio-transition, all .25s ease);
  text-align: center;
}
.pa-dropzone:hover {
  background: linear-gradient(135deg, rgba(99,179,237,.1), rgba(167,139,250,.1));
  border-color: var(--inicio-primary, #4f46e5);
  transform: translateY(-1px);
}
.pa-dropzone.dragover {
  background: linear-gradient(135deg, rgba(99,179,237,.18), rgba(167,139,250,.18));
  border-color: var(--inicio-primary, #4f46e5);
  border-style: solid;
}
.pa-dropzone .pa-dz-icon {
  font-size: 3rem;
  filter: drop-shadow(0 6px 12px rgba(79,70,229,.25));
}
.pa-dropzone strong {
  color: var(--inicio-primary, #4f46e5);
  font-weight: 700;
}
.pa-dz-help {
  font-size: .85rem;
  color: var(--inicio-text-secondary, #9ca3af);
  margin: 0;
}

/* ── Tabla de roles ── */
.pa-roles-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 .5rem;
}
.pa-roles-table thead th {
  text-align: left;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--inicio-text-secondary, #6b7280);
  padding: .5rem 1rem;
  font-weight: 700;
}
.pa-roles-table tbody tr {
  background: var(--inicio-card-bg, #ffffff);
  transition: var(--inicio-transition, all .2s ease);
}
.pa-roles-table tbody tr:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,.06);
}
.pa-roles-table tbody td {
  padding: .85rem 1rem;
  color: var(--inicio-text-primary, #1f2937);
  font-size: .9rem;
  border-top: 1px solid var(--inicio-card-border, rgba(0,0,0,0.06));
  border-bottom: 1px solid var(--inicio-card-border, rgba(0,0,0,0.06));
  background: var(--inicio-card-bg, #ffffff);
}
.pa-roles-table tbody td:first-child {
  border-left: 1px solid var(--inicio-card-border, rgba(0,0,0,0.06));
  border-radius: 12px 0 0 12px;
}
.pa-roles-table tbody td:last-child {
  border-right: 1px solid var(--inicio-card-border, rgba(0,0,0,0.06));
  border-radius: 0 12px 12px 0;
}

.pa-rol-select {
  background: white;
  color: var(--inicio-text-primary, #1f2937);
  border: 1.5px solid var(--inicio-card-border, rgba(0,0,0,0.12));
  border-radius: 10px;
  padding: .45rem .8rem;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .2s;
}
.pa-rol-select:focus { outline: none; border-color: var(--inicio-primary, #4f46e5); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.pa-rol-select:disabled { opacity: .55; cursor: not-allowed; }

/* ── Toast ── */
.pa-toast-container {
  position: fixed;
  top: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  pointer-events: none;
  max-width: 95vw;
}
.pa-toast {
  pointer-events: auto;
  padding: .85rem 1.4rem;
  border-radius: 12px;
  background: white;
  border: 1px solid rgba(0,0,0,0.08);
  color: #1f2937;
  font-size: .9rem;
  font-weight: 500;
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
  max-width: 420px;
  animation: paToastIn .25s ease;
  border-left: 4px solid var(--inicio-primary, #4f46e5);
}
.pa-toast.success { border-left-color: #10b981; }
.pa-toast.error   { border-left-color: #ef4444; }
.pa-toast.info    { border-left-color: #4f46e5; }
@keyframes paToastIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Loading row ── */
.pa-loading-row {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--inicio-text-secondary, #9ca3af);
  font-size: .9rem;
  font-style: italic;
}

/* ── Tip Ninja (cuando aplica) ── */
.pa-cloud-tip {
  margin-top: 1.4rem;
  padding: 1rem 1.2rem;
  background: linear-gradient(135deg, rgba(16,185,129,.08), rgba(34,197,94,.08));
  border: 1px solid rgba(16,185,129,.25);
  border-radius: 12px;
  display: flex;
  gap: .8rem;
  align-items: flex-start;
  font-size: .9rem;
  color: var(--inicio-text-primary, #1f2937);
  line-height: 1.5;
}
.pa-cloud-tip .tip-icon { font-size: 1.4rem; }
.pa-cloud-tip strong { color: #047857; font-weight: 700; }

/* ── Adaptación a temas oscuros ── */
.theme-dark .pa-cloud-card,
.theme-neon .pa-cloud-card { color: var(--inicio-text-primary, #f3f4f6); }
.theme-dark .pa-toast,
.theme-neon .pa-toast { background: #1a1033; color: #e5e7eb; border-color: rgba(255,255,255,.1); }
.theme-dark .pa-rol-select,
.theme-neon .pa-rol-select { background: #1a1033; color: #e5e7eb; }

/* ── Responsivo ── */
@media (max-width: 768px) {
  .pa-cloud-card { padding: 1.6rem 1.2rem; }
  .pa-cloud-title { font-size: 1.4rem; }
  .pa-cloud-title .pa-cloud-icon { font-size: 1.6rem; }
  .pa-stat-value { font-size: 2rem; }
}
@media (max-width: 640px) {
  .pa-req-item { grid-template-columns: 1fr; }
  .pa-req-actions { justify-self: stretch; }
  .pa-roles-table thead { display: none; }
  .pa-roles-table tbody td { display: block; padding: .35rem 1rem; border: 0; background: transparent; }
  .pa-roles-table tbody tr {
    display: block;
    padding: .6rem .4rem;
    border-radius: 12px;
    border: 1px solid var(--inicio-card-border, rgba(0,0,0,0.08));
    margin-bottom: .5rem;
  }
}
