/* ======================================
   🎨 AFFINITY CORE – DESIGN FINAL
   ====================================== */

:root {
  --accent: #ff3366;
  --accent-hover: #ff5588;
  --text: #222;
  --bg: #fff;
  --card-bg: rgba(255, 255, 255, 0.9);
  --shadow: rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #ff6688;
    --accent-hover: #ff88aa;
    --text: #eee;
    --bg: #111;
    --card-bg: rgba(30, 30, 30, 0.8);
    --shadow: rgba(0, 0, 0, 0.5);
  }
}

body.affinity-core-mode {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
  margin: 0;
  padding: 0;
}

/* -----------------------------
   STRUCTURĂ GENERALĂ
----------------------------- */
.affinity-core-container {
  max-width: 800px;
  margin: 30px auto;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: 0 8px 20px var(--shadow);
  padding: 20px;
  transition: background 0.4s ease, color 0.4s ease;
}

.am-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--shadow);
  padding-bottom: 10px;
}
.am-header h2 {
  font-size: 1.6em;
  color: var(--accent);
}
.am-badge {
  background: var(--accent);
  color: white;
  padding: 5px 10px;
  border-radius: 20px;
  font-weight: 600;
}

/* -----------------------------
   CARD DE MATCH
----------------------------- */
.am-card-area {
  display: flex;
  justify-content: center;
  padding: 25px 0;
}
.am-card {
  position: relative;
  width: 300px;
  height: 420px;
  background: linear-gradient(160deg, var(--accent) 0%, var(--accent-hover) 100%);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 5px 25px var(--shadow);
  transform: scale(1);
  transition: all 0.3s ease;
}
.am-card:hover {
  transform: scale(1.03);
}
.am-user-avatar {
  width: 100%;
  height: 100%;
  background-position: center;
  background-size: cover;
  filter: blur(4px);
  transition: filter 0.3s ease;
}
.am-user-info {
  position: absolute;
  bottom: 20px;
  width: 100%;
  text-align: center;
  color: white;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}
.am-name {
  font-size: 1.5em;
  margin: 5px 0;
}
.am-percent {
  font-size: 1.2em;
}

/* Butoane DA/NU/INFO */
.am-card-buttons {
  position: absolute;
  bottom: 15px;
  width: 100%;
  display: flex;
  justify-content: space-around;
  z-index: 10;
}
.am-card-buttons button {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  font-size: 1.3em;
  border: none;
  cursor: pointer;
  color: white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  transition: all 0.25s ease;
}
.am-btn-yes {
  background: var(--accent);
}
.am-btn-yes:hover {
  background: var(--accent-hover);
}
.am-btn-no {
  background: #555;
}
.am-btn-no:hover {
  background: #777;
}
.am-btn-info {
  background: #3498db;
}
.am-btn-info:hover {
  background: #5dade2;
}

/* -----------------------------
   SECȚIUNI LISTE
----------------------------- */
.am-section {
  padding: 20px;
  border-top: 1px solid var(--shadow);
}
.am-section h3 {
  color: var(--accent);
  margin-bottom: 10px;
}
.am-list {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}
.am-mini-card {
  flex: 1 1 180px;
  max-width: 180px;
  background: var(--card-bg);
  border-radius: 15px;
  text-align: center;
  padding: 15px 10px;
  box-shadow: 0 3px 10px var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.am-mini-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px var(--shadow);
}
.am-mini-card img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 8px;
}
.am-mini-card p {
  margin: 0;
  color: var(--text);
}
.am-mini-card button {
  margin: 5px 4px;
  padding: 6px 12px;
  font-size: 0.85em;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  color: #fff;
  transition: all 0.2s ease;

}
.am-mini-card .am-btn-yes {
  background: var(--accent);
}
.am-mini-card .am-btn-yes:hover {
  background: var(--accent-hover);
}
.am-mini-card .am-btn-no {
  background: #555;
}
.am-mini-card .am-btn-no:hover {
  background: #777;
}

/* -----------------------------
   COMPATIBILITATE + CHAT
----------------------------- */
.am-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 15px;
}
.am-tab {
  flex: 1;
  padding: 10px;
  background: #ccc;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}
.am-tab.active {
  background: var(--accent);
  color: white;
}
.am-tab-content {
  background: var(--card-bg);
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 3px 10px var(--shadow);
}
.am-chat-box {
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
}
.am-message {
  padding: 8px 12px;
  border-radius: 15px;
  margin-bottom: 8px;
  max-width: 80%;
  line-height: 1.3em;
}
.am-message.mine {
  background: var(--accent);
  color: #fff;
  margin-left: auto;
}
.am-message:not(.mine) {
  background: #ddd;
  color: #000;
}
.am-chat-input {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.am-chat-input input {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #ccc;
  outline: none;
}
.am-chat-input button {
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #fff;
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.am-chat-input button:hover {
  background: var(--accent-hover);
}
.am-back {
  text-align: center;
  margin-top: 20px;
}
.am-back button {
  background: transparent;
  color: var(--accent);
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 1em;
  transition: color 0.2s ease;
}
.am-back button:hover {
  color: var(--accent-hover);
}

/* -----------------------------
   ANIMAȚII + RESPONSIVE
----------------------------- */
.fade-in {
  animation: fadein 0.5s ease;
}
@keyframes fadein {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden { display: none; }

@media (max-width: 600px) {
  .am-card {
    width: 90%;
    height: 400px;
  }
  .am-mini-card {
    flex: 1 1 45%;
  }
}
/* ======================================
   💬 POPUP MATCH
   ====================================== */
#am-popup {
  position: fixed;
  bottom: -120px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: 15px 25px;
  border-radius: 30px;
  box-shadow: 0 5px 15px var(--shadow);
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transition: all 0.6s ease;
  animation: pulse 2s infinite;
}
#am-popup.show {
  bottom: 30px;
  opacity: 1;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 51, 102, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(255, 51, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 51, 102, 0); }
}

#am-popup::before {
  content: "💞 ";
}

