/* ==================== PANEL INSTRUCTOR - CSS COMPLETO (prefijo inst-) ==================== */

/* Navbar superior fija */
.inst-top-navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  z-index: 50;
  height: 80px;
}

.inst-navbar-inner {
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inst-navbar-logo {
  display: flex;
  align-items: center;
}

.inst-logo-img {
  height: 24px;
  margin-right: 0.5rem;
}

.inst-logo-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: #374151;
}

.inst-hamburger-label {
  display: block;
  cursor: pointer;
}

.inst-hamburger-icon {
  width: 24px;
  height: 24px;
  color: #4b5563;
}

.inst-navbar-menu {
  display: none;
  flex: 1;
  justify-content: center;
}

.inst-menu-link {
  padding: 0.5rem 1.5rem;
  color: #52525b;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  border-radius: 0.375rem;
}

.inst-menu-link:hover {
  background-color: #f3f4f6;
  color: #0891b2;
}

.inst-menu-link.active {
  background-color: #cffafe;
  color: #0891b2;
  font-weight: 600;
}

.inst-navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.inst-btn-user-mode {
  padding: 0.5rem 1rem;
  background-color: #f3f4f6;
  color: #374151;
  font-size: 1.125rem;
  font-weight: 500;
  border-radius: 0.375rem;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.inst-btn-user-mode:hover {
  background-color: #d1d5db;
}

.inst-btn-logout {
  padding: 0.5rem 1rem;
  color: #374151;
  font-weight: 500;
  border-radius: 0.375rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: background-color 0.2s ease;
}

.inst-btn-logout:hover {
  background-color: #e5e7eb;
}

.inst-logout-icon {
  height: 24px;
  width: 24px;
}

/* Main content */
.inst-main-content {
  min-height: 100vh;
  background: linear-gradient(to right, #ecfeff, #ffffff);
  padding-top: 80px;
}

.inst-page-container {
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Header sección */
.inst-header-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.inst-main-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: #18181b;
}

.inst-header-subtitle {
  font-size: 0.875rem;
  color: #52525b;
  margin-top: 0.25rem;
}

/* Grid principal */
.inst-layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

/* Cards */
.inst-card {
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #d4d4d8;
  padding: 1.5rem;
}

.inst-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.inst-card-header.inst-justify-between {
  justify-content: space-between;
}

.inst-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
}

.inst-title-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: #52525b;
}

/* Formularios */
.inst-form-spacing > * + * {
  margin-top: 1.25rem;
}

.inst-form-group {
  display: flex;
  flex-direction: column;
}

.inst-form-row {
  display: flex;
  gap: 1rem;
  align-items: end;
}

.inst-form-row.inst-wrap {
  flex-wrap: wrap;
}

.inst-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  margin-bottom: 0.375rem;
}

.inst-input {
  padding: 0.625rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
}

.inst-input:focus {
  outline: none;
  border-color: #0891b2;
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.2);
}

.inst-input.inst-small {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.inst-input.inst-narrow {
  width: 4rem;
  text-align: center;
}

.inst-input.inst-flex-1 {
  flex: 1;
}

.inst-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em;
  padding-right: 2.5rem;
}

.inst-hidden {
  display: none;
}

.inst-editor-container {
  min-height: 8rem;
  border: 1px solid #d4d4d8;
  border-radius: 0.5rem;
  overflow: hidden;
}

