/* Header Fix for FastAPI App */

/* Main Header Container */
.header,
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: white;
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 20px;
}

/* Header Content Layout */
.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
}

/* Header Left Section */
.header-left {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
}

/* Logo Container */
.logo-container,
.logo-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  height: 32px;
  width: auto;
  object-fit: contain;
}

/* File Info Section (Center) */
.file-info {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-width: 0; /* Allow flex item to shrink */
}

.file-name {
  font-size: 16px;
  font-weight: 500;
  color: #212121;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.file-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: #f5f5f5;
  border-radius: 20px;
  font-size: 14px;
  color: #616161;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #bdbdbd;
  flex-shrink: 0;
}

.status-dot.active {
  background: #4CAF50;
}

.status-dot.processing {
  background: #FF9800;
  animation: pulse 1.5s ease-in-out infinite;
}

.status-dot.error {
  background: #F44336;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.2);
  }
}

/* Header Right Section */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Header Buttons */
.header-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  color: #424242;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.header-btn:hover {
  background: #f5f5f5;
  border-color: #bdbdbd;
}

.header-btn.primary {
  background: #2196F3;
  color: white;
  border-color: #2196F3;
}

.header-btn.primary:hover {
  background: #1976D2;
  border-color: #1976D2;
  box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

.header-btn.clustering {
  background: #9C27B0;
  color: white;
  border-color: #9C27B0;
}

.header-btn.clustering:hover {
  background: #7B1FA2;
  border-color: #7B1FA2;
  box-shadow: 0 2px 4px rgba(156, 39, 176, 0.3);
}

.header-btn:disabled {
  background: #f5f5f5;
  color: #bdbdbd;
  border-color: #e0e0e0;
  cursor: not-allowed;
}

/* User Info */
.user-info {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-right: 1px solid #e0e0e0;
  margin-right: 12px;
}

.username {
  color: #424242;
  font-size: 14px;
  font-weight: 500;
}

/* Logout Button */
.header-btn.logout {
  color: #dc2626;
  border-color: #fee2e2;
}

.header-btn.logout:hover {
  background: #fee2e2;
  border-color: #fecaca;
}

/* Icon Styles */
.header-btn i,
.header-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* File Indicator Badge */
.file-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #E3F2FD;
  border-radius: 20px;
  font-size: 14px;
  color: #1976D2;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .file-name {
    max-width: 200px;
  }
}

@media (max-width: 768px) {
  .header,
  .app-header {
    padding: 0 12px;
  }
  
  .header-left {
    gap: 12px;
  }
  
  .logo {
    height: 28px;
  }
  
  .file-info {
    display: none;
  }
  
  .header-btn span {
    display: none;
  }
  
  .header-btn {
    padding: 8px 12px;
  }
}