/* ======================================
   🧠 BAR CHART COMPATIBILITATE
   ====================================== */
.am-compat-chart {
  margin-top: 15px;
}
.am-bar {
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  overflow: hidden;
  height: 20px;
  margin: 6px 0;
  position: relative;
}
.am-bar-fill {
  background: var(--accent);
  height: 100%;
  width: 0%;
  border-radius: 10px;
  transition: width 1s ease;
}
.am-bar-label {
  font-size: 0.9em;
  margin-bottom: 4px;
  color: var(--text);
}
.am-total-compat {
  text-align: center;
  font-size: 1.3em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 15px;
}
.am-mini-safety, .am-mini-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.am-btn-block, .am-btn-report, .ahc-block-btn, .ahc-report-btn {
  border: 0;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9em;
}

.am-btn-block, .ahc-block-btn {
  background: #ffe8e8;
  color: #c0392b;
}

.am-btn-report, .ahc-report-btn {
  background: #fff7e6;
  color: #d35400;
}

.am-btn-block:hover, .ahc-block-btn:hover {
  background: #ffdcdc;
}

.am-btn-report:hover, .ahc-report-btn:hover {
  background: #ffefd4;
}
.ac-badge {
  background: #e74c3c;
  color: white;
  font-size: 0.8em;
  padding: 2px 6px;
  border-radius: 12px;
  margin-left: 6px;
  display: inline-block;
  min-width: 20px;
  text-align: center;
  font-weight: 600;
  box-shadow: 0 0 6px rgba(231,76,60,0.5);
  transition: transform 0.2s ease;
}

.ac-badge.pulse {
  transform: scale(1.3);
}
.affinity-personality {
  background: #fafafa;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  margin-top: 15px;
}

.affinity-personality h3 {
  color: #6c5ce7;
  margin-bottom: 10px;
}

.affinity-personality ul {
  list-style-type: none;
  padding: 0;
}

.affinity-personality li {
  background: #fff;
  margin: 4px 0;
  padding: 6px 10px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.affinity-compatibility-ai {
  background: #fdfdfd;
  padding: 18px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  margin-top: 15px;
}

.affinity-compatibility-ai h3 {
  color: #6c5ce7;
  margin-bottom: 8px;
}

.aca-levels {
  margin-top: 10px;
}

.aca-level {
  margin: 5px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.aca-bar {
  flex-grow: 1;
  background: #eee;
  height: 6px;
  border-radius: 6px;
  overflow: hidden;
}

.aca-fill {
  background: #6c5ce7;
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
}

.aca-val {
  font-size: 0.85em;
  color: #666;
}
/* ============================================================
   🧠 COMPATIBILITY HISTORY – Carduri compatibilitate AI
   ============================================================ */

.affinity-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.affinity-history-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 16px;
  transition: all 0.3s ease;
  position: relative;
}

.affinity-history-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.ahc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ahc-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

.ahc-name {
  flex: 1;
  margin-left: 10px;
  font-weight: 600;
  font-size: 16px;
  color: #333;
}

.ahc-score {
  color: #d43f8d;
  font-weight: 500;
  text-align: right;
}

.ahc-levels {
  margin-top: 8px;
}

.ahc-level {
  margin-bottom: 8px;
}

.ahc-level-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #444;
  margin-bottom: 2px;
}

.ahc-bar {
  background: #eee;
  border-radius: 8px;
  height: 8px;
  overflow: hidden;
}

.ahc-bar-fill {
  background: linear-gradient(90deg, #ff69b4, #ff1493);
  height: 100%;
  border-radius: 8px;
  transition: width 0.6s ease;
}

.ahc-ai-description {
  margin-top: 10px;
}

.ahc-toggle-btn {
  background: #f7f7f7;
  border: none;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.ahc-toggle-btn:hover {
  background: #ffe5f1;
}

.ahc-ai-text {
  display: none;
  margin-top: 8px;
  background: #fff8f9;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  line-height: 1.5;
}

.ahc-actions {
  display: flex;
  justify-content: space-around;
  margin-top: 12px;
}

.ahc-actions button {
  background: #fff0f5;
  border: 1px solid #ffd6e8;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.ahc-actions button:hover {
  background: #ffd6e8;
  transform: scale(1.05);
}

/* 🔸 Responsive */
@media (max-width: 600px) {
  .affinity-history-card {
    padding: 12px;
  }
  .ahc-avatar {
    width: 50px;
    height: 50px;
  }
  .ahc-name {
    font-size: 14px;
  }
}
.affinity-profile {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  padding: 20px;
  max-width: 600px;
  margin: 20px auto;
}

.ac-profile-header {
  text-align: center;
  margin-bottom: 15px;
}

.ac-profile-header img {
  border-radius: 50%;
  margin-bottom: 10px;
}

.ac-profile-ai {
  background: #fff8f9;
  padding: 15px;
  border-radius: 10px;
  margin-top: 10px;
  line-height: 1.5;
}

.ac-profile-ai h3 {
  color: #d43f8d;
  margin-bottom: 8px;
}
