/* ========================================================
   住ま居るAI建築士 間取り相談専用ボット ＆ 知見100選ギャラリー
   スタイルシート
   ======================================================== */

.madori-bot-hero {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 40%, #ffffff 100%);
  border: 2px solid #ddd6fe;
  border-radius: 20px;
  padding: 2.8rem 2rem 2.4rem;
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.08);
  position: relative;
  overflow: hidden;
}

.madori-bot-hero::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

.madori-bot-badge {
  background: #ede9fe;
  border: 1.5px solid #8b5cf6;
  color: #6d28d9;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 6px 18px;
  border-radius: 30px;
  display: inline-block;
  margin-bottom: 1rem;
}

.madori-bot-title {
  color: #0f172a;
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1.35;
  margin-bottom: 0.8rem;
}

.madori-filter-bar {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.madori-tabs-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.madori-tab-pill {
  white-space: nowrap;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.madori-tab-pill:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.madori-tab-pill.active {
  background: #7c3aed;
  color: #ffffff;
  border-color: #6d28d9;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.madori-search-box {
  display: flex;
  gap: 10px;
  margin-top: 1rem;
}

.madori-search-input {
  flex: 1;
  padding: 0.75rem 1.2rem;
  font-size: 0.95rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s;
}

.madori-search-input:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

/* Q&A Grid & Cards */
.madori-qa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.madori-qa-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
}

.madori-qa-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(124, 58, 237, 0.12);
  border-color: #a78bfa;
}

.madori-card-thumb-wrap {
  width: 100%;
  height: 180px;
  background: #0f172a;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.madori-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.madori-qa-card:hover .madori-card-thumb {
  transform: scale(1.05);
}

.madori-category-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #f8fafc;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.madori-dim-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: #7c3aed;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.madori-card-body {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.madori-card-q {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.5;
  margin-bottom: 0.6rem;
}

.madori-card-a {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 1rem;
  flex: 1;
}

.madori-card-actions {
  display: flex;
  gap: 8px;
  border-top: 1px dashed #e2e8f0;
  padding-top: 10px;
}

.btn-ask-ai {
  flex: 2;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.2s;
}

.btn-ask-ai:hover {
  opacity: 0.92;
}

.btn-view-detail {
  flex: 1;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  border-radius: 8px;
  padding: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-view-detail:hover {
  background: #e2e8f0;
}

/* Chat Modal / Drawer */
.madori-chat-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.madori-chat-box {
  background: #ffffff;
  border-radius: 20px;
  width: 100%;
  max-width: 760px;
  height: 90vh;
  max-height: 800px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: madoriSlideUp 0.3s ease;
}

@keyframes madoriSlideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.madori-chat-header {
  background: #7c3aed;
  color: #ffffff;
  padding: 1rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.madori-chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.madori-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.7;
  word-break: break-word;
}

.madori-msg-user {
  align-self: flex-end;
  background: #7c3aed;
  color: #ffffff;
  border-bottom-right-radius: 2px;
}

.madori-msg-ai {
  align-self: flex-start;
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border-bottom-left-radius: 2px;
}

.madori-chat-footer {
  padding: 1rem 1.2rem;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.madori-chat-input-row {
  display: flex;
  gap: 8px;
}
