/**
 * ShapeEd Modify - Enhanced UX Styles
 * Sidebar layout, forms, and UI components
 */

/* ============================================
   SIDEBAR LAYOUT
   ============================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
  background: #f8fafc;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar__header {
  padding: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar__logo-icon {
  font-size: 1.75rem;
}

.sidebar__logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.sidebar__toggle {
  display: none;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.5rem;
}

.sidebar__user {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar__user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
}

.sidebar__user-info {
  display: flex;
  flex-direction: column;
}

.sidebar__user-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
}

.sidebar__user-plan {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
}

.sidebar__nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

.sidebar__nav-label {
  padding: 0.5rem 1.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar__menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar__menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1.25rem;
  background: none;
  border: none;
  color: #cbd5e1;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  position: relative;
}

.sidebar__menu-item:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.sidebar__menu-item--active {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-left: 3px solid #fff;
}

.sidebar__menu-item--active .sidebar__menu-icon {
  transform: scale(1.1);
}

.sidebar__menu-icon {
  font-size: 1.25rem;
  transition: transform 0.2s ease;
}

.sidebar__menu-text {
  flex: 1;
}

.sidebar__menu-badge {
  font-size: 0.65rem;
  padding: 0.2rem 0.4rem;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 4px;
  font-weight: 600;
}

.sidebar__menu-count {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 10px;
}

.sidebar__cta {
  margin: 1rem 1.25rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar__cta-text {
  font-size: 0.85rem;
  color: #e2e8f0;
  margin: 0 0 0.75rem 0;
}

.sidebar__cta-btn {
  display: block;
  text-align: center;
  padding: 0.625rem 1rem;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  transition: background 0.2s ease;
}

.sidebar__cta-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.sidebar__footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.sidebar__footer-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.2s ease;
  padding: 0.25rem 0;
}

.sidebar__footer-link:hover {
  color: #fff;
}

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 99;
  background: #6366f1;
  border: none;
  border-radius: 8px;
  padding: 0.75rem;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 1rem 2rem;
  max-width: 900px;
}

@media (min-width: 1400px) {
  .main-content {
    padding: 1.25rem 3rem;
  }
}

/* Content Sections */
.content-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.content-section--active {
  display: block;
}

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

.content-section__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.content-section__icon {
  font-size: 1.5rem;
  line-height: 1;
}

.content-section__title-group {
  flex: 1;
}

.content-section__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.15rem 0;
}

.content-section__subtitle {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
  line-height: 1.3;
}

/* Form Cards */
.form-card {
  background: #fff;
  border-radius: 10px;
  padding: 0.875rem 1.25rem;
  margin-bottom: 0.625rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}

.form-card__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
}

.form-card__step {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.form-card__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem;
}

.form-group-modern--full {
  grid-column: 1 / -1;
}

/* Select Modern with text arrow */
.select-modern__icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  font-size: 0.75rem;
}

/* Form Link Small */
.form-link-small {
  font-size: 0.8rem;
  color: #6366f1;
  text-decoration: none;
  margin-left: 0.5rem;
}

.form-link-small:hover {
  text-decoration: underline;
}

/* Button Full Width */
.btn-modern--full {
  width: 100%;
  justify-content: center;
  margin-top: 0.5rem;
  padding: 0.65rem 1rem;
}

/* History List (for sidebar Recent Changes section) */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.history-item:hover {
  border-color: #6366f1;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
  transform: translateX(4px);
}

.history-item__icon {
  font-size: 1.75rem;
  line-height: 1;
}

.history-item__content {
  flex: 1;
  min-width: 0;
}

.history-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.375rem;
}

.history-item__title {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.95rem;
}

.history-item__time {
  font-size: 0.8rem;
  color: #94a3b8;
  white-space: nowrap;
}

.history-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.history-item__tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  background: #f1f5f9;
  color: #64748b;
  border-radius: 4px;
  font-weight: 500;
}

.history-item__tag--primary {
  background: #eef2ff;
  color: #6366f1;
}

.history-item__tag--secondary {
  background: #f0fdf4;
  color: #16a34a;
}