/* Botones */
.inst-btn-primary {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.75rem;
  font-weight: 500;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.inst-btn-primary.inst-emerald {
  background-color: #10b981;
}

.inst-btn-primary.inst-emerald:hover {
  background-color: #059669;
}

.inst-btn-primary.inst-dark {
  background-color: #27272a;
}

.inst-btn-primary.inst-dark:hover {
  background-color: #09090b;
}

.inst-btn-primary.inst-small {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
}

.inst-btn-primary.inst-full {
  width: 100%;
  margin-top: 1.5rem;
}

.inst-btn-icon-small {
  width: 1rem;
  height: 1rem;
}

/* Accordion secciones */
.inst-section-accordion {
  border: 1px solid #d4d4d8;
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.inst-section-accordion.inst-dashed {
  border-style: dashed;
  border-color: #94a3b8;
}

.inst-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background-color: #f4f4f5;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

.inst-section-header:hover {
  background-color: #e4e4e7;
}

.inst-section-header.inst-dashed {
  background-color: #fafafa;
}

.inst-section-header.inst-dashed:hover {
  background-color: #f1f1f1;
}

.inst-section-title {
  font-weight: 500;
  color: #18181b;
}

.inst-chevron {
  width: 1rem;
  height: 1rem;
  color: #52525b;
  transition: transform 0.3s ease;
}

details[open] > summary > .inst-chevron {
  transform: rotate(180deg);
}

/* Sortable */
.sortable {
  padding: 0.5rem;
  background: #ffffff;
  min-height: 2rem;
}

/* Capítulo item */
.inst-chapter-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid #d4d4d8;
  background-color: #f4f4f5;
  color: #3f3f46;
  font-size: 0.875rem;
}

.inst-chapter-item.inst-video {
  background-color: #f0f9ff;
  border-color: #0ea5e9;
  color: #0369a1;
}

.inst-chapter-item.inst-no-video {
  background-color: #f4f4f5;
  border-color: #d4d4d8;
  color: #3f3f46;
}

.handle {
  cursor: move;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: background-color 0.2s ease;
}

.handle:hover {
  background-color: rgba(255,255,255,0.5);
}

.inst-drag-icon {
  width: 1rem;
  height: 1rem;
}

.inst-chapter-name {
  flex: 1;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inst-chapter-date {
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  background-color: rgba(255,255,255,0.5);
  border-radius: 9999px;
}

.inst-tag.inst-free {
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  background-color: #d1fae5;
  color: #059669;
  border-radius: 9999px;
  font-weight: 500;
}

.inst-edit-link, .inst-add-new-link {
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
}

.inst-edit-link:hover, .inst-add-new-link:hover {
  background-color: rgba(255,255,255,0.5);
}

.inst-add-new-link {
  font-size: 0.875rem;
  color: #52525b;
  gap: 0.25rem;
}

.inst-add-new-link:hover {
  color: #18181b;
}

.inst-icon-small {
  width: 1rem;
  height: 1rem;
}

/* Formulario agregar sección */
.inst-section-add-form {
  background-color: #f4f4f5;
  border: 1px solid #d4d4d8;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.inst-sections-list {
  max-height: 24rem;
  overflow-y: auto;
}

/* Media Queries */
@media (min-width: 768px) {
  .inst-hamburger-label {
    display: none;
  }
  .inst-navbar-menu {
    display: flex;
  }
  .inst-page-container {
    padding: 2rem 2.5rem 3rem;
  }
}

@media (min-width: 1024px) {
  .inst-layout-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Breadcrumb */
.inst-breadcrumb-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #0891b2;
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: color 0.2s ease;
}

.inst-breadcrumb-link:hover {
  color: #0e7490;
}

.inst-breadcrumb-icon {
  width: 1rem;
  height: 1rem;
  transition: transform 0.2s ease;
}

.inst-breadcrumb-link:hover .inst-breadcrumb-icon {
  transform: translateX(-4px);
}

/* Título capítulo */
.inst-title-section {
  margin-bottom: 2rem;
}

.inst-course-name {
  font-size: 1.125rem;
  color: #475569;
  margin-top: 0.25rem;
}

.inst-chapter-info {
  font-size: 1rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

/* Icon wrappers colores */
.inst-icon-wrapper.inst-cyan {
  background-color: #cffafe;
}

.inst-icon-wrapper.inst-emerald {
  background-color: #d1fae5;
}

.inst-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: #0891b2;
}

.inst-icon-wrapper.inst-emerald .inst-icon {
  color: #10b981;
}

/* Checkbox */
.inst-checkbox-input {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: #0891b2;
}

/* File inputs */
.inst-file-input {
  font-size: 0.875rem;
  color: #475569;
}

.inst-file-input::file-selector-button {
  margin-right: 1rem;
  padding: 0.625rem 1rem;
  border: none;
  border-radius: 0.75rem;
  font-weight: 500;
  background-color: #ecfeff;
  color: #0891b2;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.inst-file-input::file-selector-button:hover {
  background-color: #a5f3fc;
}

.inst-file-input.inst-large::file-selector-button {
  padding: 0.75rem 1.25rem;
  background-color: #0891b2;
  color: #ffffff;
}

.inst-file-input.inst-large::file-selector-button:hover {
  background-color: #0e7490;
}

/* Dashed upload */
.inst-dashed-upload {
  border: 2px dashed #cbd5e1;
  border-radius: 0.75rem;
  padding: 2rem;
  text-align: center;
  transition: border-color 0.2s ease;
}

.inst-dashed-upload:hover {
  border-color: #0891b2;
}

.inst-upload-hint {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: #64748b;
}

/* Video preview */
.inst-preview-title, .inst-subtitles-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.inst-video-wrapper {
  position: relative;
  background: #000;
  border-radius: 0.75rem;
  overflow: hidden;
}

.inst-video-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1e293b;
}

.inst-no-video {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 12rem;
  color: #94a3b8;
  font-size: 0.875rem;
}

/* Subtítulos */
.inst-subtitles-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.inst-subtitle-count {
  font-size: 0.75rem;
  font-weight: 500;
  color: #0891b2;
  background-color: #cffafe;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
}

.inst-add-subtitle-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #0891b2;
  background: none;
  border: none;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.inst-add-subtitle-btn:hover {
  color: #0e7490;
}

.inst-subtitles-list {
  max-height: 24rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.inst-subtitle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  transition: background-color 0.2s ease;
}

.inst-subtitle-item:hover {
  background-color: #f1f5f9;
}

.inst-subtitle-info {
  flex: 1;
}

.inst-subtitle-lang {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1e293b;
}

.inst-subtitle-date {
  font-size: 0.75rem;
  color: #64748b;
}

.inst-subtitle-actions {
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.inst-subtitle-item:hover .inst-subtitle-actions {
  opacity: 1;
}

.inst-action-btn {
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.inst-action-btn.inst-cyan {
  background-color: #cffafe;
  color: #0891b2;
}

.inst-action-btn.inst-cyan:hover {
  background-color: #a5f3fc;
}

.inst-action-btn.inst-red {
  background-color: #fee2e2;
  color: #dc2626;
  border: none;
}

.inst-action-btn.inst-red:hover {
  background-color: #fecaca;
}

.inst-no-subtitles {
  text-align: center;
  font-size: 0.875rem;
  color: #94a3b8;
  font-style: italic;
  padding: 1rem 0;
}

.inst-inline {
  display: inline;
}

/* Botón cyan (para guardar cambios) */
.inst-btn-primary.inst-cyan {
  background-color: #0891b2;
}

.inst-btn-primary.inst-cyan:hover {
  background-color: #0e7490;
}

/* Media query para grid 3 columnas (izquierda 2, derecha 1) */
@media (min-width: 1024px) {
  .inst-layout-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .inst-left-column {
    grid-column: span 2;
  }
}