/* ===== BirthPing Mini Pages – Modern Redesign ===== */

/* --- Base --- */
*, *::before, *::after {
  box-sizing: border-box;
}

.bp-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #FFF5EC 0%, #FFEBD8 50%, #FED9B7 100%);
  font-family: 'Baloo 2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #333;
  line-height: 1.6;
  padding: 0;
  margin: 0;
  overflow-x: hidden;
}

/* --- Header Bar --- */
.bp-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 245, 236, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 209, 179, 0.5);
  padding: 12px 24px;
  overflow: hidden;
}
.bp-header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bp-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #FF6D00;
  font-weight: 700;
  font-size: 1.15rem;
}
.bp-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.bp-header-back {
  color: #FF6D00;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.2s;
}
.bp-header-back:hover { opacity: 0.7; }

/* --- Main Content Area --- */
.bp-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

/* --- Page Title Section --- */
.bp-title-section {
  margin-bottom: 32px;
}
.bp-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #333;
  margin: 0 0 4px;
}
.bp-subtitle {
  font-size: 1rem;
  color: #888;
  font-weight: 500;
  margin: 0;
}

/* --- Cards --- */
.bp-card {
  background: white;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 4px 24px rgba(255, 109, 0, 0.07);
  border: 1px solid rgba(255, 209, 179, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}
.bp-card:hover {
  box-shadow: 0 8px 32px rgba(255, 109, 0, 0.12);
}
.bp-card + .bp-card {
  margin-top: 20px;
}
.bp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.bp-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bp-card-icon {
  font-size: 1.3rem;
}

/* --- Delivery Time Card --- */
.bp-delivery-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.bp-delivery-row select {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  padding: 10px 14px;
  border: 2px solid #FFD1B3;
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  background: white;
  color: #333;
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23FF6D00' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.bp-delivery-row select:focus {
  outline: none;
  border-color: #FF6D00;
}

/* --- Filter Bar --- */
.bp-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.bp-filter-chip {
  padding: 6px 16px;
  border-radius: 20px;
  border: 2px solid #FFD1B3;
  background: white;
  color: #888;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.bp-filter-chip:hover {
  border-color: #FF6D00;
  color: #FF6D00;
}
.bp-filter-chip.active {
  background: #FF6D00;
  border-color: #FF6D00;
  color: white;
}
.bp-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: rgba(255, 109, 0, 0.12);
  color: #FF6D00;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 6px;
  padding: 0 6px;
}
.bp-filter-chip.active .bp-filter-count {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}

/* --- Birthday Contact Cards --- */
.bp-contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.bp-contact-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  border: 2px solid transparent;
  box-shadow: 0 2px 12px rgba(255, 109, 0, 0.06);
  transition: all 0.25s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  overflow: hidden;
}
.bp-contact-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 16px 16px 0 0;
}
.bp-contact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(255, 109, 0, 0.14);
}
.bp-contact-card:focus {
  outline: 2px solid #FF6D00;
  outline-offset: 2px;
}