.history-item__file {
  font-size: 0.8rem;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item__arrow {
  color: #cbd5e1;
  font-size: 1.25rem;
  transition: transform 0.2s ease;
}

.history-item:hover .history-item__arrow {
  color: #6366f1;
  transform: translateX(4px);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px dashed #e2e8f0;
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.empty-state__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 0.5rem 0;
}

.empty-state__text {
  color: #64748b;
  margin: 0 0 1.5rem 0;
  font-size: 0.95rem;
}

/* Results Section */
.results-section .results-container-modern {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
}

.results-section .results-content-modern {
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.results-section .results-content-modern__header {
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
  min-height: 32px;
}

.results-section .results-content-modern__header:empty {
  display: none;
}

.results-section .results-actions-modern {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
  justify-content: flex-start;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar--open {
    transform: translateX(0);
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .main-content {
    margin-left: 0;
    padding: 1rem;
    padding-top: 4rem;
  }
  
  .content-section__header {
    flex-direction: column;
    text-align: center;
  }
  
  .content-section__title {
    font-size: 1.5rem;
  }
  
  .history-item {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
  
  .history-item__header {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .history-item__arrow {
    display: none;
  }
  
  .results-section .results-actions-modern {
    justify-content: center;
  }
}

/* Sidebar overlay for mobile */
@media (max-width: 768px) {
  .sidebar--open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 280px;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
  }
}

/* ============================================
   RECENT MODIFICATION HISTORY (Legacy - keep for compatibility)
   ============================================ */
.recent-history-section {
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.9));
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.recent-history-header {
  margin-bottom: 1.25rem;
  text-align: center;
}

.recent-history-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 0.25rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.recent-history-icon {
  font-size: 1.5rem;
}

.recent-history-subtitle {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0;
}

.recent-history-cards {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar but keep functionality */
.recent-history-cards::-webkit-scrollbar {
  height: 6px;
}

.recent-history-cards::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.recent-history-cards::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.recent-history-cards::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.history-card {
  flex: 0 0 auto;
  min-width: 220px;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  scroll-snap-align: start;
  position: relative;
}

.history-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
  border-color: #667eea;
}

.history-card:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.history-card__icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f4ff, #e8f0fe);
  border-radius: 12px;
}

.history-card__content {
  flex: 1;
}

.history-card__title {
  font-weight: 600;
  font-size: 1rem;
  color: #1e293b;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.history-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
}

.history-card__tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: 4px;
  background: #f1f5f9;
  color: #64748b;
}

.history-card__tag--primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #ffffff;
}

.history-card__tag--secondary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
}

.history-card__details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #94a3b8;
}

.history-card__file {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-card__words {
  color: #64748b;
}

.history-card__time {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.7rem;
  color: #94a3b8;
  background: #f8fafc;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .recent-history-section {
    padding: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .history-card {
    min-width: 180px;
    max-width: 220px;
    padding: 0.875rem 1rem;
  }
  
  .history-card__icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
  }
  
  .history-card__title {
    font-size: 0.9rem;
  }
}

/* ============================================
   HISTORY DETAIL MODAL
   ============================================ */
.history-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.history-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.history-modal__content {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.history-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border: none;
  background: #f1f5f9;
  border-radius: 50%;
  font-size: 1.5rem;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.history-modal__close:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.history-modal__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.history-modal__icon {
  font-size: 2.5rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f4ff, #e8f0fe);
  border-radius: 12px;
}

.history-modal__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 0.25rem 0;
}

.history-modal__time {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
}

.history-modal__body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.history-modal__info {
  margin-bottom: 1.5rem;
}

.history-modal__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.history-modal__file {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0;
}

.history-modal__preview {
  background: #f8fafc;
  border-radius: 12px;
  padding: 1rem;
}

