/* ============================================
   BestPlan CRM - Education Admin Styles
   Steve Jobs Level Design
   ============================================ */

/* ============ EDUCATION SECTIONS ============ */

.education-section {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-200);
}

.section-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
}

.section-header-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-header-mini h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: var(--green);
  color: var(--white);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

/* ============ CANDIDATES GRID ============ */

.candidates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.candidate-card {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.candidate-card:hover {
  background: var(--white);
  border-color: var(--green);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.candidate-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.candidate-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.candidate-info {
  flex: 1;
  min-width: 0;
}

.candidate-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.candidate-contact {
  font-size: 13px;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.candidate-status {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.candidate-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-800);
}

.stat-label {
  font-size: 11px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.progress-bar {
  height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ============ ACTIVITY FEED ============ */

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 600px;
  overflow-y: auto;
}

.activity-card {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.activity-card.has-task {
  background: linear-gradient(135deg, rgba(246, 199, 122, 0.1) 0%, rgba(246, 199, 122, 0.05) 100%);
  border: 1px solid var(--gold);
}

.activity-icon {
  width: 36px;
  height: 36px;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-message {
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.5;
}

.activity-message strong {
  color: var(--gray-900);
}

.activity-time {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 4px;
}

.activity-submission {
  margin-top: 12px;
  padding: 12px;
  background: var(--white);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--green);
}

.activity-submission p {
  font-size: 13px;
  color: var(--gray-600);
  margin: 0;
  white-space: pre-wrap;
}

.activity-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--gray-100);
  border-radius: 4px;
  font-size: 12px;
  color: var(--gray-600);
  text-decoration: none;
  transition: all 0.15s ease;
}

.attachment-link:hover {
  background: var(--green);
  color: var(--white);
}

.mentor-task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  background: var(--gold);
  border-radius: var(--radius-sm);
}

.mentor-task-text {
  font-size: 13px;
  color: var(--gray-800);
  font-weight: 500;
}

/* ============ COURSES LIST ============ */

.courses-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.course-item {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.2s ease;
}

.course-item:hover {
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.course-item-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.course-item-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--white);
  flex-shrink: 0;
}

.course-item-info {
  flex: 1;
  min-width: 0;
}

.course-item-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
}

.course-item-meta {
  font-size: 13px;
  color: var(--gray-500);
}

.course-item-actions {
  display: flex;
  gap: 8px;
}

.course-steps-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 16px;
}

.step-preview {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--white);
  border-radius: 4px;
  font-size: 12px;
  color: var(--gray-600);
}

.step-preview .step-number {
  width: 18px;
  height: 18px;
  background: var(--green);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
}

.step-preview.more {
  background: var(--gray-200);
  color: var(--gray-500);
}

/* ============ MODALS ============ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-overlay.fullscreen {
  padding: 0;
}

.modal-overlay .modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.show .modal {
  transform: translateY(0);
}

.modal-large {
  max-width: 640px;
}

.modal-fullscreen {
  max-width: 100%;
  max-height: 100%;
  height: 100vh;
  border-radius: 0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
}

.modal-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--gray-100);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  transition: all 0.15s ease;
}

.modal-close:hover {
  background: var(--gray-200);
  color: var(--gray-700);
}

.modal-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--gray-200);
  flex-shrink: 0;
}

/* ============ COURSE EDITOR ============ */

.course-editor {
  display: flex;
  height: calc(100vh - 65px);
}

.editor-sidebar {
  width: 280px;
  background: var(--gray-50);
  border-right: 1px solid var(--gray-200);
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.editor-sidebar h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 12px;
}

.steps-list-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.step-item-editor {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--white);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  border: 2px solid transparent;
}

.step-item-editor:hover {
  border-color: var(--gray-300);
}

.step-item-editor.active {
  border-color: var(--green);
  background: rgba(98, 148, 137, 0.05);
}

.step-drag {
  color: var(--gray-400);
  cursor: grab;
  font-size: 12px;
}

.step-order {
  width: 22px;
  height: 22px;
  background: var(--green);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.step-title-mini {
  flex: 1;
  font-size: 13px;
  color: var(--gray-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.editor-main {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  background: var(--beige);
}

.editor-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--gray-500);
}

.editor-placeholder .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.step-editor {
  max-width: 800px;
  margin: 0 auto;
}

.editor-section {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.editor-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 12px;
}

.editor-section.danger-zone {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.blocks-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.block-editor {
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--gray-100);
}

.block-type {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
}

.block-editor .form-input,
.block-editor textarea {
  border: none;
  border-radius: 0;
  background: transparent;
}

.block-content {
  padding: 12px;
}

.block-actions {
  display: flex;
  gap: 8px;
}

.video-upload-area {
  padding: 12px;
}

.video-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ============ CANDIDATE DETAIL ============ */

.candidate-detail {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-section {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-200);
}

.detail-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.detail-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-label {
  font-size: 11px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-value {
  font-size: 14px;
  color: var(--gray-800);
  font-weight: 500;
}

.mini-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.mini-activity {
  display: flex;
  gap: 12px;
  font-size: 13px;
}

.mini-activity-time {
  color: var(--gray-400);
  flex-shrink: 0;
  width: 80px;
}

.mini-activity-text {
  color: var(--gray-600);
}

/* ============ FORMS ============ */

.form-group {
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--gray-800);
  background: var(--white);
  transition: all 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(98, 148, 137, 0.1);
}

.form-input::placeholder {
  color: var(--gray-400);
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

.form-color {
  padding: 4px;
  height: 42px;
  cursor: pointer;
}

.form-row {
  display: flex;
  gap: 12px;
}

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

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 400 !important;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

/* ============ BUTTONS ============ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(98, 148, 137, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(98, 148, 137, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
}

.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

.btn-success {
  background: var(--success);
  color: var(--white);
}

.btn-success:hover {
  background: #16a34a;
}

.btn-danger {
  background: var(--red);
  color: var(--white);
}

.btn-danger:hover {
  background: var(--red-dark);
}

.btn-ghost.btn-danger {
  background: transparent;
  color: var(--red);
}

.btn-ghost.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* ============ EMPTY STATES ============ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state p {
  color: var(--gray-500);
  margin-bottom: 16px;
}

.empty-text {
  color: var(--gray-400);
  font-size: 13px;
  text-align: center;
  padding: 16px;
}

.loading-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--gray-400);
}

/* ============ RESPONSIVE ============ */

@media (max-width: 768px) {
  .candidates-grid {
    grid-template-columns: 1fr;
  }
  
  .candidate-stats {
    flex-wrap: wrap;
  }
  
  .course-editor {
    flex-direction: column;
  }
  
  .editor-sidebar {
    width: 100%;
    height: auto;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--gray-200);
  }
  
  .steps-list-editor {
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
  }
  
  .step-item-editor {
    flex-shrink: 0;
    min-width: 120px;
  }
  
  .form-row {
    flex-direction: column;
  }
  
  .detail-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-overlay .modal {
    max-height: 100vh;
    border-radius: 0;
  }
  
  .modal-overlay {
    padding: 0;
  }
}