/* Relationship color coding */
.bp-contact-card[data-rel="familie"]::before,
.bp-contact-card[data-rel="family"]::before { background: #E91E63; }
.bp-contact-card[data-rel="freund"]::before,
.bp-contact-card[data-rel="freundin"]::before,
.bp-contact-card[data-rel="friend"]::before { background: #FF6D00; }
.bp-contact-card[data-rel="kollege"]::before,
.bp-contact-card[data-rel="kollegin"]::before,
.bp-contact-card[data-rel="colleague"]::before { background: #2196F3; }
.bp-contact-card[data-rel="partner"]::before,
.bp-contact-card[data-rel="partnerin"]::before { background: #E91E63; }
.bp-contact-card[data-rel="other"]::before { background: #9E9E9E; }

.bp-contact-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: white;
  margin-bottom: 14px;
  text-transform: uppercase;
}
/* Avatar colors by relationship */
.bp-avatar-familie, .bp-avatar-family, .bp-avatar-partner, .bp-avatar-partnerin { background: linear-gradient(135deg, #E91E63, #F06292); }
.bp-avatar-freund, .bp-avatar-freundin, .bp-avatar-friend { background: linear-gradient(135deg, #FF6D00, #FF9E40); }
.bp-avatar-kollege, .bp-avatar-kollegin, .bp-avatar-colleague { background: linear-gradient(135deg, #2196F3, #64B5F6); }
.bp-avatar-other { background: linear-gradient(135deg, #9E9E9E, #BDBDBD); }

.bp-contact-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 4px;
}
.bp-contact-date {
  font-size: 0.88rem;
  color: #999;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.bp-contact-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bp-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
}
.bp-tag-rel {
  background: rgba(255, 109, 0, 0.1);
  color: #FF6D00;
}
.bp-tag-familie, .bp-tag-family, .bp-tag-partner, .bp-tag-partnerin {
  background: rgba(233, 30, 99, 0.1);
  color: #E91E63;
}
.bp-tag-freund, .bp-tag-freundin, .bp-tag-friend {
  background: rgba(255, 109, 0, 0.1);
  color: #FF6D00;
}
.bp-tag-kollege, .bp-tag-kollegin, .bp-tag-colleague {
  background: rgba(33, 150, 243, 0.1);
  color: #2196F3;
}
.bp-tag-other {
  background: rgba(158, 158, 158, 0.1);
  color: #757575;
}
.bp-tag-style {
  background: rgba(156, 39, 176, 0.08);
  color: #9C27B0;
}
.bp-contact-edit-hint {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 0.8rem;
  color: #ccc;
  transition: color 0.2s;
}
.bp-contact-card:hover .bp-contact-edit-hint {
  color: #FF6D00;
}

/* --- Empty State --- */
.bp-empty {
  text-align: center;
  padding: 48px 20px;
  color: #aaa;
}
.bp-empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}
.bp-empty p {
  font-size: 1rem;
}

/* --- Edit Form --- */
.bp-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.bp-form-group {
  display: flex;
  flex-direction: column;
}
.bp-form-group.full-width {
  grid-column: 1 / -1;
}
.bp-form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.bp-input,
.bp-select,
.bp-textarea {
  padding: 12px 14px;
  border: 2px solid #f0e0d0;
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  background: #FAFAFA;
  color: #333;
  transition: border-color 0.2s, background 0.2s;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.bp-input:focus,
.bp-select:focus,
.bp-textarea:focus {
  outline: none;
  border-color: #FF6D00;
  background: white;
}
.bp-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23FF6D00' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.bp-textarea {
  resize: vertical;
  min-height: 80px;
}

/* --- Buttons --- */
.bp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 14px;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.bp-btn:focus {
  outline: 2px solid #FF6D00;
  outline-offset: 2px;
}
.bp-btn-primary {
  background: #FF6D00;
  color: white;
}
.bp-btn-primary:hover {
  background: #e65c00;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255, 109, 0, 0.3);
}
.bp-btn-danger {
  background: transparent;
  color: #e74c3c;
  border: 2px solid #fdd;
}
.bp-btn-danger:hover {
  background: #fef0ef;
  border-color: #e74c3c;
}
.bp-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  grid-column: 1 / -1;
}

/* --- Toast Notification --- */
.bp-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 14px 28px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.bp-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.bp-toast.success {
  background: #2e7d32;
  color: white;
}
.bp-toast.error {
  background: #c62828;
  color: white;
}

/* --- Platform Badge --- */
.bp-platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
}
.bp-platform-telegram {
  background: rgba(0, 136, 204, 0.1);
  color: #0088cc;
}
.bp-platform-whatsapp {
  background: rgba(37, 211, 102, 0.1);
  color: #25d366;
}

/* --- Stats Row --- */
.bp-stats-row {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.bp-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 20px;
  background: linear-gradient(135deg, #FFF5EC, #FFEBD8);
  border-radius: 14px;
  min-width: 80px;
}
.bp-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #FF6D00;
}
.bp-stat-label {
  font-size: 0.75rem;
  color: #999;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* --- Search Bar --- */
.bp-search-wrapper {
  position: relative;
  margin-bottom: 16px;
}
.bp-search {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px 14px 12px 42px;
  border: 2px solid #f0e0d0;
  border-radius: 14px;
  font-size: 0.95rem;
  font-family: inherit;
  background: white;
  color: #333;
  transition: border-color 0.2s;
}
.bp-search:focus {
  outline: none;
  border-color: #FF6D00;
}
.bp-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: #ccc;
  pointer-events: none;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .bp-main {
    padding: 20px 12px 48px;
  }
  .bp-title {
    font-size: 1.4rem;
  }
  .bp-card {
    padding: 16px;
    border-radius: 16px;
  }
  .bp-contacts-grid {
    grid-template-columns: 1fr;
  }
  .bp-form-grid {
    grid-template-columns: 1fr;
  }
  .bp-form-actions {
    flex-direction: column;
  }
  .bp-form-actions .bp-btn {
    width: 100%;
  }
  .bp-stats-row {
    justify-content: center;
  }
  .bp-filter-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .bp-filter-bar::-webkit-scrollbar {
    display: none;
  }
  .bp-header {
    padding: 10px 12px;
  }
  .bp-delivery-row {
    flex-direction: column;
    align-items: stretch;
  }
  .bp-delivery-row select {
    max-width: 100%;
  }
  .bp-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .bp-btn {
    padding: 12px 16px;
    font-size: 0.9rem;
  }
}

@media (max-width: 380px) {
  .bp-main {
    padding: 16px 10px 40px;
  }
  .bp-title {
    font-size: 1.25rem;
  }
  .bp-contact-card {
    padding: 14px;
  }
  .bp-card {
    padding: 14px;
  }
}
