/* 
  EduFlow SaaS Educational ERP - Parent Management Module Stylesheet
  ------------------------------------------------------------------
*/

/* Import app and design system styles */
@import url("app.css");

/* --- Main workspace grid --- */
.parents-workspace-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  width: 100%;
}

.parents-screen-element {
  display: none;
  width: 100%;
  animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.parents-screen-element.active {
  display: block;
}

/* --- Linked Children Grid --- */
.linked-children-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5);
  width: 100%;
}

.linked-child-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.linked-child-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(97, 61, 223, 0.2);
}

.linked-child-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.linked-child-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--color-primary);
}

.linked-child-info h5 {
  font-family: var(--font-headings);
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--color-text-primary);
}

.linked-child-info p {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

/* --- Screen 6: Communication Messaging center --- */
.chat-workspace {
  display: flex;
  flex-direction: column;
  height: 400px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background-color: var(--color-surface-hover);
  overflow: hidden;
}

.chat-history-box {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.chat-bubble {
  max-width: 70%;
  padding: var(--space-3.5) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  line-height: 1.4;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-1.5);
  box-shadow: var(--shadow-sm);
}

.chat-bubble.incoming {
  align-self: flex-start;
  background-color: var(--color-surface);
  color: var(--color-text-primary);
  border-bottom-left-radius: var(--radius-xs);
  border: 1px solid var(--color-border);
}

.chat-bubble.outgoing {
  align-self: flex-end;
  background-color: var(--color-primary);
  color: white;
  border-bottom-right-radius: var(--radius-xs);
}

.chat-bubble-meta {
  font-size: 0.625rem;
  align-self: flex-end;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-bubble.incoming .chat-bubble-meta {
  color: var(--color-text-tertiary);
}

.chat-bubble.outgoing .chat-bubble-meta {
  color: rgba(255, 255, 255, 0.9);
}

.chat-input-bar {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-4);
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

/* --- Parent Portal Custom elements --- */
.portal-child-selector-bar {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* Outstanding balance alerts */
.outstanding-invoice-warning {
  background-color: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  color: var(--color-danger);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
}

/* Dark mode adjustments */
[data-theme="dark"] .chat-bubble.incoming {
  background-color: #1a153a;
  border-color: #2d245b;
}

[data-theme="dark"] .chat-bubble.outgoing {
  background-color: var(--color-primary);
}

[data-theme="dark"] .outstanding-invoice-warning {
  background-color: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}
