@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,500&family=Inter:wght@400;500;600&display=swap');

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 40px 20px;
  background: #F3ECF6;
  font-family: 'Inter', sans-serif;
}

.mentor-app {
  font-family: 'Inter', sans-serif;
  background: #FBF8FC;
  color: #4A3B5C;
  border-radius: 22px;
  overflow: hidden;
  max-width: 640px;
  margin: 0 auto;
  border: 1px solid #EBDFF0;
  box-shadow: 0 12px 40px rgba(90, 60, 110, 0.08);
}

.mentor-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 24px;
  background: linear-gradient(135deg, #3E2F60 0%, #8A6BA8 55%, #D699D6 100%);
}

.mentor-header-text { flex: 1; }

.persona-switch-btn {
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.4);
  color: #FFFFFF;
  border-radius: 10px;
  padding: 7px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.persona-switch-btn:hover:not(:disabled) { background: rgba(255,255,255,0.26); }
.persona-switch-btn:disabled { opacity: 0.6; cursor: default; }

.avatar-wrap {
  position: relative;
  width: 50px;
  height: 50px;
  flex-shrink: 0;
}

.avatar-glow {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.avatar-glow.active {
  opacity: 1;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(0.9); opacity: 0.5; }
  50% { transform: scale(1.15); opacity: 1; }
}

.avatar-circle {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }

.mentor-name {
  font-family: 'Fraunces', serif;
  font-size: 17px;
  font-weight: 500;
  margin: 0;
  color: #FFFFFF;
}

.mentor-status {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  margin: 2px 0 0;
}

.mentor-intro {
  padding: 20px 24px 10px;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 15px;
  line-height: 1.7;
  color: #6E5A82;
  border-bottom: 0.5px solid #EBDFF0;
}

.mentor-thread {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 220px;
  max-height: 420px;
  overflow-y: auto;
}

.msg-row { display: flex; }
.msg-row.user { justify-content: flex-end; }
.msg-row.coach { justify-content: flex-start; }

.bubble {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.65;
}

.bubble.user {
  background: linear-gradient(135deg, #6E5493 0%, #C888C9 100%);
  color: #FFFFFF;
  border-bottom-right-radius: 5px;
}

.bubble.coach {
  background: #FBF7FC;
  color: #4A3B5C;
  font-family: 'Fraunces', serif;
  border: 0.5px solid #EBDFF0;
  border-bottom-left-radius: 5px;
}

.bubble .source-tag {
  display: block;
  margin-top: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: #A67CA8;
}

.typing-dots { display: flex; gap: 4px; padding: 4px 2px; }

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #C9B3D6;
  animation: bounce 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.mentor-inputbar {
  display: flex;
  gap: 10px;
  padding: 14px 24px 22px;
  border-top: 0.5px solid #EBDFF0;
}

.mentor-inputbar textarea {
  flex: 1;
  resize: none;
  background: #FFFFFF;
  border: 0.5px solid #EBDFF0;
  border-radius: 12px;
  color: #4A3B5C;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  height: 42px;
  line-height: 1.4;
}

.mentor-inputbar textarea:focus { outline: none; border-color: #B58AC0; }
.mentor-inputbar textarea::placeholder { color: #C4B4CE; }

.send-btn {
  background: linear-gradient(135deg, #6E5493 0%, #C888C9 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 12px;
  padding: 0 20px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.send-btn:disabled { opacity: 0.5; cursor: default; }
.send-btn:hover:not(:disabled) { filter: brightness(1.06); }

.mentor-thread::-webkit-scrollbar { width: 6px; }
.mentor-thread::-webkit-scrollbar-thumb { background: #EBDFF0; border-radius: 3px; }

/* --- Panel admina --- */

.admin-wrap {
  max-width: 720px;
  margin: 0 auto;
}

.admin-card {
  background: #FBF8FC;
  border: 1px solid #EBDFF0;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(90, 60, 110, 0.06);
}

.admin-card h1, .admin-card h2 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  color: #4A3B5C;
  margin-top: 0;
}

.admin-card label {
  display: block;
  font-size: 13px;
  color: #6E5A82;
  margin: 12px 0 4px;
}

.admin-card input[type="text"],
.admin-card input[type="password"],
.admin-card input[type="file"] {
  width: 100%;
  padding: 9px 12px;
  border: 0.5px solid #EBDFF0;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  background: #FFFFFF;
  color: #4A3B5C;
}

.admin-card button {
  margin-top: 16px;
  background: linear-gradient(135deg, #6E5493 0%, #C888C9 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.flash {
  background: #F5E9F7;
  color: #6E5493;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 14px;
}

table.pub-list {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.pub-list th, table.pub-list td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 0.5px solid #EBDFF0;
}

table.pub-list th {
  color: #8B7A99;
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 11px;
  background: #EDE3F2;
  color: #6E5493;
}

.link-btn {
  background: none;
  border: none;
  color: #A67CA8;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  text-decoration: underline;
}

.persona-choice {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.persona-option {
  flex: 1;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0.5px solid #EBDFF0;
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  font-size: 14px;
  color: #4A3B5C;
  margin: 0 !important;
}

.persona-option input[type="radio"] {
  width: auto;
  accent-color: #8A6BA8;
}

.persona-option:has(input:checked) {
  border-color: #B58AC0;
  background: #F5E9F7;
}
