/* events.css - Talmid360 Events & Projects Manager */

#view-events {
  padding: 24px;
  background: #f8fafc;
  min-height: 100vh;
}

.events-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.events-title-wrap h1 {
  font-size: 2rem;
  color: #0f172a;
  margin-bottom: 4px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
}

.events-title-wrap p {
  color: #64748b;
  font-size: 1.05rem;
}

.btn-create-event {
  background: linear-gradient(135deg, #FF6B6B, #C0392B);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(220,53,69,0.3);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-create-event:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220,53,69,0.4);
}

/* Event Cards Grid */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.event-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.event-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  border-color: #FF6B6B;
}

.event-card-type-bg {
  position: absolute;
  top: -20px;
  left: -20px;
  font-size: 6rem;
  opacity: 0.04;
  transform: rotate(-15deg);
  pointer-events: none;
}

.event-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.event-card-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 4px;
}

.event-card-meta {
  font-size: 0.9rem;
  color: #64748b;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.event-status {
  background: #f1f5f9;
  color: #475569;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.event-status.active {
  background: rgba(34,197,94,0.1);
  color: #16a34a;
}
.event-status.completed {
  background: rgba(59,130,246,0.1);
  color: #2563eb;
}

/* Dashboard Master View */
.event-dashboard {
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.ed-header {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: white;
  padding: 32px 40px;
  position: relative;
}

.ed-header-back {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  margin-bottom: 20px;
  display: inline-block;
  transition: all 0.2s;
}

.ed-header-back:hover {
  background: rgba(255,255,255,0.2);
}

.ed-title {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.ed-meta {
  display: flex;
  gap: 20px;
  color: #cbd5e1;
  font-size: 1rem;
}

.ed-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ed-tabs {
  display: flex;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 24px;
}

.ed-tab {
  padding: 16px 24px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.ed-tab.active {
  color: #FF6B6B;
  border-bottom-color: #FF6B6B;
}

.ed-tab:hover:not(.active) {
  color: #334155;
  background: #f1f5f9;
}

.ed-content {
  padding: 32px 40px;
  min-height: 400px;
}

/* Sections */
.ed-section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Module Blocks */
.ed-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 24px;
}

.ed-module {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.ed-module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.ed-module-header h3 {
  font-size: 1.2rem;
  color: #0f172a;
  font-weight: 700;
}

.ed-ai-gen-btn {
  background: linear-gradient(135deg, #a855f7, #7e22ce);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(126,34,206,0.2);
  transition: all 0.2s;
}

.ed-ai-gen-btn:hover {
  background: linear-gradient(135deg, #9333ea, #6b21a8);
  transform: translateY(-1px);
}

.ed-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
}

.ed-empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.ed-markdown-content {
  line-height: 1.6;
  color: #334155;
}

.ed-markdown-content h4 {
  color: #1e293b;
  margin-top: 16px;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.ed-markdown-content ul {
  padding-right: 20px;
  margin-bottom: 16px;
}

.ed-markdown-content li {
  margin-bottom: 6px;
}

/* Groups Widget */
.ed-group-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.ed-group-card h4 {
  color: #0f172a;
  margin-bottom: 12px;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 6px;
}

.ed-group-members {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ed-group-member {
  background: white;
  border: 1px solid #cbd5e1;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #475569;
  font-weight: 600;
}

/* Roles Widget */
.ed-role-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid #e2e8f0;
}

.ed-role-icon {
  font-size: 1.5rem;
}

.ed-role-info {
  flex: 1;
}

.ed-role-name {
  font-weight: 800;
  color: #0f172a;
}

.ed-role-student {
  color: #3b82f6;
  font-weight: 600;
  font-size: 0.9rem;
}

.ed-role-desc {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 2px;
}

/* Form Overlay */
.event-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.event-modal {
  background: white;
  width: 90%;
  max-width: 500px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  animation: evSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.event-modal-header {
  background: #f8fafc;
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.event-modal-header h2 {
  font-size: 1.3rem;
  color: #0f172a;
  margin: 0;
}

.event-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #64748b;
  cursor: pointer;
}

.event-modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ev-field label {
  display: block;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.ev-field input, .ev-field select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
}

.event-modal-footer {
  padding: 20px 24px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Markdown loading spinner */
.ed-loading-spinner {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 3px solid rgba(168,85,247,0.2);
  border-radius: 50%;
  border-top-color: #a855f7;
  animation: spin 1s ease-in-out infinite;
  margin: 20px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Field Companion List */
.ed-field-list {
  max-width: 600px;
  margin: 0 auto;
}

.ed-field-student {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.ed-fs-name {
  font-weight: 800;
  font-size: 1.1rem;
  color: #0f172a;
}

.ed-fs-role {
  color: #a855f7;
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(168,85,247,0.1);
  padding: 2px 8px;
  border-radius: 12px;
  margin-top: 4px;
  display: inline-block;
}

.ed-fs-action {
  background: #f1f5f9;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
}

.ed-fs-action:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .ed-header {
    padding: 24px;
  }
  .ed-content {
    padding: 24px;
  }
  .ed-tabs {
    overflow-x: auto;
    white-space: nowrap;
  }
}

 / *   F o l l o w - u p   C h a t   U I   * / 
 . e d - f o l l o w u p - c h a t   { 
     m a r g i n - t o p :   2 0 p x ; 
     b o r d e r - t o p :   1 p x   d a s h e d   # e 2 e 8 f 0 ; 
     p a d d i n g - t o p :   1 6 p x ; 
 } 
 . e d - c h a t - h i s t o r y   { 
     m a x - h e i g h t :   2 0 0 p x ; 
     o v e r f l o w - y :   a u t o ; 
     m a r g i n - b o t t o m :   1 2 p x ; 
     d i s p l a y :   f l e x ; 
     f l e x - d i r e c t i o n :   c o l u m n ; 
     g a p :   1 2 p x ; 
 } 
 . e d - c h a t - m s g   { 
     d i s p l a y :   f l e x ; 
     w i d t h :   1 0 0 % ; 
 } 
 . e d - c h a t - u s e r   { 
     j u s t i f y - c o n t e n t :   f l e x - e n d ; 
 } 
 . e d - c h a t - a i   { 
     j u s t i f y - c o n t e n t :   f l e x - s t a r t ; 
 } 
 . e d - c h a t - b u b b l e   { 
     m a x - w i d t h :   8 5 % ; 
     p a d d i n g :   1 0 p x   1 4 p x ; 
     b o r d e r - r a d i u s :   1 2 p x ; 
     f o n t - s i z e :   0 . 9 5 r e m ; 
     l i n e - h e i g h t :   1 . 5 ; 
 } 
 . e d - c h a t - u s e r   . e d - c h a t - b u b b l e   { 
     b a c k g r o u n d :   # 3 b 8 2 f 6 ; 
     c o l o r :   w h i t e ; 
     b o r d e r - b o t t o m - l e f t - r a d i u s :   4 p x ; 
 } 
 . e d - c h a t - a i   . e d - c h a t - b u b b l e   { 
     b a c k g r o u n d :   # f 1 f 5 f 9 ; 
     c o l o r :   # 1 e 2 9 3 b ; 
     b o r d e r - b o t t o m - r i g h t - r a d i u s :   4 p x ; 
 } 
 . e d - c h a t - a i   . e d - c h a t - b u b b l e   h 4   { 
     m a r g i n - t o p :   1 0 p x ; 
     m a r g i n - b o t t o m :   5 p x ; 
     f o n t - s i z e :   1 r e m ; 
 } 
 . e d - c h a t - i n p u t - w r a p p e r   { 
     d i s p l a y :   f l e x ; 
     g a p :   8 p x ; 
 } 
 . e d - c h a t - i n p u t - w r a p p e r   i n p u t   { 
     f l e x :   1 ; 
     p a d d i n g :   1 0 p x   1 4 p x ; 
     b o r d e r :   1 p x   s o l i d   # c b d 5 e 1 ; 
     b o r d e r - r a d i u s :   2 0 p x ; 
     o u t l i n e :   n o n e ; 
     f o n t - s i z e :   0 . 9 5 r e m ; 
     t r a n s i t i o n :   a l l   0 . 2 s ; 
 } 
 . e d - c h a t - i n p u t - w r a p p e r   i n p u t : f o c u s   { 
     b o r d e r - c o l o r :   # a 8 5 5 f 7 ; 
     b o x - s h a d o w :   0   0   0   3 p x   r g b a ( 1 6 8 , 8 5 , 2 4 7 , 0 . 1 ) ; 
 } 
 . e d - c h a t - i n p u t - w r a p p e r   b u t t o n   { 
     b a c k g r o u n d :   # a 8 5 5 f 7 ; 
     c o l o r :   w h i t e ; 
     b o r d e r :   n o n e ; 
     p a d d i n g :   0   1 6 p x ; 
     b o r d e r - r a d i u s :   2 0 p x ; 
     c u r s o r :   p o i n t e r ; 
     f o n t - w e i g h t :   6 0 0 ; 
     t r a n s i t i o n :   a l l   0 . 2 s ; 
 } 
 . e d - c h a t - i n p u t - w r a p p e r   b u t t o n : h o v e r   { 
     b a c k g r o u n d :   # 9 3 3 3 e a ; 
 } 
  
 