/* ============================================
   PERFIL DASHBOARD PAGE
   ============================================ */

.perfil-container {
  max-width: 1100px;
  margin: 0 auto;
  animation: fadeIn 0.4s ease-out;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.perfil-grid-layout {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .perfil-grid-layout {
    grid-template-columns: 1fr;
  }
}

/* Base Card */
.p-card {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  overflow: hidden;
  position: relative;
}

/* Header Cover & Avatar */
.perfil-cover {
  height: 140px;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #38bdf8 100%);
  position: relative;
}

.perfil-cover::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiPjxyZWN0IHdpZHRoPSI4IiBoZWlnaHQ9IjgiIGZpbGw9IiNmZmYiIGZpbGwtb3BhY2l0eT0iMC4wNCIvPjwvc3ZnPg==');
  opacity: 0.5;
}

.perfil-avatar-wrapper {
  position: absolute;
  bottom: -40px;
  left: 30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  z-index: 10;
}

.perfil-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #0f172a;
  background: #1e293b;
}

.perfil-header-info {
  padding: 50px 30px 25px 30px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 15px;
}

.perfil-name {
  font-size: 2rem;
  font-weight: 800;
  color: white;
  margin: 0 0 5px 0;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.perfil-email {
  font-size: 1rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.perfil-actions {
  display: flex;
  gap: 10px;
}

.btn-edit-profile {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-edit-profile:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-save-profile {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.btn-save-profile:hover {
  background: #0284c7;
  transform: translateY(-2px);
}

/* Charts & Stats Section */
.p-card-body {
  padding: 1.5rem;
}

.p-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stat-box {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-val {
  font-size: 1.8rem;
  font-weight: 800;
  color: white;
  margin-bottom: 4px;
}

.stat-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-val.correct { color: #4ade80; text-shadow: 0 0 10px rgba(74, 222, 128, 0.4); }
.stat-val.incorrect { color: #f87171; text-shadow: 0 0 10px rgba(248, 113, 113, 0.4); }
.stat-val.skipped { color: #facc15; text-shadow: 0 0 10px rgba(250, 204, 21, 0.4); }
.stat-val.decks { color: #38bdf8; text-shadow: 0 0 10px rgba(56, 189, 248, 0.4); }

/* SVG Donut Chart */
.chart-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
  position: relative;
}

.circular-chart {
  display: block;
  margin: 0 auto;
  max-width: 180px;
  max-height: 180px;
}

.circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 3.8;
}

.circle {
  fill: none;
  stroke-width: 2.8;
  stroke-linecap: round;
  transition: stroke-dasharray 1s ease-out;
}

.circle.correct { stroke: #4ade80; }
.circle.incorrect { stroke: #f87171; }
.circle.skipped { stroke: #facc15; }

.chart-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.chart-center-val {
  font-size: 2rem;
  font-weight: 800;
  color: white;
  line-height: 1;
}

.chart-center-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 5px;
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 15px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.correct { background: #4ade80; }
.legend-dot.incorrect { background: #f87171; }
.legend-dot.skipped { background: #facc15; }

/* Info / Form section */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.info-value {
  font-size: 1.1rem;
  color: white;
  font-weight: 500;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Edit Form Styles */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.9);
  font-weight: 600;
}

.form-input, .form-select {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  font-family: inherit;
}

.form-input:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.form-select option {
  background: #0f172a;
  color: white;
}

/* Notification Toast */
.perfil-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #10b981;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
}

.perfil-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.perfil-toast.error {
  background: #ef4444;
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.4);
}
