/* ==========================================================================
   AiHub.sol - Forms, Modals, Admin, Reputation & Static Pages Styling
   ========================================================================== */

/* --------------------------------------------------------------------------
   Modal Backdrop & Window
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeInModal 0.2s ease-out forwards;
}

.modal-content {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), 0 0 30px rgba(0, 0, 0, 0.8);
  position: relative;
  display: flex;
  flex-direction: column;
  animation: slideUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.modal-header h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--accent-orange);
}

.modal-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  background-color: var(--bg-surface-elevated);
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* --------------------------------------------------------------------------
   Duplicate Detection Banner & Cards
   -------------------------------------------------------------------------- */
.duplicate-alert {
  background-color: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.duplicate-alert-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: var(--color-warning);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.duplicate-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.duplicate-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.duplicate-item-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.duplicate-match-pill {
  font-size: 0.725rem;
  padding: 0.15rem 0.45rem;
  background-color: rgba(245, 158, 11, 0.2);
  color: var(--color-warning);
  border-radius: var(--radius-full);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Contribution / Form Page Container
   -------------------------------------------------------------------------- */
.form-page-container {
  max-width: 780px;
  margin: 3rem auto 5rem;
  padding: 0 1.5rem;
}

.form-page-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}

.form-page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.form-page-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.form-page-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.checkbox-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.checkbox-chip:hover {
  border-color: var(--border-medium);
  color: #ffffff;
}

.checkbox-chip input[type="checkbox"]:checked + span {
  color: var(--accent-orange);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Reputation & Profile View
   -------------------------------------------------------------------------- */
.profile-page {
  padding: 3rem 0 5rem;
}

.profile-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.profile-user-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-orange);
  box-shadow: 0 0 20px var(--accent-orange-glow);
}

.profile-names h1 {
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.profile-names p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.profile-badges-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.profile-badge-chip {
  background: var(--accent-orange-subtle);
  color: var(--accent-orange);
  border: 1px solid rgba(255, 122, 0, 0.3);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.775rem;
  font-weight: 600;
}

.reputation-score-box {
  background: linear-gradient(135deg, var(--bg-surface-elevated) 0%, #16161f 100%);
  border: 1px solid rgba(255, 122, 0, 0.4);
  border-radius: var(--radius-md);
  padding: 1.25rem 2rem;
  text-align: center;
  box-shadow: 0 0 20px rgba(255, 122, 0, 0.15);
}

.reputation-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent-orange);
  line-height: 1;
}

.reputation-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* --------------------------------------------------------------------------
   Admin Moderation Dashboard
   -------------------------------------------------------------------------- */
.admin-page {
  padding: 3rem 0 5rem;
}

.admin-header {
  margin-bottom: 2rem;
}

.admin-table-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.admin-card-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-card-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.admin-table th {
  background-color: var(--bg-surface-elevated);
  color: var(--text-muted);
  padding: 0.85rem 1.25rem;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
}

.admin-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.admin-table tr:hover td {
  background-color: var(--bg-surface-hover);
}

.admin-logo-thumb {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Static Pages (About, Guidelines, Terms, Privacy, Contact)
   -------------------------------------------------------------------------- */
.static-page {
  max-width: 820px;
  margin: 3.5rem auto 5.5rem;
  padding: 0 1.5rem;
}

.static-article {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 3rem;
}

.static-article h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: #ffffff;
}

.static-article .lead {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.static-content h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 2rem 0 0.85rem;
  color: #ffffff;
}

.static-content p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.25rem;
  font-size: 0.975rem;
}

.static-content ul, .static-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.static-content li {
  margin-bottom: 0.5rem;
}

/* --------------------------------------------------------------------------
   Responsive Layout Media Queries for Forms, Modals & Static Content
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }
  .directory-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
  .form-page-card {
    padding: 1.75rem 1.25rem;
  }
  .profile-card {
    padding: 1.75rem 1.25rem;
    flex-direction: column;
    align-items: flex-start;
  }
  .profile-user-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .reputation-score-box {
    width: 100%;
  }
  .static-article {
    padding: 2rem 1.25rem;
  }
  .modal-content {
    max-width: 95vw;
    margin: 1rem;
  }
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1.25rem;
  }
}

@media (max-width: 480px) {
  .form-page-container {
    padding: 0 1rem;
    margin: 2rem auto 4rem;
  }
  .form-page-header h1 {
    font-size: 1.6rem;
  }
  .static-article h1 {
    font-size: 1.85rem;
  }
  .static-article .lead {
    font-size: 1rem;
    margin-bottom: 1.75rem;
  }
  .static-content h2 {
    font-size: 1.25rem;
  }
}

/* --------------------------------------------------------------------------
   Cloudflare Turnstile Anti-Bot Security Widget
   -------------------------------------------------------------------------- */
.turnstile-container {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  min-height: 65px;
  margin: 0.5rem 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.turnstile-container iframe {
  border-radius: var(--radius-sm);
}

@media (max-width: 480px) {
  .turnstile-container {
    justify-content: center;
    transform: scale(0.95);
    transform-origin: center center;
  }
}

