/* ============================================================================
   NexPeer — Page-specific styles
   Landing, dashboard, room, chat, feed, admin
   ============================================================================ */

/* ---------------------------------------------------------------------------
   1. Landing page
--------------------------------------------------------------------------- */

.np-hero {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(59, 91, 199, 0.18), transparent 55%),
    radial-gradient(ellipse at 90% 100%, rgba(245, 179, 1, 0.14), transparent 50%),
    linear-gradient(180deg, #FFFFFF 0%, var(--np-royal-50) 100%);
}

.np-section {
  padding: 4rem 1rem;
}
@media (min-width: 768px) {
  .np-section { padding: 5.5rem 1.5rem; }
}

.np-section-alt { background: var(--np-canvas); }
.np-section-tint { background: var(--np-royal-50); }

.np-feature-card {
  background: #fff;
  border: 1px solid var(--np-border);
  border-radius: var(--np-radius-lg);
  padding: 1.5rem;
  transition: box-shadow var(--np-base) var(--np-ease),
              transform var(--np-base) var(--np-ease);
}
.np-feature-card:hover {
  box-shadow: var(--np-shadow);
  transform: translateY(-2px);
}

.np-feature-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  background: var(--np-royal-50);
}

.np-feature-icon-gold { background: var(--np-gold-soft); }

/* FAQ */
.np-faq-item {
  background: #fff;
  border: 1px solid var(--np-border);
  border-radius: var(--np-radius-lg);
  padding: 1.25rem;
  cursor: pointer;
  transition: border-color var(--np-fast);
}
.np-faq-item:hover { border-color: var(--np-royal-light); }

.np-faq-item summary {
  font-weight: 600;
  color: var(--np-navy);
  cursor: pointer;
  list-style: none;
}
.np-faq-item summary::-webkit-details-marker { display: none; }

.np-faq-item[open] summary {
  color: var(--np-royal);
  margin-bottom: 0.75rem;
}

/* ---------------------------------------------------------------------------
   2. Auth pages
--------------------------------------------------------------------------- */

.np-auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--np-canvas);
}

.np-auth-card {
  max-width: 26rem;
  width: 100%;
  margin: 2rem auto;
  background: #fff;
  border: 1px solid var(--np-border);
  border-radius: var(--np-radius-xl);
  padding: 2rem;
  box-shadow: var(--np-shadow);
}

@media (max-width: 640px) {
  .np-auth-card {
    padding: 1.5rem;
    border-radius: var(--np-radius-lg);
    margin: 1rem;
  }
}

.np-auth-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

/* ---------------------------------------------------------------------------
   3. Dashboard
--------------------------------------------------------------------------- */

.np-dashboard {
  max-width: var(--np-container-wide);
  margin: 0 auto;
  padding: 2rem 1rem;
}

@media (min-width: 768px) {
  .np-dashboard { padding: 2rem 1.5rem; }
}

.np-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .np-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .np-stat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.np-stat-card {
  background: #fff;
  border: 1px solid var(--np-border);
  border-radius: var(--np-radius-lg);
  padding: 1.25rem;
  transition: box-shadow var(--np-base);
}
.np-stat-card:hover { box-shadow: var(--np-shadow-sm); }

.np-stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--np-muted);
  margin-bottom: 0.375rem;
}

.np-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--np-navy);
  line-height: 1.1;
}

/* ---------------------------------------------------------------------------
   4. Matches grid
--------------------------------------------------------------------------- */

.np-matches-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .np-matches-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .np-matches-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------------------------------------------------------------------------
   5. Course catalogue
--------------------------------------------------------------------------- */

.np-courses-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .np-courses-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .np-courses-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.np-course-cover {
  height: 10rem;
  background: linear-gradient(135deg, var(--np-royal) 0%, var(--np-navy) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--np-gold);
  font-size: 2.5rem;
  font-weight: 800;
  border-radius: var(--np-radius-lg) var(--np-radius-lg) 0 0;
}

/* ---------------------------------------------------------------------------
   6. Chat
--------------------------------------------------------------------------- */

.np-chat-shell {
  display: grid;
  grid-template-columns: 1fr;
  height: calc(100vh - var(--np-header-h));
}

@media (min-width: 768px) {
  .np-chat-shell {
    grid-template-columns: 340px 1fr;
  }
}

.np-chat-sidebar {
  background: #fff;
  border-right: 1px solid var(--np-border);
  overflow-y: auto;
}

.np-chat-thread {
  background: var(--np-canvas);
  overflow-y: auto;
  padding: 1rem 1rem 5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.np-message {
  max-width: 75%;
  padding: 0.6rem 0.9rem;
  border-radius: 1rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  word-wrap: break-word;
}

.np-message-mine {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--np-royal) 0%, var(--np-navy) 100%);
  color: #fff;
  border-bottom-right-radius: 0.25rem;
}