.history-modal__preview h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
  margin: 0 0 0.75rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.history-modal__preview-text {
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.6;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.history-modal__footer {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.history-modal__footer .btn-modern {
  flex: 1;
}

@media (max-width: 600px) {
  .history-modal__content {
    max-height: 90vh;
    margin: 0.5rem;
  }
  
  .history-modal__header {
    padding: 1rem;
  }
  
  .history-modal__icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
  }
  
  .history-modal__body {
    padding: 1rem;
  }
  
  .history-modal__footer {
    flex-direction: column;
  }
}

/* Empty state */
.recent-history-empty {
  text-align: center;
  padding: 2rem;
  color: #64748b;
}

.recent-history-empty__icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.recent-history-empty__text {
  font-size: 0.95rem;
}

/* ============================================
   FILE UPLOAD PREVIEW
   ============================================ */
.file-preview {
  margin-top: 1rem;
  display: none;
}

.file-preview__card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.file-preview--valid .file-preview__card {
  border-color: #10b981;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
}

.file-preview--invalid .file-preview__card {
  border-color: #ef4444;
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.file-preview__icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.file-preview__info {
  flex: 1;
  min-width: 0;
}

.file-preview__name {
  font-weight: 600;
  color: #1e293b;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

.file-preview__meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #64748b;
}

.file-preview__size,
.file-preview__type {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.file-preview__type {
  background: rgba(100, 116, 139, 0.1);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

.file-preview__status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}

.file-preview--valid .file-preview__status {
  color: #059669;
}

.file-preview--invalid .file-preview__status {
  color: #dc2626;
}

.file-preview__status-icon {
  font-size: 1.1rem;
}

.file-preview__image-container {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  text-align: center;
}

.file-preview__image {
  max-width: 200px;
  max-height: 150px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  object-fit: cover;
}

.file-preview__image-label {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #64748b;
}

/* ============================================
   SKELETON LOADER
   ============================================ */
.skeleton-loader {
  padding: 1.5rem;
}

.skeleton-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-title-group {
  flex: 1;
}

.skeleton-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skeleton-line {
  height: 16px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 4px;
}

.skeleton-line--title {
  width: 60%;
  height: 20px;
  margin-bottom: 0.5rem;
}

.skeleton-line--subtitle {
  width: 40%;
  height: 14px;
}

.skeleton-line--short {
  width: 45%;
}

.skeleton-line--medium {
  width: 70%;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton-typing {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(102, 126, 234, 0.05);
  border-radius: 8px;
  border: 1px dashed rgba(102, 126, 234, 0.3);
}

.skeleton-typing__dot {
  width: 8px;
  height: 8px;
  background: #667eea;
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}

.skeleton-typing__dot:nth-child(1) { animation-delay: -0.32s; }
.skeleton-typing__dot:nth-child(2) { animation-delay: -0.16s; }
.skeleton-typing__dot:nth-child(3) { animation-delay: 0s; }

@keyframes typing-bounce {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.skeleton-typing__text {
  margin-left: 0.5rem;
  color: #667eea;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ============================================
   STREAMING STATS
   ============================================ */
.streaming-stats {
  margin-left: auto;
}

.streaming-stats__items {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.streaming-stats__item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.85rem;
  color: #64748b;
}

.streaming-stats__icon {
  font-size: 1rem;
}

.streaming-stats__value {
  font-weight: 600;
  color: #1e293b;
}

.streaming-stats__label {
  color: #94a3b8;
}

.streaming-stats__item--active {
  color: #667eea;
  background: rgba(102, 126, 234, 0.1);
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
}

.streaming-stats__item--complete {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
}

.streaming-stats__typing-indicator {
  display: inline-flex;
  gap: 3px;
  margin-right: 0.375rem;
}

.streaming-stats__typing-indicator span {
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}

.streaming-stats__typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.streaming-stats__typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
.streaming-stats__typing-indicator span:nth-child(3) { animation-delay: 0s; }

.streaming-stats__summary {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #94a3b8;
  text-align: right;
}

/* ============================================
   PROGRESS INDICATOR
   ============================================ */
.progress-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: none;
}

.progress-indicator__content {
  background: linear-gradient(135deg, #667eea, #764ba2);
  padding: 0.5rem 1rem;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.progress-indicator__bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-indicator__fill {
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease;
  position: relative;
}

.progress-indicator__fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: progress-shimmer 1.5s infinite;
}

@keyframes progress-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-indicator__text {
  color: white;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
}

/* ============================================
   ERROR MESSAGE
   ============================================ */
.error-message {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border: 1px solid #fecaca;
  border-radius: 12px;
  color: #dc2626;
}

.error-message__icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.error-message__text {
  font-size: 1rem;
  line-height: 1.5;
}

/* ============================================
   NOTIFICATION
   ============================================ */
.notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-weight: 500;
  z-index: 10000;
  animation: notification-slide-in 0.3s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.notification--success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.notification--error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.notification__icon {
  font-size: 1.2rem;
}

.notification--fade-out {
  animation: notification-slide-out 0.5s ease forwards;
}

@keyframes notification-slide-in {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes notification-slide-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

/* ============================================
   FORM DISABLED STATE
   ============================================ */
.form-disabled {
  pointer-events: none;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.form-disabled::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.5);
  border-radius: inherit;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
  .file-preview__card {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  .file-preview__meta {
    justify-content: center;
  }

  .streaming-stats__items {
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
  }

  .notification {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .results-content-modern__header {
    flex-direction: column;
    gap: 1rem;
  }

  .streaming-stats {
    margin-left: 0;
    width: 100%;
  }

  .streaming-stats__items {
    justify-content: space-between;
  }
}

/* ============================================
   ENHANCED RESULTS SECTION
   ============================================ */
.results-content-modern__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Make assistant message have better typography */
.assistant-message-modern h1,
.assistant-message-modern h2,
.assistant-message-modern h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #1e293b;
}

.assistant-message-modern h1 { font-size: 1.5rem; }
.assistant-message-modern h2 { font-size: 1.25rem; }
.assistant-message-modern h3 { font-size: 1.1rem; }

.assistant-message-modern ul,
.assistant-message-modern ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.assistant-message-modern li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.assistant-message-modern p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.assistant-message-modern strong {
  color: #1e293b;
  font-weight: 600;
}

.assistant-message-modern code {
  background: rgba(102, 126, 234, 0.1);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.9em;
  color: #667eea;
}

.assistant-message-modern pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1rem 0;
}

.assistant-message-modern pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.assistant-message-modern blockquote {
  border-left: 4px solid #667eea;
  padding-left: 1rem;
  margin: 1rem 0;
  color: #64748b;
  font-style: italic;
}

.assistant-message-modern table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.assistant-message-modern th,
.assistant-message-modern td {
  border: 1px solid #e2e8f0;
  padding: 0.75rem;
  text-align: left;
}

.assistant-message-modern th {
  background: #f8fafc;
  font-weight: 600;
  color: #1e293b;
}

.assistant-message-modern tr:nth-child(even) {
  background: #f8fafc;
}
