/* INSEAD AI Community - Alumni Website Styles */
/* 专业商务风格 - INSEAD 绿/白底，参考 INSEAD 官网 */

:root {
  --insead-green: #00684B;
  --insead-dark: #004D38;
  --insead-light: #00895F;
  --insead-accent: #009F6E;
  --bg-light: #f7f8fa;
  --bg-white: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #5a6378;
  --text-muted: #8b95a8;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0, 48, 135, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 48, 135, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 48, 135, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --status-active: #16a34a;
  --status-entrepreneur: #d97706;
  --status-seeking: #7c3aed;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-light);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== Header ===== */
.site-header {
  background: var(--insead-green);
  background: linear-gradient(135deg, var(--insead-dark) 0%, var(--insead-green) 100%);
  color: white;
  padding: 1.75rem 1.5rem 2rem;
  text-align: center;
}

.header-logo {
  margin-bottom: 1rem;
}

.header-logo img {
  height: 110px;
  width: auto;
  display: inline-block;
  vertical-align: middle;
}

.site-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 0.35rem;
}

.site-header .subtitle {
  font-size: 0.95rem;
  opacity: 0.85;
  font-weight: 300;
}

.site-header .stats {
  margin-top: 1rem;
  font-size: 0.85rem;
  opacity: 0.7;
}

/* ===== Controls Bar ===== */
.controls-bar {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.controls-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.search-box {
  flex: 1;
  min-width: 240px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--insead-accent);
}

.search-box::before {
  content: '🔍';
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
}

.filter-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-select {
  padding: 0.55rem 0.8rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: var(--bg-white);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.2s;
}

.filter-select:hover,
.filter-select:focus {
  border-color: var(--insead-accent);
  outline: none;
}

.clear-btn {
  padding: 0.55rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.clear-btn:hover {
  border-color: var(--insead-accent);
  color: var(--insead-accent);
}

.result-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}

/* ===== Members Grid ===== */
.members-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

/* ===== Member Card ===== */
.member-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.member-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--insead-light);
}

.member-card-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.1rem;
  border-bottom: 1px solid var(--border-color);
}

.member-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--insead-green);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}

.member-name-block {
  flex: 1;
  min-width: 0;
}

.member-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.member-card-body {
  padding: 1rem 1.1rem;
  flex: 1;
}

.member-industry {
  font-size: 0.88rem;
  color: var(--insead-green);
  font-weight: 500;
  margin-bottom: 0.6rem;
}

.member-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.6rem;
}

.member-tag {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  background: #eef2ff;
  color: var(--insead-light);
}

.member-status {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.15rem 0.6rem;
  border-radius: 12px;
  font-weight: 500;
}

.status-active {
  background: #dcfce7;
  color: var(--status-active);
}

.status-entrepreneur {
  background: #fef3c7;
  color: var(--status-entrepreneur);
}

.status-seeking {
  background: #ede9fe;
  color: var(--status-seeking);
}

.member-card-footer {
  padding: 0.75rem 1.1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.member-city {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ===== Modal (Member Detail) ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 104, 75, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 1rem;
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: slideUp 0.3s ease;
}

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

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 1;
}

.modal-close:hover {
  background: var(--bg-light);
  color: var(--text-primary);
}

.modal-header {
  background: linear-gradient(135deg, var(--insead-dark), var(--insead-green));
  color: white;
  padding: 2rem 1.5rem 1.5rem;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.modal-header .member-avatar {
  width: 60px;
  height: 60px;
  font-size: 1.6rem;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.modal-header-info h2 {
  font-size: 1.3rem;
  margin-bottom: 0.2rem;
}

.modal-header-info .modal-meta {
  font-size: 0.88rem;
  opacity: 0.85;
}

.modal-body {
  padding: 1.5rem;
}

.detail-row {
  display: flex;
  margin-bottom: 1.1rem;
  gap: 1rem;
}

.detail-label {
  flex-shrink: 0;
  width: 100px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  padding-top: 0.1rem;
}

.detail-value {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.55;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.modal-footer {
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.contact-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-light);
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--text-muted);
}

.empty-state h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

/* ===== Footer ===== */
.site-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  margin-top: 2rem;
}

/* ===== Admin Styles ===== */
.admin-header {
  background: linear-gradient(135deg, var(--insead-dark), var(--insead-green));
  color: white;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.admin-logo {
  height: 40px;
  width: auto;
}

.admin-header h1 {
  font-size: 1.3rem;
}

.admin-back-link {
  color: white;
  text-decoration: none;
  font-size: 0.88rem;
  opacity: 0.8;
}

.admin-back-link:hover {
  opacity: 1;
}

.admin-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.5rem;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-search {
  flex: 1;
  min-width: 200px;
  padding: 0.6rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.admin-search:focus {
  outline: none;
  border-color: var(--insead-accent);
}

.btn {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-primary {
  background: var(--insead-green);
  color: white;
}

.btn-primary:hover {
  background: var(--insead-dark);
}

.btn-secondary {
  background: var(--bg-light);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--insead-accent);
  color: var(--insead-accent);
}

.btn-danger {
  background: #fee2e2;
  color: #dc2626;
}

.btn-danger:hover {
  background: #fecaca;
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

/* Admin Table */
.admin-table-wrap {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  background: var(--bg-light);
  padding: 0.8rem 1rem;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.admin-table td {
  padding: 0.8rem 1rem;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-color);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover {
  background: var(--bg-light);
}

.admin-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--insead-green);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.action-btns {
  display: flex;
  gap: 0.4rem;
}

/* Form Styles */
.form-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 104, 75, 0.4);
  z-index: 1000;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 1rem;
  overflow-y: auto;
}

.form-overlay.active {
  display: flex;
}

.form-content {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.form-header h2 {
  font-size: 1.15rem;
  color: var(--text-primary);
}

.form-body {
  padding: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 1rem;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-group label .required {
  color: #dc2626;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--insead-accent);
}

.form-group textarea {
  resize: vertical;
  min-height: 70px;
}

.form-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--insead-green);
  margin: 1.25rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-color);
}

.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-light);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.avatar-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--insead-dark);
  color: white;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  transition: transform 0.3s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  background: #dc2626;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .site-header h1 {
    font-size: 1.4rem;
  }

  .header-logo img {
    height: 80px;
  }

  .admin-logo {
    height: 32px;
  }

  .admin-header-left {
    gap: 0.6rem;
  }

  .controls-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    justify-content: space-between;
  }

  .filter-select {
    flex: 1;
  }

  .result-count {
    margin-left: 0;
    text-align: center;
  }

  .members-grid {
    grid-template-columns: 1fr;
  }

  .admin-table {
    font-size: 0.8rem;
  }

  .admin-table th,
  .admin-table td {
    padding: 0.6rem 0.5rem;
  }

  .form-row {
    flex-direction: column;
  }

  .detail-row {
    flex-direction: column;
    gap: 0.2rem;
  }

  .detail-label {
    width: auto;
  }
}