.np-message-theirs {
  align-self: flex-start;
  background: #fff;
  color: var(--np-navy);
  border: 1px solid var(--np-border);
  border-bottom-left-radius: 0.25rem;
}

.np-chat-input-bar {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--np-border);
  padding: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

/* ---------------------------------------------------------------------------
   7. Video room
--------------------------------------------------------------------------- */

.np-room {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: calc(100vh - var(--np-header-h));
  background: var(--np-canvas);
}

.np-room-stage {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 25% 15%, rgba(59, 91, 199, 0.06), transparent 55%),
    radial-gradient(circle at 85% 90%, rgba(245, 179, 1, 0.05), transparent 45%),
    var(--np-canvas);
}

.np-room-videos {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 20;
}

.np-video-tile {
  width: 200px;
  aspect-ratio: 4 / 3;
  border-radius: var(--np-radius);
  overflow: hidden;
  background: var(--np-navy);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--np-shadow-lg);
  position: relative;
}

.np-video-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.np-room-controls {
  background: var(--np-navy);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.np-ctrl-btn {
  min-width: 3.25rem;
  height: 3.25rem;
  padding: 0 1rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  transition: background-color var(--np-fast), transform var(--np-fast);
}

.np-ctrl-btn:hover { background: rgba(255, 255, 255, 0.18); }
.np-ctrl-btn:active { transform: scale(0.95); }

.np-ctrl-btn.is-active {
  background: var(--np-gold);
  color: var(--np-navy);
  border-color: var(--np-gold-light);
}

.np-ctrl-btn.is-danger {
  background: var(--np-danger);
  border-color: #F87171;
}
.np-ctrl-btn.is-danger:hover { background: #B91C1C; }

/* Whiteboard canvas */
#whiteboard {
  background: #fff;
  border-radius: var(--np-radius-lg);
  border: 1px solid var(--np-border);
  box-shadow: var(--np-shadow-lg);
  touch-action: none;
  cursor: crosshair;
  max-width: 100%;
  max-height: 100%;
  display: block;
}

/* ---------------------------------------------------------------------------
   8. Feed
--------------------------------------------------------------------------- */

.np-feed-shell {
  max-width: 45rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.np-feed-item {
  background: #fff;
  border: 1px solid var(--np-border);
  border-radius: var(--np-radius-lg);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  transition: box-shadow var(--np-base);
}
.np-feed-item:hover { box-shadow: var(--np-shadow-sm); }

.np-upvote-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 52px;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--np-border);
  border-radius: 0.5rem;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: background-color var(--np-fast), border-color var(--np-fast);
}

.np-upvote-btn:hover {
  border-color: var(--np-royal-light);
  background: var(--np-royal-50);
}

.np-upvote-btn.is-active {
  background: var(--np-gold-soft);
  border-color: var(--np-gold);
  color: var(--np-gold-deep);
}

/* ---------------------------------------------------------------------------
   9. Admin panel
--------------------------------------------------------------------------- */

.np-admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .np-admin-grid {
    grid-template-columns: 380px 1fr;
  }
}

.np-admin-queue {
  max-height: calc(100vh - 12rem);
  overflow-y: auto;
}

.np-severity-critical { border-left: 4px solid var(--np-danger); }
.np-severity-high     { border-left: 4px solid #EA580C; }
.np-severity-medium   { border-left: 4px solid var(--np-gold); }
.np-severity-low      { border-left: 4px solid #94A3B8; }

/* ---------------------------------------------------------------------------
   10. Profile setup
--------------------------------------------------------------------------- */

.np-profile-ring {
  width: 4rem;
  height: 4rem;
  border-radius: 9999px;
  background: conic-gradient(var(--np-gold) 0%, #E2E8F0 0%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.np-profile-ring::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 9999px;
  background: #fff;
}

.np-profile-ring-text {
  position: relative;
  z-index: 1;
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--np-navy);
}

.np-avatar-preview {
  width: 96px;
  height: 96px;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--np-royal) 0%, var(--np-navy) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  background-size: cover;
  background-position: center;
  border: 3px solid #fff;
  box-shadow: var(--np-shadow);
}

/* ---------------------------------------------------------------------------
   11. Utilities
--------------------------------------------------------------------------- */

.np-scroll-hidden::-webkit-scrollbar { display: none; }
.np-scroll-hidden { scrollbar-width: none; }

.np-line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.np-line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Mobile tweaks */
@media (max-width: 640px) {
  .np-video-tile { width: 140px; }
  .np-ctrl-btn { min-width: 3rem; height: 3rem; padding: 0 0.75rem; }
  .np-logo { width: 2rem; height: 2rem; }
  .np-logo-lg { width: 5rem; height: 5rem; }
  .np-stat-value { font-size: 1.5rem; }
}